[
https://issues.apache.org/jira/browse/LIBCLOUD-842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15399587#comment-15399587
]
Luke Morfitt commented on LIBCLOUD-842:
---------------------------------------
I've narrowed the issue down to a specific commit.
This is the test code I was using to confirm if I had an issue.
{code}
$ cat az_upload.py
from libcloud.storage.types import Provider
from libcloud.storage.providers import get_driver
FILE_PATH = './myfile.tar.gz'
cls = get_driver(Provider.AZURE_BLOBS)
driver = cls('StorageAccount', 'MagicSecureKeyGoesHere')
container = driver.get_container(container_name='luke-test')
with open(FILE_PATH, 'rb') as iterator:
obj = driver.upload_object_via_stream(iterator=iterator,
container=container,
object_name='backup.tar.gz')
{code}
Here is a git bisect results
{code}
$ git bisect start
$ git bisect bad
$ git bisect good v0.20.1
Bisecting: a merge base must be tested
[4087f45504f7c3bbd0f389420e9ecbdedf93ded9] Bump versions for release
$ git bisect good
Bisecting: 409 revisions left to test after this (roughly 9 steps)
[8d975a255fffc85810ab2d8129d5314a8e09469e] adds luadns as a provider
$ git bisect bad
Bisecting: 204 revisions left to test after this (roughly 8 steps)
[a6642d4d6375dd247a0e993351721b92a142462f] Fix lint.
$ git bisect good
Bisecting: 102 revisions left to test after this (roughly 7 steps)
[8c64e1741b2baab9d36e88cffdcaa43503412e11] Merge branch 'trunk' of
https://github.com/DimensionDataCBUSydney/libcloud into trunk
$ git bisect bad
Bisecting: 50 revisions left to test after this (roughly 6 steps)
[022d01edd63bb018dd3054bea3daaff23570f37f] Improvements to Google Auth for
Storage and Compute and MIME bug fix
$ git bisect bad
Bisecting: 26 revisions left to test after this (roughly 5 steps)
[bd17cb9362c5608f32e1181a1ff0469e473d4f70] Try using generic sourcecode
$ git bisect good
Bisecting: 13 revisions left to test after this (roughly 4 steps)
[ba3107c3cfcddbb140b007b4b8e8b54169a5f40b] DimensionData: changing image to be
NodeImage or str, upping code coverage in tests
$ git bisect good
Bisecting: 6 revisions left to test after this (roughly 3 steps)
[e4f5fbfb286b481d46468dbb29a0a283a6eb5da0] Cast header value as str in
canonical_headers
$ git bisect bad
Bisecting: 3 revisions left to test after this (roughly 2 steps)
[a956d8274ac388ec0001cc5552f934c87e89d3ce] DimensionData: Adding a new
exception code/message, testing backup exceptions
$ git bisect good
Bisecting: 1 revision left to test after this (roughly 1 step)
[4bff0f076776e6d59945381c1e2969826131fc11] Do not add automatically host /
accept-encoding header
$ git bisect bad
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[0e4e0ada6ae579e5c739993bb6b714841eac990e] Small typo Closes #693
$ git bisect good
4bff0f076776e6d59945381c1e2969826131fc11 is the first bad commit
commit 4bff0f076776e6d59945381c1e2969826131fc11
Author: Geunwoo Shin <[email protected]>
Date: Wed Jan 27 19:47:12 2016 +0900
Do not add automatically host / accept-encoding header
Due to headers dictionary always have host / accept-encoding value, when
perform 'raw' request, host / accept-encoding header would be
duplicated. If you use AWSRequestSignerAlgorithmV4, this occurs invalid
payload hash.
:040000 040000 825a1381ab3aaa54a5d7e9b1d6296bb6914536fa
5b0ec48c801d4f831048eba0dd75b48e0e5906bf M libcloud
{code}
> Azure blob storage - 'Error initializing upload. Code: 400'
> -----------------------------------------------------------
>
> Key: LIBCLOUD-842
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-842
> Project: Libcloud
> Issue Type: Bug
> Components: Storage
> Environment: Production
> Reporter: Luke Morfitt
> Labels: blobstore, storage_drivers
>
> When using libcloud version 1.1.0 with azure blob storage we are seeing the
> following error. This issue does not appear in 0.20.1 and we are currently
> investigating the differences between the two releases.
> {code}
> Upload Thread - Unhandled exception - Error initializing upload. Code: 400 -
> <LibcloudError in
> <libcloud.storage.drivers.azure_blobs.AzureBlobsStorageDriver object at
> 0x7f1e2778b790> 'Error initializing upload. Code: 400'>
> Traceback (most recent call last):
> File "/usr/local/gamesparks/analytics_upload.py", line 383, in
> FileUploadThread
> object_name=bname)
> File
> "/usr/local/lib/python2.7/dist-packages/libcloud/storage/drivers/azure_blobs.py",
> line 838, in upload_object_via_stream
> use_lease=ex_use_lease)
> File
> "/usr/local/lib/python2.7/dist-packages/libcloud/storage/drivers/azure_blobs.py",
> line 935, in _put_object
> iterator=iterator)
> File "/usr/local/lib/python2.7/dist-packages/libcloud/storage/base.py",
> line 654, in _upload_object
> **upload_func_kwargs)
> File
> "/usr/local/lib/python2.7/dist-packages/libcloud/storage/drivers/azure_blobs.py",
> line 612, in _upload_in_chunks
> (response.status), driver=self)
> LibcloudError: <LibcloudError in
> <libcloud.storage.drivers.azure_blobs.AzureBlobsStorageDriver object at
> 0x7f1e2778b790> 'Error initializing upload. Code: 400'>
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)