locked
"Access Denied" When trying to attach debug process onto CrmAsynchronous service for custom Activity Debug RRS feed

  • Question

  • Hello! I am trying to attach my Debugger to the CrmAsynchronous service so I can debug custom activities but everytime I try to do that I get an "Access Denied" error.  I've read elsewhere that this is the only way to debug custom activities since the w3wp service only runs the Plugins that extend the IPlugin base class. Any help would be awesome. Thanks!
    Tuesday, February 3, 2009 7:14 PM

Answers

  • I had exactly the same problem and exactly same scenario.

    Windows Server 2008
    IFD
    CRM 4.0 (Full Server)
    Asynchronous Service Running on user "Network Service"
    Visual Studio 2008 Installed on the Server
    I am using the Domain Admin account that is set as a Deployment Manager, and local admin

    Steps always done before attaching to Async process:
    Copied over the correct pdb file to the assembly folder of CRM. Register the plugin using the Plugin registration tool. Restart IIS, and asynchronous service. Make completely new workflow with the new custom activity.


    Scenario 1:
    Running Visual Studio 2008 from the server. When I try to go to debug, and then "attach to process" I get a "Access is Denied" message.

    Solution: I changed the crm async services to run under my account rather than network services account, just for the period while i am doing debugging. It gave me no error what so ever when i changed the LoggOn account.

    -Thanks
    • Proposed as answer by LearnQuick Thursday, June 4, 2009 4:58 PM
    • Marked as answer by Jamelle Tuesday, June 9, 2009 11:03 PM
    Thursday, June 4, 2009 4:58 PM
  • Hi, normally you get this error because you don't have permission to debug process running under different credentials. What surprises me a lot is that you are able of debugging the w3wp process for synchronous plug-ins and not the async service. Usuallly they are both running under the same credentials. Could you check if the CRM App Pool and the Async Service are running under the same security account?

    The other really weird thing is that a Local Admin/Domain Admin like your user should have full access to debug other users processes. This thing looks like it is related with secuirty permissions on your user accounts or something like that.

    Anyway, have a look to this KB article that discuss this error message and maybe you could try the second method provided there http://support.microsoft.com/kb/907290


    Hope it helps.
    Marco Amoedo - http://marcoamoedo.com
    • Proposed as answer by Ayaz.AhmadModerator Tuesday, June 9, 2009 12:36 AM
    • Marked as answer by Jamelle Tuesday, June 9, 2009 11:03 PM
    Friday, June 5, 2009 7:21 AM
    Moderator

