paolosalvatori / ServiceBusExplorer

The Service Bus Explorer allows users to connect to a Service Bus namespace and administer messaging entities in an easy manner. The tool provides advanced features like import/export functionality or the ability to test topic, queues, subscriptions, relay services, notification hubs and events hubs.
MIT License
2.01k stars 585 forks source link

Accidental queue deletion validation #773

Closed Didjacome closed 6 months ago

Didjacome commented 6 months ago

Hello everyone, 👋

I hope this message finds you well and in good spirits. I'm reaching out because I've encountered a bit of a puzzle and could really use your insights or advice.

Context

My goal was simple:

Scenario

So, here's what happened:

I initiated the "Receive Dead-Letter Queue Messages" process at 13:05 using the ServiceBusExplorer application. However, the app crashed without generating any logs, yet it seemed to continue processing the action. I let it run for an hour. Upon returning at 14:00 to check the status, I discovered that the queue had been deleted.

I checked the Azure portal to determine what might have happened, consulting the active log, but found no record of any activity.

Since diagnostic settings for operational logs are enabled on the service bus, I was able to identify a log in Azure Log Analytics indicating that the queue was deleted at 13:32.

tools used:

Questions for Verification:

  1. Could using the "Receive Dead-Letter Queue Messages" feature in Service Bus Explorer inadvertently delete the queue?

  2. Where does Service Bus Explorer store logs of previous actions?

This version adds a touch of humor and a more conversational tone to make the request more engaging and friendly.

SeanFeldman commented 6 months ago

AFAIK, the "Receive Dead-Letter Queue Messages" operation is receiving messages in ReceiveAndDelete mode. It doesn't manipulate entities. Who else besides you have access to the namespace?

Didjacome commented 6 months ago

I've noticed that, in this scenario, the other two individuals possess administrative "Contributor" access across the entire service bus.

However, I've been unable to locate any record of the queue's deletion in the Azure portal, specifically within the active logs section.

I proceeded to recreate the queue, and interestingly, upon its recreation, the record of this action became visible in the portal's active logs.

SeanFeldman commented 6 months ago

Yeah, something is off. I don't know how that would be even possible with a message receiving.

Didjacome commented 6 months ago

Thank you for your feedback. I have a few questions that I hope you can help me with:

SeanFeldman commented 6 months ago

Both operations are explicit UI operations that would require a human. So the short answer is no.

I'm also extrapolating years of use of this tool and I don't recall anyone running into this issue.

Could you also check what the accidental deletion setting is set to for you? Options --> General

It's should turned on by default.

But in general, receive operations are not destructive towards entities.

Didjacome commented 6 months ago

I understand. Therefore,Based on this, we can determine that the "ServiceBusExplorer" application did not delete the queue, as previously suggested.

This situation is quite peculiar because we have not activated the "Auto-Delete on Idle Queue" feature. Following your suggestion, I examined the queue properties and observed that the "Auto-Delete on Idle" property follows the ISO 8601 duration format.

From what I understand, this essentially indicates an infinite duration or that the deletion will never occur. After converting the duration, I found that it represents "10675199 days, 2 hours, 48 minutes, and 5.4475807 seconds" (which amounts to more than 29,000 years).

ErikMogensen commented 6 months ago

Strange!

Receiving messages makes the queue "non-idle" according to the list of what is considered idleness.

My guess is that, as Sean suggested, someone else deleted the queue. If you create a case with Microsoft they might be able to tell you more what happened.

Service Bus Explorer does not store its logs.

Didjacome commented 6 months ago

@SeanFeldman and @ErikMogensen Thank you all immensely for your help and support. Confirming with the community that the "Receive Dead-Letter Queue Messages" option in Service Bus Explorer indeed does not delete the queue without manual intervention has been incredibly helpful. I have already opened a ticket with Microsoft to inquire if they can offer further information about the incident or undertake a more thorough investigation into the Azure backend.