BizTalk - Inner exception: Requested registry access is not allowed.

Asked By Scott Farestrand
21-Jul-09 10:18 AM

I am trying to enhance error handling in a biztalk orchestration. When a update fails, I will email user indicating the failure. I added a reference to MSCORLIB.DLL and added a construct message (see below)

The orchestration I added this to is a Status_Update Orchestration. I deployed the app on our QA server and got the message noted below in my Job_Create orchestration.

I Deleted the app and installed an older version of the MSI and bindings and continue to get the error.

Any help will be appreciated.

Error message

Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'NWNatural.BizTalk.EAM.SAP_PCAD_JobCreate_Orchestration(d945bef6-daf3-f2e8-845f-e3e0155e6ce1)'.

The service instance will remain suspended until administratively resumed or terminated.

If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.

InstanceId: d3d6e295-50c9-4c35-a583-57e3dd68807e

Shape name: ConstructMsgException

ShapeId: 1bccf487-7968-443e-ae6f-911e103a44ce

Exception thrown from: segment 3, progress 3

Inner exception: Requested registry access is not allowed.

Exception type: SecurityException

Source: mscorlib

Target Site: Void ThrowSecurityException(System.ExceptionResource)

The following is a stack trace that identifies the location where the exception occured

   at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource)

   at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)

   at System.Di

Construct message :

msgBody = new System.Text.StringBuilder();m

msgBody.AppendLine("<html><body>");

msgBody.AppendLine("<html><body><table border=\"0\" cellpadding=\"2\" cellspacing=\"0\">");

msgBody.AppendLine("<tr><td colspan=\"2\"><font face=\"Verdana\" size=\"2\"><b>ERROR DETAILS</b></font></td></tr>");

msgBody.AppendLine("<tr>");

msgBody.AppendLine("<td width=\"145\"><font face=\"Verdana\" size=\"2\">Error Type:</font></td>");

msgBody.AppendLine("<td><font face=\"Verdana\" size=\"2\">" + "Order Locked " + "</font></td>");

msgBody.AppendLine("</tr><tr>");

msgBody.AppendLine("<td colspan=\"2\"><font face=\"Verdana\" size=\"2\">The attached document failed on processing in BizTalk Server</font></td>");

msgBody.AppendLine("</tr></table></body></html>");

Msg_Email.EmailBody = new NWNatural.BizTalk.XlangCustomFormatters.RawString(msgBody.ToString());

Msg_Email.EmailBody(Microsoft.XLANGs.BaseTypes.ContentType) = "text/html";

Msg_Email.OriginalMessage = null;

Msg_Email(SMTP.Subject) = "SAP Order Locked " + "ORDER # HERE";

Msg_Email(SMTP.From) = "SLF@NWNatural.com";

Msg_Email(SMTP.EmailBodyFileCharset) = "UTF-8";

Msg_Email(SMTP.MessagePartsAttachments) = 2;

Elevate the permissions of the logon user.  Elevate the permissions of the logon user.

21-Jul-09 10:38 AM
It looks like you are currently running the BizTalk services under a non-admin account or with an account that does not write permissions. 

And the stacktrace that you have posted seems to originate from System.Diagnostics.  The first thing that i can think of when i see System.Diagnostics is the 'EventLog'. So your code should be breaking at a statement that uses EventLog's WriteEntry method. 

For e.g. System.Diagnostics.EventLog.WriteEntry("started");

To fix this, elevate the access of the current user. 
I presume that this is done through the following registry change. (Please backup registry before you attempt this)

1. Open Registry (Run menu - Regedit)
2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog
3. Right click on the EventLog folder and choose 'Permissions'. 
4. In the Security tab, Click the 'Add' button and add the user and give him Special Permissions/ Full Control.

It should be good now.

Thank you  Thank you

21-Jul-09 10:42 AM
I will give it a try

privileges  privileges

21-Jul-09 10:56 AM

My admin tells me:

A little more detail.  The SAP host instance is running under this group:

 NNG\BTS ProcessHostUsers 2K6 QA

 This group has admin privileges to that registry key.

Create New Account
help
Security Error on WCF Service I published my Biztalk WCF Service on a Server 2003 Machine. When I try to browse the .svc file I get the following [SecurityException: Request for the permission of type 'System.Net.DnsPermission, System, Version = 2.0.0.0
bts2006 error handling Windows Server I think I've misunderstood something fundamental about error handling in BizTalk 2006. We have an orchestration that calls a Web service. If an exception arises in ex.Message; What actually appears in the Event Log is: Event Type: Warning Event Source: BizTalk Server 2006 Event Category: BizTalk Server 2006 Event ID: 5743 Date: 18 / 06 / 2007 Time: 09:20:37 User: N catch blocks for everything. However, it seems that the exception is never being caught and BizTalk is just suspending the message. Can anyone explain to me in the sort of language it; but I have to catch them somewhere and deal with them. Many thanks Peter BizTalk Discussions BizTalk Server 2006 (1) BizTalk (1) EventSourceCreationData (1) EventLogEntryType (1) SoapExceptionMessage (1) SoapExceptionMsg (1) XmlQualifiedName (1
working on remote site I have the config below in my web.config <customErrors defaultRedirect = "error / error.aspx" mode = "On"> <error statusCode = "500" redirect = "error / error.aspx" / > <error statusCode = "404" redirect = "error / error.aspx" / > < / customErrors> I have changed the mode to RemoteOnly with no success Initially i didn
complete, as it keeps stopping. The only clue in the event log is a 5014 error - The DFS Replication service is stopping communication with partner <server> due to an error. The error in question is 1722 (The RPC Server is unavailable). If I restart the DFS service 4CA5-93D3-9923AC11D640} csName:Production updateType:remote 20081001 08:32:57.251 2748 DOWN 5186 [ERROR] DownstreamTransport::RdcGet Failed on connId:{F33E154B-B106-4CA5-93D3-9923AC11D640} csId:{81BF2885-1DE4-4F26-8E2B 00000000-00000000-00000000 + similarity 00000000-00000000-00000000-00000000 + name {066AED9B-313E-4D28-A0C6-4A144863E7C5}-v1075 + Error: + [Error:9027(0x2343) RpcFinalizeContext downstreamtransport.cpp:1096 2748 C A failure was reported by the remote partner] + [Error:9027(0x2343) DownstreamTransport::RdcGet downstreamtransport.cpp:5124 2748 C A failure was reported by the remote partner] + [Error:170(0xaa) DownstreamTransport::RdcGet downstreamtransport.cpp:5124 2748 W The requested resource is in use