Difference between revisions of "Shooting MSMQ troubles"

From Catglobe Wiki
Jump to: navigation, search
(Created page with '== Permission == - One Cattask needs 5 queues in total to work properly: *cattask_queue (main queue) *cattask_queue#discarded (discarded messages come here) *cattask_queue…')
 
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Permission ==
+
<accesscontrol>Main:MyGroup</accesscontrol>
 +
[[Category:Miscellaneous]]
  
- One Cattask needs 5 queues in total to work properly:
+
== Permission  ==
  
*cattask_queue (main queue)
+
- One Cattask needs 5 queues in total to work properly:
*cattask_queue#discarded (discarded messages&nbsp;come here)
+
 
*cattask_queue#errors (error messages&nbsp;come here)
+
*cattask_queue (main queue)  
*cattask_queue#subscriptions (subscriptions messages come here)
+
*cattask_queue#discarded (discarded messages&nbsp;come here)  
 +
*cattask_queue#errors (error messages&nbsp;come here)  
 +
*cattask_queue#subscriptions (subscriptions messages come here)  
 
*cattask_queue#timeout (timeout messages come here)
 
*cattask_queue#timeout (timeout messages come here)
 +
 +
'''TODO''': explain those queues in more details.
 +
 +
Those queues, if not exists, are created by the bus itself. The point is that in order to access the queues, Rhino Service Bus needs to&nbsp;have enough permission to the queues. So, what specifies the access rights which RSB has to the queues? A bus creates some threads to process messages, and those threads don't use impersonation at all.&nbsp;In other words, it uses the default '''Identity '''of the hosting process; for example ASPNET&nbsp;in Windows XP or NETWORK SERVICE in Windows Server 2003. By default, RSB just grants full access for the Administrator group. To overcome this security issue, right now, I change RSB code to grant access for the Everyone user. Although granting for Everyone is not a good idea, it is working now.
 +
 +
'''TODO''': Change code so that appropriate access is automatically granted to those queues for relevant users.
 +
 +
== MSMQ  ==
 +
 +
Error:
 +
 +
The transaction has aborted.
 +
 +
Communication with the underlying transaction manager has failed.<br>Solution: Check if MSDTC (Distributed Transaction Coordinator)&nbsp;is running. If not, start it.
 +
 +
== Register WCF ==
 +
 +
*Open command prompt
 +
*Go to: C:\WINDOWS\Microsoft.NET\Framework64\v3.0\Windows Communication Foundation\
 +
*Run: ServiceModelReg.exe /i /x
 +
 +
== Security ==
 +
 +
=== Access to the registry key 'Global' is denied.  ===
 +
 +
'''Error message:''' Access to the registry key 'Global' is denied
 +
 +
'''Remark:''' When&nbsp;CatTask runs, it needs&nbsp;access to the&nbsp;registry to get information about&nbsp;processors of the server.&nbsp;This error happens because the user account which your web application uses to run (it is the user which is specified in impersonation section in webconfig) doesn't have that permission.
 +
 +
'''Solution:''' Open Computer Management console&nbsp;(right click on My Computer -&gt;&nbsp;Manage) -&gt;&nbsp;Local Users and Groups -&gt; Groups -&gt; Add impersonated account to the group
 +
 +
=== Category does not exist ===
 +
 +
'''Error message:''' Category does not exist
 +
 +
'''Remark:''' After you fix the "Access to the registry key 'Global' is denied' error, you might run into this problem. It is because .NET makes some kind of caching when it failed to access the key formerly.
 +
 +
'''Solution:''' Stop (end process :D) w3wp service, then re-run web site.

Latest revision as of 03:18, 18 October 2013

<accesscontrol>Main:MyGroup</accesscontrol>

Permission

- One Cattask needs 5 queues in total to work properly:

  • cattask_queue (main queue)
  • cattask_queue#discarded (discarded messages come here)
  • cattask_queue#errors (error messages come here)
  • cattask_queue#subscriptions (subscriptions messages come here)
  • cattask_queue#timeout (timeout messages come here)

TODO: explain those queues in more details.

Those queues, if not exists, are created by the bus itself. The point is that in order to access the queues, Rhino Service Bus needs to have enough permission to the queues. So, what specifies the access rights which RSB has to the queues? A bus creates some threads to process messages, and those threads don't use impersonation at all. In other words, it uses the default Identity of the hosting process; for example ASPNET in Windows XP or NETWORK SERVICE in Windows Server 2003. By default, RSB just grants full access for the Administrator group. To overcome this security issue, right now, I change RSB code to grant access for the Everyone user. Although granting for Everyone is not a good idea, it is working now.

TODO: Change code so that appropriate access is automatically granted to those queues for relevant users.

MSMQ

Error:

The transaction has aborted.

Communication with the underlying transaction manager has failed.
Solution: Check if MSDTC (Distributed Transaction Coordinator) is running. If not, start it.

Register WCF

  • Open command prompt
  • Go to: C:\WINDOWS\Microsoft.NET\Framework64\v3.0\Windows Communication Foundation\
  • Run: ServiceModelReg.exe /i /x

Security

Access to the registry key 'Global' is denied.

Error message: Access to the registry key 'Global' is denied

Remark: When CatTask runs, it needs access to the registry to get information about processors of the server. This error happens because the user account which your web application uses to run (it is the user which is specified in impersonation section in webconfig) doesn't have that permission.

Solution: Open Computer Management console (right click on My Computer -> Manage) -> Local Users and Groups -> Groups -> Add impersonated account to the group

Category does not exist

Error message: Category does not exist

Remark: After you fix the "Access to the registry key 'Global' is denied' error, you might run into this problem. It is because .NET makes some kind of caching when it failed to access the key formerly.

Solution: Stop (end process :D) w3wp service, then re-run web site.