azure-sdk-for-python: Container client fails slowly instead of ResourceNotFound
azure-storage-blob
12.3.2
- Ubuntu 20.04
- 3.8.2
Describe the bug I’ve been advised in #12744 to open a new issue for this behaviour.
I’m trying to use
from azure.storage.blob import ContainerClient
client = ContainerClient("storage1234567", container_name="container-01")
client.get_container_properties()
to check if a container exists. I had expected either an immediate ResourceNotFound
or otherwise some unauthorised message - basically anything that would allow me to fail fast. Instead the command runs for about 2 minutes, retrying twice (three times in total, I believe with some backoff) resulting in
azure.core.exceptions.ServiceRequestError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f7bd6ef8bb0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution
I have also tried all the timeout kwargs
I can think of, timeout
, read_timeout
, connection_timeout
, socket_timeout
(supplied as numeric or tuple) and none make a difference.
Is there a way to short-circuit this and allow me to catch some faster failure?
To Reproduce
from azure.storage.blob import ContainerClient
client = ContainerClient("storage1234567", container_name="container-01")
client.get_container_properties()
Expected behavior @tasherif-msft advises
Hi @AkhilGNair, interesting issue you’ve come across, but this is actually an unexpected behavior. The error you’re getting implies the request was not sent (you would receive a ResourceNotFound response from the server if the request was sent).
My expectation is that I can quickly catch a failure!
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (5 by maintainers)
Commits related to this issue
- CodeGen from PR 13585 in Azure/azure-rest-api-specs Dev keyvault microsoft.key vault 2021 04 01 preview (#13585) * Adds base for updating Microsoft.KeyVault from version preview/2020-04-01-preview to... — committed to AzureSDKAutomation/azure-sdk-for-python by deleted user 3 years ago
- CodeGen from PR 14326 in Azure/azure-rest-api-specs OperationalInsights add missing Workspace features properties (#14326) * fixing the URL for Authorization (#13767) * [NetAppFiles] Fix protocolT... — committed to AzureSDKAutomation/azure-sdk-for-python by deleted user 3 years ago
- [AutoRelease] t2-loganalytics-2021-05-13-47912 (#18694) * CodeGen from PR 14326 in Azure/azure-rest-api-specs OperationalInsights add missing Workspace features properties (#14326) * fixing the U... — committed to Azure/azure-sdk-for-python by deleted user 3 years ago
- CodeGen from PR 14569 in Azure/azure-rest-api-specs Dabenham/cluster patch billing type (#14569) * Updated the models to include systemData and removed the supression f… (#13354) * Updated the mod... — committed to AzureSDKAutomation/azure-sdk-for-python by deleted user 3 years ago
- CodeGen from PR 15079 in Azure/azure-rest-api-specs Remove table retention limit from swagger (#15079) * Eiot sensors type alignment for new provider (#13780) * change boolean to enum * align n... — committed to AzureSDKAutomation/azure-sdk-for-python by deleted user 3 years ago
- CodeGen from PR 16690 in Azure/azure-rest-api-specs Add PUT operation for Tables endpoint and longRunning op for cluster Patch (#16690) * [Hub Generated] Review request for Microsoft.Consumption to a... — committed to AzureSDKAutomation/azure-sdk-for-python by deleted user 3 years ago
- [AutoRelease] t2-loganalytics-2021-11-16-55983 (#21776) * CodeGen from PR 16690 in Azure/azure-rest-api-specs Add PUT operation for Tables endpoint and longRunning op for cluster Patch (#16690) *... — committed to Azure/azure-sdk-for-python by deleted user 3 years ago
- CodeGen from PR 16690 in Azure/azure-rest-api-specs Add PUT operation for Tables endpoint and longRunning op for cluster Patch (#16690) * [Hub Generated] Review request for Microsoft.Consumption to a... — committed to AzureSDKAutomation/azure-sdk-for-python by deleted user 2 years ago
- CodeGen from PR 17183 in Azure/azure-rest-api-specs CDS component type update - mismatch between swagger and code values (#17183) * [Hub Generated] Review request for Microsoft.CostManagement to add... — committed to AzureSDKAutomation/azure-sdk-for-python by deleted user 2 years ago
- CodeGen from PR 17490 in Azure/azure-rest-api-specs [OperationalInsights] Remove unsupported version 2021-06-01 for "Tables" resource (#17490) * Dev weather microsoft.maps 1.0 (#13796) * Remove pr... — committed to AzureSDKAutomation/azure-sdk-for-python by deleted user 2 years ago
- CodeGen from PR 17379 in Azure/azure-rest-api-specs [OperationalInsights] Workspace provisioningState was set to readOnly (#17379) * [aks] fix vm size model and osDiskType description (#13763) * ... — committed to AzureSDKAutomation/azure-sdk-for-python by deleted user 2 years ago
- CodeGen from PR 17856 in Azure/azure-rest-api-specs Dev cost management microsoft.cost management 2022 02 01 preview (#17856) * Add new Azure Object Anchors API version 0.3-preview.0 (#17117) * ad... — committed to azure-sdk/azure-sdk-for-python by deleted user 2 years ago
This is great (and makes me feel stupid 😉) - the validation would be perfect as it was just the URL validation I was missing.
Creds are fine, no issue there - just wanted to catch the unauthorised error.
Thank you!
Hi @AkhilGNair
The error says “Temporary failure in name resolution” can you try to change the container name to “container01”