Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Azure returns 'AuthenticationFailed (403)' if calling copy_blob after create_blob_snapshot #276

Closed
AbelHu opened this issue Sep 15, 2015 · 1 comment
Labels
asm bug This issue requires a change to an existing behavior in the product in order to be resolved. Storage

Comments

@AbelHu
Copy link
Member

AbelHu commented Sep 15, 2015

Azure returns 'AuthenticationFailed (403)' if calling copy_blob after create_blob_snapshot. If creating a new azure_client to call copy_blob, Azure returns success.

Code:
azure_client = Azure.client(storage_account_name: 'STORAGE-ACCOUNT', storage_access_key: 'STORAGE-KEY')
azure_client.storage_blob_host = 'https://STORAGE-ACCOUNT.blob.core.windows.net'
bs = azure_client.blobs
snapshot_time = bs.create_blob_snapshot(container_name, blob_name, {:metadata => metadata})
copy_id, copy_status = bs.copy_blob(container_name, snapshot_blob_name, container_name, blob_name, {:source_snapshot => snapshot_time})

Error logs:
/var/lib/gems/1.9.1/gems/azure-0.7.0/lib/azure/core/http/http_request.rb:150:in call': AuthenticationFailed (403): Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. (Azure::Core::Http::HTTPError) RequestId:54be9934-0001-0031-6c78-ef3e72000000 Time:2015-09-15T05:34:33.3173312Z from /var/lib/gems/1.9.1/gems/azure-0.7.0/lib/azure/core/http/signer_filter.rb:28:incall'
from /var/lib/gems/1.9.1/gems/azure-0.7.0/lib/azure/core/http/signer_filter.rb:28:in call' from /var/lib/gems/1.9.1/gems/azure-0.7.0/lib/azure/core/http/http_request.rb:97:inblock in with_filter'
from /var/lib/gems/1.9.1/gems/azure-0.7.0/lib/azure/core/service.rb:36:in call' from /var/lib/gems/1.9.1/gems/azure-0.7.0/lib/azure/core/filtered_service.rb:34:incall'
from /var/lib/gems/1.9.1/gems/azure-0.7.0/lib/azure/core/signed_service.rb:41:in call' from /var/lib/gems/1.9.1/gems/azure-0.7.0/lib/azure/blob/blob_service.rb:1380:incall'
from /var/lib/gems/1.9.1/gems/azure-0.7.0/lib/azure/blob/blob_service.rb:1209:in `copy_blob'

@devigned devigned added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Mar 15, 2016
@yaxia
Copy link
Member

yaxia commented Mar 31, 2016

Please update to the new storage gem for the fix. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
asm bug This issue requires a change to an existing behavior in the product in order to be resolved. Storage
Projects
None yet
Development

No branches or pull requests

4 participants