azure-sdk-for-python: Container client fails slowly instead of ResourceNotFound
azure-storage-blob12.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 6 years ago
- Comments: 15 (5 by maintainers)
Commits related to this issue
- 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 6 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 6 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 5 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 5 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”