Service bus troubleshooting
Delete MSMQ queues
Dime.Scheduler no longer accepts MSMQ as the transportation and persistence channel. The default is now SQL.
When you encounter problems with MSMQ, chances are they are related to authorization. Here are some tips which may help you. Please make sure you're logged on as an administrator and run programs such as PowerShell as administrator.
Set MSMQ permissions
In order to prevent subtle issues, we suggest opening the queues to 'Everyone' and 'Anonymous'. You can do this by executing the following steps:
- Navigate to Computer Management (or run
compmgmt.msc
from the command-line) - Expand the 'Services and Applications' node
- Expand the 'Message Queuing' node
- Open the Private Queues folder
- Right click on a Dime.Scheduler queue and select properties
- In this window, select the Security tab
- Check if 'Everyone' and 'Anonymous' are allowed 'Full Control'
Do this for every Dime.Scheduler queue.
Alternatively, you can run the following PowerShell script:
Get-MsmqQueue -Name "dime.scheduler.backoffice" -QueueType Private | Set-MsmqQueueAcl -UserName "Everyone" -Allow FullControl
Get-MsmqQueue -Name "dime.scheduler.backoffice.error" -QueueType Private | Set-MsmqQueueAcl -UserName "Everyone" -Allow FullControl
Get-MsmqQueue -Name "dime.scheduler.backoffice.retries" -QueueType Private | Set-MsmqQueueAcl -UserName "Everyone" -Allow FullControl
Get-MsmqQueue -Name "dime.scheduler.publisher" -QueueType Private | Set-MsmqQueueAcl -UserName "Everyone" -Allow FullControl
Get-MsmqQueue -Name "dime.scheduler.publisher.error" -QueueType Private | Set-MsmqQueueAcl -UserName "Everyone" -Allow FullControl
Get-MsmqQueue -Name "dime.scheduler.publisher.subscriptions" -QueueType Private | Set-MsmqQueueAcl -UserName "Everyone" -Allow FullControl
Get-MsmqQueue -Name "dime.scheduler.web" -QueueType Private | Set-MsmqQueueAcl -UserName "Everyone" -Allow FullControl
Get-MsmqQueue -Name "dime.scheduler.web.error" -QueueType Private | Set-MsmqQueueAcl -UserName "Everyone" -Allow FullControl
Get-MsmqQueue -Name "dime.scheduler.web.retries" -QueueType Private | Set-MsmqQueueAcl -UserName "Everyone" -Allow FullControl
Take ownership
If you get an access denied error, you may want to grant yourself ownership rights to the queue first:
- Browse to your private queues in the management console.
- Under "Services and Applications" find "Message Queuing" and then "Private Queues".
- Right click on the target queue for its properties, you’ll see the security tab in the properties window.
- Here you can assign permissions to the user/group that your application runs on.
If you do not have the permission to modify the security settings of this queue, this queue was probably not created by you. The first thing you need to do is to take over the ownership:
- Click the Advanced button.
- Go to the Owner tab.
- Select or find your user/group, then click OK.
- This requires that you have permission to take ownership from another user, and it usually means that you need to be an administrative user first.
Once you have taken the ownership, you can modify the security settings for this queue without problems.
Delete queue
Just like the previous section, there are two ways to remove a queue. The first one is via the graphical user interface.
- Navigate to Computer Management (or run
compmgmt.msc
from the command-line) - Expand the 'Services and Applications' node
- Expand the 'Message Queuing' node
- Open the Private Queues folder
- Select the queue and hit the delete keyboard key
In PowerShell, this is the command to run:
Get-MsmqQueue -Name "MYQUEUENAME" -QueueType Public | Remove-MsmqQueue
You may want to take ownership if you still get authorization errors. See here for the steps.
If this hasn't work either, you may want to try the following obscure solution:
- Stop the MSMQ Service
- Open the folder C:\WINDOWS\system32\msmq\storage\lqs
- Find the file in this folder that describes your queue
- Using a plain old text editor such as Notepad, open the lqs file for some other private queue that has good security permissions. If you don't have any other private queues,create a temporary one.
- Locate the line in the file that begins Security=....
- Copy the entire line to your clipboard. Watch out for Word Wrap, this line will be quite long.
- Open the lqs file for your problem queue in your text editor
- Overwrite the Security=... line in this file with the contents of your clipboard
- Save the modified lqs file
- Start the MSMQ service
And if that didn't work, you may want to turn the server off and on again, and try again to remove the queue. When nothing works, submit a ticket on Dime's support portal.