"Sandboxed code execution request failed." error when installing Pattern and Practices solutions

Aug 2, 2010 at 10:40 PM

Hi, I'm trying to install some of the Patternt & Practices for SharePoint 2010 code expamples and I always end with the same error "Microsoft.SharePoint.UserCode.SPUserCodeExecutionPipelineFailedException: Sandboxed code execution request failed." It seems like if it cannot activate the ExecutionModels.Sandboxed solution. Anyway, if I go to the site after I can activate it manually.

the sandboxed service is started, and I've run the script for enabling sandboxed solutions on domain controllers as well (http://www.kemalkaradag.com/post/2010/06/22/Enabling-SandBox-Solutions-on-Domain-Controller.aspx)


Any thoughts?




[[[Step4: Add Package(ExecutionModels.Sandboxed.wsp) to solution Gallary.]]]

[[[Adding Package from C:\Data\PP\Source\ExecutionModels\Sandboxed\ExecutionMode
ls.Sandboxed\bin\Debug\ExecutionModels.Sandboxed.wsp to http://SP2010:80/sites/M

[[[Step5: Activate :ExecutionModels.Sandboxed.wsp]]]

[[[Microsoft.SharePoint.UserCode.SPUserCodeExecutionPipelineFailedException: San
dboxed code execution request failed. ---> System.InvalidOperationException

Server stack trace:
  at Microsoft.SharePoint.Utilities.Verify.DoFailTag(UInt32 tag, ULSCat categor
y, Type type, String format, Object[] args)
  at Microsoft.SharePoint.Utilities.Verify.IsTrueTag(UInt32 tag, ULSCat categor
y, Boolean expression, Type type, String format, Object[] args)
  at Microsoft.SharePoint.UserCode.SPUserCodeExecutionHost.Execute(Type userCod
eWrapperType, Guid siteCollectionId, SPUserToken userToken, String affinity, SPU
serCodeExecutionContext executionContext)
  at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(
IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInCont
ext, Object[]& outArgs)
  at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMes
sage msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at [0]:
  at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg, IMessage retMsg)
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta, Int32 type)
  at Microsoft.SharePoint.Administration.ISPUserCodeExecutionHostProxy.Execute(
Type userCodeWrapperType, Guid siteCollectionId, SPUserToken userToken, String a
ffinityBucketName, SPUserCodeExecutionContext executionContext)
  at Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.Execute(Type user
CodeWrapperType, SPSite site, SPUserCodeExecutionContext executionContext)
  --- End of inner exception stack trace ---
  at Microsoft.SharePoint.UserCode.SPUserCodeExecutionManager.Execute(Type user
CodeWrapperType, SPSite site, SPUserCodeExecutionContext executionContext)
  at Microsoft.SharePoint.Administration.SPFeatureDefinition.<>c__DisplayClass1
  at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunEleva
ted secureCode)
  at Microsoft.SharePoint.Administration.SPFeatureDefinition.DoSPUserFeatureCal
lout(SPSite site, SPWeb web, SPFeatureCallOutOperation operation, String solutio
nHash, String solutionValidatorHash, String solutionValidationErrorUrl, String s
olutionValidationErrorMessage, String customActionName, IDictionary`2 parameters
  at Microsoft.SharePoint.Administration.SPFeatureDefinition.DoInstallationCall
out(SPSite site, String solutionHash, Boolean fInstall)
  at Microsoft.SharePoint.Administration.SPFeatureDefinition.Install(SPSite sit
e, String solutionHash)
  at Microsoft.SharePoint.Administration.SPFeatureDefinitionCollection.AddCore(
SPFeatureDefinition featdef, SPSite site, String solutionHash, Boolean fForce, B
oolean fDoValidation)
  at Microsoft.SharePoint.Administration.SPFeatureDefinitionCollection.AddInter
nal(String relativePathToFeatureManifest, Guid solutionId, String solutionHash,
SPSite site, Boolean force, Boolean fDoValidation, SPFeatureDefinitionContext fe
  at Microsoft.SharePoint.Administration.SPSolutionPackage.AddFeatureDefinition
s(SPFeatureDefinitionCollection featColl, SPFeatureDefinitionContext context, Bo
olean force, Boolean activateFeatures, SPSite site, SPWeb web)
  at Microsoft.SharePoint.Administration.SPUserCodeSolutionPackage.EnableSiteCo
llectionSolution(SPSite site, Int32 solutionGalleryItemId, Boolean force)
  at Microsoft.SharePoint.SPUserSolutionCollection.<>c__DisplayClass1.<AddOrUpg
  at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunEleva
ted secureCode)
  at Microsoft.SharePoint.SPUserSolutionCollection.AddOrUpgrade(SPListItem item
, SPUserSolution existingSolution)
  at Microsoft.SharePoint.SPUserSolutionCollection.Add(Int32 solutionGalleryIte
  at Microsoft.SharePoint.PowerShell.SPCmdletInstallUserSolution.CreateDataObje
  at Microsoft.SharePoint.PowerShell.SPNewCmdletBase`1.InternalProcessRecord()
  at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord()]]]
Aug 3, 2010 at 1:02 AM
Hi, We did not test a configuration with SharePoint on a domain controller, and this is not a typical configuration. That is likely the issue as you found out. We tested the guidance for Windows 7, Windows Server 2003, Windows Server 2008, Windows Server 2008 R2 standalone farm configurations. We also tested in a farm with mutiple WFE, domain controller, and database server for Windows Server 2008 R2. Thanks, Chris
Aug 3, 2010 at 9:25 AM

Thank you Chris. Anyway, i'd appreciate your help if any of you have any suggestions.

Aug 3, 2010 at 3:37 PM


This is hard to do without an environment to repro and I don't have time to setup this configuration, but I'm happy to try and help as best i can with that said.  Looking at the stack trace it looks like something is fundamentally broken with sandbox in this setup.  Have you tried simply creating a sandbox solution, add a web part, and then deploy it to see if that would work?  Can you set up the DC on its own VM to avoid this issue?


Aug 3, 2010 at 6:40 PM

Thank you Chris, I'll try in another VM. Anyway, I agree, it seems to have something to do with the sandboxed solutions configuration when it tries to activate the ExecutionModels.Sandboxed.wsp solution, but the funny thing is that if I go to the site (http://SP2010:80/sites/Manufacturing) afterwards, I can see the solution and I can activate it manually. Also, I have other sandboxed solutions in the same site which are working fine. I'll let you know if I find anything else.

Jan 3, 2011 at 4:20 PM

I am getting this same exception when running setup on the Sandboxed execution model reference implementation and I'm not running on a DC. any insight into what the problem might be?

Mar 2, 2011 at 2:53 AM

Yes, I got the same problem, is it impossible to create feature receiver for a sandbox solution?


Mar 2, 2011 at 12:39 PM

There are many potential causes to this generic error.  Is the sandbox solution deployed, and can you activate it manually?  Are you running the setup script as administrator?

You can create a feature receiver for sandboxed solutions.

Apr 27, 2011 at 4:06 AM

If there are many reasons for this exception, then shouldn't the developer at Microsoft being doing everything necessary to surface an error with more valuable information than what's provided? A value somewhere or a real indication of what's happening would probably be sufficient. I can open up reflector and dig in but I don't think that should be the way people without source or insight should be expected to troubleshoot errors in sandboxed code. This is the very first thing that should have been a requirement with sandboxed solutions.

Jun 14, 2011 at 10:17 AM

Just to share my experience of this problem, I got the "Error occurred in deployment step 'Add Solution': Sandboxed code execution request failed" error and had to activate the solution manually from within the site collection "Solutions" gallery.

I didn't have time to find the root cause but will document it if I do.


Jun 4, 2012 at 8:08 PM
Edited Jun 4, 2012 at 8:09 PM

I have also the same problem (Windows Server 2008 R2).

Was the problem fixed?

The script is not able to execute exactly for the same reason such as above

I tried to activate the solution manually as the ExecutionModels.Sandbox solution had been added in the Manufacturing solutions gallery but it failed.

Do you have any idea of a solution to fix the problem?