The plug-in execution failed because no Sandbox Worker processes are currently available RRS feed

  • Question

  • Mainly, but not exclusively, when importing data into CRM 2011 online we often get this error "The plug-in execution failed because no Sandbox Worker processes are currently available" in our async plugins (the error can be viewed under system jobs).

    Obviously this means that we are running too many sandbox dependant plugins at once so there are no processes available which seems reasonable and the error is well explained by the message. However the way this error is handled by the system seems wrong to me.

    What happens is that the system job goes into a retry loop with ever increasing delays between retries. After a set number of retries (I think it's 10) it gives up. The retries get quite long and it can be several hours before the last retry (I don't know the exact numbers).

    What I don't understand is that in the case of the above error every retry appears to fail and eventually the system job goes into the suspended state with a "postpone until" date of 30/12/9999 23:59. This suggests that even after all the retries the system job failed to find a free Sandbox Worker process - which seems unlikely.

    Worse still, going back to one of these system jobs and resuming it, even after several days continues to fail with the same error, and I know for a fact Sandbox Worker Processes are available as other plugins are executing fine at the same time.

    Has anyone else come across this? It seems like a bug in the retry processing for this particular error. I don't know if it is somehow stuck looking for a particular process which is now long gone or what...

    Any help/thoughts appreciated!


    Thursday, July 25, 2013 12:45 PM

