[Storage] Confusing behavior accessing nonexistent Azure Queue Storage
See original GitHub issue- Package Name: azure-storage-queue
- Package Version: 12.1.3
- Operating System: windows / linux
- Python Version: 3.7.4
Describe the bug
When trying to access non-existent account of Azure queue storage, QueueClient
is created w/out errors, and calling receive_messages()
results in a long timeout (followed by an error).
To Reproduce:
Consider the following code:
from azure.storage.queue import QueueClient
conn = "<correctly formed connection string with invalid account name>"
print("Creating client")
queue_client = QueueClient.from_connection_string(conn, "thequeue")
print("Getting queue messages")
for x in queue_client.receive_messages():
print(x)
This code prints both messages immediately, followed by a long (80 seconds) delay. Traceback of an error that follows is available here
The long timeout behavior is confusing, especially when you are debugging a program that has an endless loop over queue messages, and you are wondering, why it is not executing.
Expected behavior One of the following options:
- Error about non-existing account name upon creation of
QueueClient
(I understand this might not be possible, because additional REST call would be required) - Shorter timeout
- Some indication in the error message about possibility of non-existing account.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
StorageClientException: The specified message does not exist?
This happens due to the lightweight transactional model by Windows Azure Queues. It guarantees, that the message will be processed at least ...
Read more >Tutorial: Work with Azure Queue Storage queues in .NET
A tutorial on using the Azure Queue Storage to create queues, and insert, get, and delete messages using .NET code.
Read more >Get started with Azure Queue Storage using .NET
Azure Queue storage is a service for storing large numbers of messages that can be accessed from anywhere in the world via authenticated...
Read more >Troubleshoot performance issues in Azure Storage accounts
Possible reasons for the client responding slowly include having a limited number of available connections or threads, or being low on resources ...
Read more >Queue Storage error codes (REST API) - Microsoft Learn
Get error codes for Azure Queue Storage. ... MessageNotFound, Not Found (404), The specified message does not exist.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@xiafu-msft This problem was discovered as part of an end-to-end scenario, where I tried to evaluate how seamless is the technology for beginners. I believe that long 30 sec timeout instead of an error message is kind of misleading, and thus I think at least a short paragraph of text explaining this behaviour is nice to have in a quickstart document.
hi @shwars
This should be resolved if you set retry_connect=0 when initiating QueueClient, this will help throw immediately on connection failure. currently the connection_timeout=20 (seconds) you can set to a smaller value if you want.
Let me know if you have any questions!