Skip to content

Can't Delete Storage Queue Message #41081

Open
@yovelcohen

Description

@yovelcohen
  • Package Name: azure-storage-queue
  • Package Version: 12.12.0
  • Operating System: MacOs/Ubuntu
  • Python Version: 3.12

Sometimes My app produces repeating messages for entities in the system that were already processed.
The app filters those messages with an internal logic and than tries to delete the message from the queue if the Job is already done for the given entity.

My logic looks something like this:

MSG_TO = 60 * 10

queue_client: QueueClient = await get_or_create_queue_client(settings.FINALIZE_TRANSCRIPTION_QUEUE_NAME)  # noqa
if message := await queue_client.receive_message(visibility_timeout=MSG_TO):
    if await should_run_job(message):
        await run_job(message)
    else:
	queue_client.delete_message(message)

When I try to delete the message, I get this error:

Traceback (most recent call last):
  File "/app/app/job.py", line 141, in _safe_del_msg
    await queue_client.delete_message(msg)
  File "/app/.venv/lib/python3.12/site-packages/azure/core/tracing/decorator_async.py", line 119, in wrapper_use_tracer
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/azure/storage/queue/aio/_queue_client_async.py", line 981, in delete_message
    raise ValueError("pop_receipt must be present")
ValueError: pop_receipt must be present

Now, according to the docs, I should be able to just delete the message, because when I use the receive_message method, it should assign a pop_receipt to it.
yet, it's none and than the message just keeping coming back to the queue, waking up the service and

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-author-feedbackWorkflow: More information is needed from author to address the issue.no-recent-activityThere has been no recent activity on this issue.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions