Azure / azure-storage-python

Microsoft Azure Storage Library for Python
https://azure-storage.readthedocs.io
MIT License
339 stars 241 forks source link

Retry policy did not allow for a retry. HTTP status code=403 blob_service.exists(CONTAINER_NAME) #495

Closed kgopi007 closed 6 years ago

kgopi007 commented 6 years ago

Which service(blob, file, queue) does this issue concern?

BLOB

Which version of the SDK was used? Please provide the output of pip freeze.

python3.4 -m pip freeze adal==1.0.2 asn1crypto==0.24.0 azure==4.0.0 azure-applicationinsights==0.1.0 azure-batch==4.1.3 azure-common==1.1.14 azure-cosmosdb-nspkg==2.0.2 azure-cosmosdb-table==1.0.4 azure-datalake-store==0.0.27 azure-eventgrid==1.1.0 azure-graphrbac==0.40.0 azure-keyvault==1.1.0 azure-loganalytics==0.1.0 azure-mgmt==4.0.0 azure-mgmt-advisor==1.0.1 azure-mgmt-applicationinsights==0.1.1 azure-mgmt-authorization==0.50.0 azure-mgmt-batch==5.0.1 azure-mgmt-batchai==2.0.0 azure-mgmt-billing==0.2.0 azure-mgmt-cdn==3.0.0 azure-mgmt-cognitiveservices==3.0.0 azure-mgmt-commerce==1.0.1 azure-mgmt-compute==4.0.1 azure-mgmt-consumption==2.0.0 azure-mgmt-containerinstance==1.0.0 azure-mgmt-containerregistry==2.1.0 azure-mgmt-containerservice==4.2.2 azure-mgmt-cosmosdb==0.4.1 azure-mgmt-datafactory==0.6.0 azure-mgmt-datalake-analytics==0.6.0 azure-mgmt-datalake-nspkg==2.0.0 azure-mgmt-datalake-store==0.5.0 azure-mgmt-datamigration==1.0.0 azure-mgmt-devspaces==0.1.0 azure-mgmt-devtestlabs==2.2.0 azure-mgmt-dns==2.0.0 azure-mgmt-eventgrid==1.0.0 azure-mgmt-eventhub==2.1.0 azure-mgmt-hanaonazure==0.1.1 azure-mgmt-iotcentral==0.1.0 azure-mgmt-iothub==0.5.0 azure-mgmt-iothubprovisioningservices==0.2.0 azure-mgmt-keyvault==1.1.0 azure-mgmt-loganalytics==0.2.0 azure-mgmt-logic==3.0.0 azure-mgmt-machinelearningcompute==0.4.1 azure-mgmt-managementgroups==0.1.0 azure-mgmt-managementpartner==0.1.0 azure-mgmt-maps==0.1.0 azure-mgmt-marketplaceordering==0.1.0 azure-mgmt-media==1.0.0rc2 azure-mgmt-monitor==0.5.2 azure-mgmt-msi==0.2.0 azure-mgmt-network==2.0.1 azure-mgmt-notificationhubs==2.0.0 azure-mgmt-nspkg==2.0.0 azure-mgmt-policyinsights==0.1.0 azure-mgmt-powerbiembedded==2.0.0 azure-mgmt-rdbms==1.2.0 azure-mgmt-recoveryservices==0.3.0 azure-mgmt-recoveryservicesbackup==0.3.0 azure-mgmt-redis==5.0.0 azure-mgmt-relay==0.1.0 azure-mgmt-reservations==0.2.1 azure-mgmt-resource==2.0.0 azure-mgmt-scheduler==2.0.0 azure-mgmt-search==2.0.0 azure-mgmt-servicebus==0.5.1 azure-mgmt-servicefabric==0.2.0 azure-mgmt-signalr==0.1.0 azure-mgmt-sql==0.9.1 azure-mgmt-storage==2.0.0 azure-mgmt-subscription==0.2.0 azure-mgmt-trafficmanager==0.50.0 azure-mgmt-web==0.35.0 azure-nspkg==2.0.0 azure-servicebus==0.21.1 azure-servicefabric==6.3.0.0 azure-servicemanagement-legacy==0.20.6 azure-storage-blob==1.3.1 azure-storage-common==1.3.0 azure-storage-file==1.3.1 azure-storage-nspkg==3.0.0 azure-storage-queue==1.3.0 certifi==2018.8.13 cffi==1.11.5 chardet==3.0.4 cryptography==2.3.1 futures==3.1.1 idna==2.7 isodate==0.6.0 msrest==0.5.4 msrestazure==0.5.0 oauthlib==2.1.0 pycparser==2.18 PyJWT==1.6.4 python-dateutil==2.7.3 requests==2.19.1 requests-oauthlib==1.0.0 six==1.11.0 typing==3.6.4 urllib3==1.23

What problem was encountered?

Retry policy did not allow for a retry. HTTP status code=403 blob_service.exists(CONTAINER_NAME) When this python program is called directly it runs successfully and the file is uploaded into blob in less-than a second. But if it is called from Talend job the Python code fail with this error. Retry policy did not allow for a retry. HTTP status code=403 blob_service.exists(CONTAINER_NAME)

Have you found a mitigation/solution?

No

Note: for table service, please post the issue here instead: https://github.com/Azure/azure-cosmosdb-python.

zezha-msft commented 6 years ago

Hi @kgopi007, thanks for reaching out!

That does not sound like an issue related to the SDK, but rather something with your particular environment. Please double-check that you are passing in the correct credentials.

kgopi007 commented 6 years ago

I am not sure what to check in the environment because it didn't give me any reasonable error. When i run the python directly it works fine and when i trigger the same from Talend job it says "Retry policy did not allow for a retry. HTTP status code=403 Authentication failed"

zezha-msft commented 6 years ago

Hi @kgopi007, unfortunately I have no knowledge of Talend job. How are you authenticating for the Storage service? Share key or SAS?

kgopi007 commented 6 years ago

Using SAS key. We have 2 python script. First one will connect to azure Key vault and get the SAS key. 2nd python will use that SAS key and will create blob from path.

Both script works when it is executed directly. Only 2nd python script fails with this error when it is triggered from Talend job.

zezha-msft commented 6 years ago

Hi @kgopi007, how is your first script passing the SAS token to the second script?