What am I missing?

Sep 16, 2011 at 4:48 AM

I'm trying to get the SampleAsyncWebClient to work, but it fails.  I have MSMQ installed, but it fails to create the endpoint on both XP & W7.  Here is the error,

The queue does not exist or you do not have sufficient permissions to perform the operation.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Messaging.MessageQueueException: The queue does not exist or you do not have sufficient permissions to perform the operation.

Source Error:

Line 28:             //The endpoint itself is threadsafe.
Line 29:             var ep = MsmqEndpointConfiguration.CreateConfiguredEndpoint();
Line 30:             ep.Start();
Line 31: 
Line 32:             Endpoint = ep;


The var ep actually appears to get created, but it dies on Start().  What am I doing wrong?  Do I have to creat the Queue manually?

Coordinator
Sep 17, 2011 at 4:48 AM

Hey! Sorry about the delay. MSMQ is a little tricky when it comes to permissions, by default a queue is only accessible by the user that created it. Easiest fix is to just allow Everyone full access. Are you trying this local on one machine?

/Hakan

Sep 17, 2011 at 9:48 AM

Yes, it's on a local machine.

Where do you give permissions at, the root, or on each private queue?

Coordinator
Sep 19, 2011 at 2:39 AM

Each private queue (Under Server Manager or Manage on My Computer)

Sep 19, 2011 at 9:05 PM

I still get the error below.  Is there a service that should be running somewhere?

Also, I have other programs that access MSMQ, and they don't seem to need the permissions set.

Starting Endpoint
The queue does not exist or you do not have sufficient permissions to perform the operation.
   at System.Messaging.MessageQueue.MQCacheableInfo.get_WriteHandle()
   at System.Messaging.MessageQueue.StaleSafeSendMessage(MQPROPS properties, IntPtr transaction)
   at System.Messaging.MessageQueue.SendInternal(Object obj, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)
   at SimpleServiceBus.Endpoints.Msmq.Transport.MsmqTransport.Send(MessageEnvelope envelope, String[] destinations)
   at SimpleServiceBus.Bus.MessageBus.Send(Object message, String[] destinations) in C:\Users\samcov\Desktop\Debug\NServiceBus\SimpleServiceBus\SimpleServiceBus v0.6\SimpleServiceBus\Bus\MessageBus.cs:line 216
   at SimpleServiceBus.Endpoint.Management.EndpointManagementClientService.NotifyMonitorService(Object message) in C:\Users\samcov\Desktop\Debug\NServiceBus\SimpleServiceBus\SimpleServiceBus v0.6\SimpleServiceBus\Endpoint\Management\EndpointManagementClientService.cs:line 232
   at SimpleServiceBus.Endpoint.Management.EndpointManagementClientService.HandleEndpointOnline(Object sender, EndpointEventArgs args) in C:\Users\samcov\Desktop\Debug\NServiceBus\SimpleServiceBus\SimpleServiceBus v0.6\SimpleServiceBus\Endpoint\Management\EndpointManagementClientService.cs:line 220
   at SimpleServiceBus.Endpoint.MessagingEndpoint.OnEndpointOnline() in C:\Users\samcov\Desktop\Debug\NServiceBus\SimpleServiceBus\SimpleServiceBus v0.6\SimpleServiceBus\Endpoint\MessagingEndpoint.cs:line 161
   at SimpleServiceBus.Endpoint.MessagingEndpoint.StartService() in C:\Users\samcov\Desktop\Debug\NServiceBus\SimpleServiceBus\SimpleServiceBus v0.6\SimpleServiceBus\Endpoint\MessagingEndpoint.cs:line 89
   at SimpleServiceBus.Utilities.BackgroundServiceBase.Start() in C:\Users\samcov\Desktop\Debug\NServiceBus\SimpleServiceBus\SimpleServiceBus v0.6\SimpleServiceBus\Utilities\BackgroundServiceBase.cs:line 29
   at SampleManagedEndpoint.MainForm.StartEndpoint() in C:\Users\samcov\Desktop\Debug\NServiceBus\SimpleServiceBus\SimpleServiceBus v0.6\SampleManagedEndpoint\MainForm.cs:line 74
   at SampleManagedEndpoint.MainForm.btnStartStop_Click(Object sender, EventArgs e) in C:\Users\samcov\Desktop\Debug\NServiceBus\SimpleServiceBus\SimpleServiceBus v0.6\SampleManagedEndpoint\MainForm.cs:line 133

Sep 20, 2011 at 1:29 AM

What's really wierd to me is how the process that created the queue, somehow can't access the queue it just created!

Sep 20, 2011 at 2:02 AM

Additional information:  The programs that work with MSMQ that I've tested, create non-transactional queues.

I noticed that that SSB queues ARE transactional, and that appears to be causing the crash.

So now the question becomes, is there something I'm not setting for transactional queues?

Sep 20, 2011 at 2:53 AM

More Info:  I tested transactional queues, and there's no problem with access!

I'm almost 100% sure that permissions are not the problem, I think the problem is existence!  The message said,

The queue does not exist or you do not have sufficient permissions to perform the operation.

I suspect that there is a queue utilized in the sample that does not exist, either because I didn't run another app first, or it wasn't created at some point.

So for the SampleAsyncWebClient, what queues are required?

 

Coordinator
Sep 20, 2011 at 4:32 AM

It may be that the queues are created as transactional, but the code is configured for non-transactional, or vice versa. I think that gives the vague message (from MSMQ) that the queue doesn't exist. I haven't tried the samples in a long time, it is possible that they create the wrong type of queue.

Sep 21, 2011 at 9:43 PM

Let me see if I can make this easier.

Looking back at my first post, the code in global.asax is below.

            //The calls to EnsureQueue are just for the samples 
            MsmqHelper.EnsureQueue("ManagedWebClient");
            MsmqHelper.EnsureQueue("EndpointMonitorService");
            
            //Here is the code required to start your endpoint
            //and make it globally accessible to other web pages.
            //The endpoint itself is threadsafe.
            var ep = MsmqEndpointConfiguration.CreateConfiguredEndpoint();
            ep.Start();

Both of the queues ensured, are created.  There are no other queues created!

I'm guessing, but shouldn't another queue be created by MsmqEndpointConfiguration.CreateConfiguredEndpoint() ?

This is probably the simplest example, but it doesn't work.

Coordinator
Sep 21, 2011 at 11:31 PM

CreateConfiguredEndpoint doesn't actually create any queues, it's just the EnsureQueue call that does that. But it may be that it creates the wrong type of queue, that's the part I'm not sure if the samples are updated. There was a change at some point to use non-transactional queues as default instead of transaction, if memory serves me.