question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:

  1. Error about non-existing account name upon creation of QueueClient (I understand this might not be possible, because additional REST call would be required)
  2. Shorter timeout
  3. Some indication in the error message about possibility of non-existing account.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
shwarscommented, Nov 19, 2020

@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.

1reaction
xiafu-msftcommented, Oct 8, 2020

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found