All replies

  • your plugins deal with note entity and big attachments?

    My blog: www.crmanswers.net

    Thursday, July 25, 2013 1:25 PM
  • Hi Guido,

    There's actually more than one plug-in that fails in this way. One does get triggered on activity mime attachment but another that fails is just triggered on email creation and does some fairly simple processing.

    It's not so much the failure I'm concerned about, because it tends to happen when bulk creating records, so the system will be busy. What concerns me is the fact that the retries fail, even hours later and I can't resubmit it even after several days without the same failure. It seems like it is cannot find a free Sandbox Worker Processes even when I know there are some.


    Thursday, July 25, 2013 1:52 PM
  • I asked because I have a similar problem in a CRM online environment, if a plugin is attached in some entities (for example annotation) and an attachment bigger than 5MB is created, I get the same error.

    My blog: www.crmanswers.net

    Thursday, July 25, 2013 2:00 PM
  • Thanks again Guido,

    That's interesting, as I say one of the plugins is on activity mime attachments, so it may be something similar. I'll check out the size of the attachments, and also try and see if any larger ones have made it into the system.

    In previous runs of my "import" (I am "importing" via a c# program) I have seen the more friendly "attachment too large" message when I had forgotten to raise the attachment size limit. Interestingly the attachments have actually been added successfully, it's just the plugin that's failing, but I can believe there's some odd circumstance here.

    I'll let you know what I find, if anything.


    Thursday, July 25, 2013 2:48 PM
  • OK, I've just had a look and while some attachments are 5MB and over there's at least one which is 3.5MB. I tried resuming that job and it still failed with the same thing.

    Additionally I had already raised the attachment limit to 16MB before running the import so I don't think it's a size issue in my case.

    Thursday, July 25, 2013 2:58 PM
  • ... some time later ...

    I think I have established that this is related to attachment size. The "no Sandbox Worker processes are currently available" message is a red herring. Looking at the inner exception there is a System.IO.PipeException which is clearly the main problem.

    So the circumstances to recreate are:

    1. Have a plugin execute on Create of Activity Mime Attachment, or in the some other reported cases Email.
    2. From Outlook track an email with a large attachment

    There are other reports of the same issue here: https://community.dynamics.com/crm/f/117/t/112068.aspx and here http://social.msdn.microsoft.com/Forums/es-ES/84df6fad-013d-4dd4-843c-95b863ccd631/attachment-upload-issues-in-crm-2011?forum=crm

    I have raised the issue with support so will report back if I get anywhere...

    Friday, March 28, 2014 10:59 AM
  • Hy John, did you get any news on that problem. We are facing the same issue?

    Regards, Thomas

    Monday, July 7, 2014 1:39 PM
  • Hi Thomas, I'm still pursuing it with Microsoft, they keep telling me it's fixed and asking me to re-test, but no joy yet.

    I've recreated it with a plug-in that does nothing so the problem appears to be something unrelated to user code. I think, at least in my case, it's something to do with the post operation image having the body field (my plug-in is registered on activitymimeattachment and the body field is the binary attachment) and the size of the attachment.

    I've sent them the code but I don't think they've bothered recreating it themselves yet, which is frustrating, but I'm sticking with it :)

    Monday, July 7, 2014 10:08 PM
  • Hy John,

    thank you very much for your anwser. We are facing the same issue on a similar problem. If i create a note on a contact and try to add an attachement > 5MB i get the same error: System.IO.PipeException.On some of my CRM Systems i can upload files that are a bit bigger than 10MB and on others everything over 5 MB will fail. I made the system settings for 32 MB on alle these systems. Ill do some research and check if IIS could have different settings here as well. Please let me know if you have any news on that problem.

    Regards, Thomas

    Tuesday, July 8, 2014 9:02 AM
  • Hi Thomas,

    MSFT came back to me again last week and asked be to re-test (yet) again, which I've just done. Unfortunately the problem is not fixed. I've told the support guy that I don't want to be involved any more having sent them information (twice) to enable them to recreate the issue and having re-tested supposed bug fixes about a dozen times.

    It would be helpful if you could also raise a support request, even if you don't pursue it for long, as multiple reports may make a resolution more likely.



    Wednesday, July 23, 2014 12:47 PM
  • Just to let you know that MSFT have given up on this and have closed the case today.

    I've lost the will to pursue it, so if anyone else has the same problem I can only suggest you raise a support case, even if you don't follow it for too long, at least the same issue will appear multiple times in their bug database and they may end up fixing it...

    Friday, October 17, 2014 10:14 AM
  • Is it perhaps due to IIS?  Have you already tried upping the max file size in the web.config:

    <httpRuntime maxRequestLength="1500000" />

    Friday, October 17, 2014 8:01 PM
  • hi, check this link: https://ashwaniashwin.wordpress.com/2014/03/13/crm-2011-error-the-plug-in-execution-failed-because-no-sandbox-hosts-are-currently-available/
    Tuesday, December 15, 2015 2:53 PM
  • Thanks all, it could well be related to IIS or the web.config but this is CRM Online (i.e. MSFT hosted) so I don't have access to either. The use of a plugin definitely has some bearing on the problem though.

    Tuesday, December 15, 2015 4:10 PM
  • Can you post the code? I think plugin is taking too much time.. You should check your code.

    Make sure that plugin should exit and should not have depth issue. Make sure plugin should not take much time.


    Wednesday, December 16, 2015 7:47 PM
  • I was able to  recreate the issue with the very minimal plug-in code below. The steps I tried to recreate in a fresh system:

    1. Set up new CRM on-line instance.
    2. Go to Settings/Administration/System Settings and change the email settings as follows: Set Process Email Using to Server Side Synchronization, uncheck Use Correlation and change Maximum File Size (in KB) to 20,480.
    3. Register the plug-in for Create of ActivityMimeAttachment as post-operation, asynchronous execution, server deployment.
    4. Add a post image to plugin registration and include activitymimeattachmentid, body, filename, filesize and objectid in the parameters.
    5. Use the Outlook add-in to track and email with a relatively large attachment - the one I used was about 7MB.
    6. Check the plug-in execution.
    As previously mentioned I did raise a support issue with MSFT but they weren't much help, they just kept "fixing" things and telling me to try again - I don't think they bothered to recreate it themselves. From a personal perspective we are moving away from CRM so it's no longer a big issue for us, but I thought I'd post in case it helps someone else. For all I know it may be fixed now anyway...

    using System;
    using Microsoft.Xrm.Sdk;
    namespace TestAttachmentPlugin
        public class TestPlugin : IPlugin
            private IPluginExecutionContext _context;
            private IOrganizationService _organizationService;
            private ITracingService _trace;
            public void Execute(IServiceProvider serviceProvider)
                    _trace = (ITracingService) serviceProvider.GetService(typeof (ITracingService));
                    // Get the IPlugin Context
                    _context = (IPluginExecutionContext) serviceProvider.GetService(typeof (IPluginExecutionContext));
                    // Get the organization service
                    IOrganizationServiceFactory serviceFactory =
                        (IOrganizationServiceFactory) serviceProvider.GetService(typeof (IOrganizationServiceFactory));
                    _organizationService = serviceFactory.CreateOrganizationService(_context.UserId);
                    switch (_context.Stage)
                        case 40:
                            throw new InvalidPluginExecutionException(
                                "ActivityMimeAttachment Plugin Registered against an invalid step");
                catch (InvalidPluginExecutionException ipe)
                catch (Exception ex)
                    throw new InvalidPluginExecutionException(
                        String.Format("Exception occured during the ActivityMimeAttachment plugin Execution.\n{0}",
            private void RunPost()
                _trace.Trace("This plugin doesn't do anything!");

    Thursday, December 17, 2015 4:16 PM
  • Hello,

    I have same situation in CRM 2011 On Premise:

    1. Increased Attachment size to 20Mb in System Settings.

    2. Have registered empty plugin on PostNoteCreate step.

    If I disable plugin step, error does not show up.

    Looking forward for any guide in solving this problem.

    Friday, January 8, 2016 2:36 PM
  • Hi Jonas,

    Sorry I can't be of any help as I've given up, hopefully someone else can help you. Just in case you or anyone else decides to raise a support request, feel free to refer to mine. The number was: [REG:114032790192724].

    Good luck!


    Friday, January 8, 2016 2:48 PM
  • I tried with no luck two of these:

    1. Changed maxRequestLength in web.config of IIS.

    2. Changed ImportMaxAllowedFileSizeInMB in MSCRM_CONFIG database.

    Friday, January 8, 2016 2:55 PM
  • I managed to "partly" fix this error:

    Plugin on the Note entity should be registered not in the Sandbox.

    This mean, that error could be bypassed only in On-Premise.

    Good luck to you LJ!

    Friday, January 8, 2016 3:13 PM