All replies

  • Please ensure that you are a Deployment administrator.


    Open Deployment Manager using Crm install user (logon to the server as Crm Install User or right click deployment manager and select "run as" and enter Crm install user credentials)
    Add yourself as a Deployment Administrator and try again.
    • Proposed as answer by Maruf Tuesday, February 3, 2009 11:54 PM
    Tuesday, February 3, 2009 11:30 PM
  • Hi Jamelle,

    First I'm glad you're using the debugger, I think it's such a great tool!  I've gotten this error on several occasions.  You're right that you have to attach it to the CrmAsynchronous service for workflow activities and the w3wp.exe for plugins.

    When I was debugging it using VS debugger on the CRM server directly I had no problems.  When I was on my laptop trying to connect to anther machine, the only way it worked for me was to change my access rights on the server to system admin.  I had to make sure I was a system admin on that server.

    I'm not sure what the minimum security level is, but if you do that, it should do the trick.  Hope that helps, good luck!

    Wednesday, February 4, 2009 12:44 AM
  • You might want to try enabling remote debugging. Check out the following link and let me know if it resolves your problem - http://blogs.msdn.com/greggm/archive/2004/08/30/222935.aspx
    • Proposed as answer by Maruf Wednesday, February 4, 2009 4:20 AM
    Wednesday, February 4, 2009 4:19 AM
  • Hey guys! Thanks for your responses, and I wanted to try everything before posting again. I believe the debugger is completely integral for CRM development. Now here is my setup:

    Windows Server 2008
    IFD
    CRM 4.0 (Full Server)
    Asynchronous Service Running on user "Network Service"
    Visual Studio 2008 Installed on the Server
    I am using the Domain Admin account that is set as a Deployment Manager, and local admin

    Steps always done before attaching to Async process:
    Copied over the correct pdb file to the assembly folder of CRM. Register the plugin using the Plugin registration tool. Restart IIS, and asynchronous service. Make completely new workflow with the new custom activity.


    Scenario 1:
    Running Visual Studio 2008 from the server. When I try to go to debug, and then "attach to process" I get a "Access is Denied" message.

    Scenario 2:
    Started Remote Debugging on CRM server with Administrator allowed to debug using Windows Authentication. On Debug tried to connect to Remote Computer using domainname\administrator@CRMSERVER, get process list, then attempted to attach to Asynchronous service, and I get "Access is Denied".

    Scenario 3:
    Started Remote Debugging on CRM server with no authentication required and anyone can connect to debug. Am able to attach to the asyn process using domainname\administrator@CRMSERVER and seems successfully UNTIL....running workflow with copious amounts of breakpoints, and none of them are hit. Workflow then completes without hitting any breakpoint and returning to VS.


    So that's where I'm at right now guys =(

    Thursday, February 5, 2009 12:25 AM
  • Thanks for posting detailed information. We are close - You are able to attach to the process which is a good thing. Please try the steps below and let me know how it goes -
    1. Stop the Crm Async Service
    2. Unregister the custom workflow activity.
    3. iisreset /stop 
    4. Rebuild your code in Debug mode
    5. Copy the dll and pdb to appropriate locations (server/bin/assembly)
    6. iisreset /start
    7. Register the Workflow activity
    8. Start the Crm Async Service.
    9. Place breakpoints in your code.
    10. Attach to Async Service, Start WorkFlow execution.

    Send us the results. If it does not break for the first time, try detaching and reattaching and running the workflow again to confirm and let us know how it goes.
    Thursday, February 5, 2009 5:03 AM
  • Thank you for your response Maruf, but the result is the same. With remote debugging in Native mode only and allow any user to debug I can connect to the Crmasync service, but following your steps verbatim several times, the code runs through and DOES NOT break at all. This workflow debugging is very challenging. Debugging for plugins using the w3wp service works perfectly well it is only this asynchronous service that is problematic. I highly suspect that it is because I am running the my CRM services on my Network Service Account. I have attempted to reinstall using a new domain user account with the correct spns for IIS, and local permissions gives me an install error that it cannot access the IIS pool. So I reverted back to the Network Service account. So my plugins and activities still run, but I cannot get my break points to hit with remote debugging with native mode only and any user can debug. Any other normal way to try to debug still gives me the "Access is Denied" message.
    Thursday, February 5, 2009 6:21 PM
  • You could run your CrmAsyncService under an administrator account (domain) and add it to Privileged User Group in AD and see if it solves your problem.
    Thursday, February 5, 2009 11:03 PM
  • I tried running my Crmasyncservice under the domain admin account. I added it to the Privledged user Group for CRM, added it to the local CRM_WPG group, and added the associated SPNs. When I started the service and tried to register the custom activity I got a SOAP Error of Unauthorized Access. This is quite depressing. Are there any red flags to my CRM setup? I followed mainyl the Microsoft Documentation on  CRM setup when I first installed it.
    Saturday, February 7, 2009 1:50 AM
  • Assuming that your service account is a user in Crm.
    Sunday, February 8, 2009 12:40 AM
  • Yes the Domain Admin account is also a System Admin user in CRM as well.
    Sunday, February 8, 2009 1:12 AM
  • Are you using 32 Bit server 2008 or 64 bit server 2008. I have faced the same issue with 64 Bit server 2008 but 32 Bit works fine for me.

    Since very tight schedule, i was unable to explore issue with 64 Bit. But i assume this is because we need to refer assemblies for CRMsdk for 64 bit version!

    This may help!

    Ayaz Ahmad Technical Consultant Microsoft CRM/MOSS http://ayazahmad.wordpress.com
    Monday, February 9, 2009 1:02 AM
    Moderator
  • I am running windows 2008 64-bit. I will have to try to reference the 64-bit dlls on my project. I will report back on my progress.
    Monday, February 9, 2009 5:51 PM
  • Ok I tried the 64-bit libraries and I got the same access denied when I tried to attach to the Async process. Really I'm not quite sure what help that actually was, since it is the debugger that is trying to attach to the service.  Looks like Visual Studio 2008, Windows 2008 64-bit custom activity debugging is something that cannot be achieved.
    Thursday, February 12, 2009 12:01 AM
  • I had exactly the same problem and exactly same scenario.

    Windows Server 2008
    IFD
    CRM 4.0 (Full Server)
    Asynchronous Service Running on user "Network Service"
    Visual Studio 2008 Installed on the Server
    I am using the Domain Admin account that is set as a Deployment Manager, and local admin

    Steps always done before attaching to Async process:
    Copied over the correct pdb file to the assembly folder of CRM. Register the plugin using the Plugin registration tool. Restart IIS, and asynchronous service. Make completely new workflow with the new custom activity.


    Scenario 1:
    Running Visual Studio 2008 from the server. When I try to go to debug, and then "attach to process" I get a "Access is Denied" message.

    Solution: I changed the crm async services to run under my account rather than network services account, just for the period while i am doing debugging. It gave me no error what so ever when i changed the LoggOn account.

    -Thanks
    • Proposed as answer by LearnQuick Thursday, June 4, 2009 4:58 PM
    • Marked as answer by Jamelle Tuesday, June 9, 2009 11:03 PM
    Thursday, June 4, 2009 4:58 PM
  • Hi, normally you get this error because you don't have permission to debug process running under different credentials. What surprises me a lot is that you are able of debugging the w3wp process for synchronous plug-ins and not the async service. Usuallly they are both running under the same credentials. Could you check if the CRM App Pool and the Async Service are running under the same security account?

    The other really weird thing is that a Local Admin/Domain Admin like your user should have full access to debug other users processes. This thing looks like it is related with secuirty permissions on your user accounts or something like that.

    Anyway, have a look to this KB article that discuss this error message and maybe you could try the second method provided there http://support.microsoft.com/kb/907290


    Hope it helps.
    Marco Amoedo - http://marcoamoedo.com
    • Proposed as answer by Ayaz.AhmadModerator Tuesday, June 9, 2009 12:36 AM
    • Marked as answer by Jamelle Tuesday, June 9, 2009 11:03 PM
    Friday, June 5, 2009 7:21 AM
    Moderator
  • I get the same error and the solution was easy, lets look what i did :

    1: i need to remote debug CrmAsyncService.exe, rihgt ?

    2:create the same user in the Two machines: in the machine where CRM is installed and in the machine where VS is installed

    3:connect in the 2 machine with the users already created

    4:run Visual studio remote debuging in the machine where CRM is installed

    5: now , we will start the service CrmAsyncService under the user already created in step 2, so go to execute\cmd and type services.msc,

       serach the service "Service de traitement Asynchrone pour CRM",click the right button and go to the "connetion" tab and enter the username and password created in step 2, and then click ok

    6: start the service, the service will not be started beacause it need to connect to the database of the CRM(MSCRM_CONFIG)-->to resolve the problem go to sql serlver and add the user creatde in the step 2 to the datbase MSCRM_CONFIG, restart the service and now it will be started

    7: go to machiene where VS is installed and try to attach your code to the prosess CrmAsyncService and it will be attached

    Try this steps and if somenoe has a comment i'm ready for answer

    tchaw

    Friday, April 23, 2010 5:30 PM