Friday, 23 August 2013

Install-SPUserSolution : Sandboxed code execution request failed.

Install-SPUserSolution : Sandboxed code execution request failed.

This is a really tricky error I had when trying to deploy a Sand-boxed Solution using PowerShell on a new farm.  The error “Install-SPUserSolution : Sandboxed code execution request failed.”  happened with PowerShell, and with the GUI.
I looked in the ULS log and found this:
Sandboxed code execution request failed. – Inner Exception: System.InvalidOperationException    Server stack trace:      at Microsoft.SharePoint.Utilities.Verify.DoFailTag(UInt32 tag, ULSCat category, Type type, String format, Object[] args)     at Microsoft.SharePoint.Utilities.Verify.IsTrueTag(UInt32 tag, ULSCat category, Boolean expression, Type type, String format, Object[] args)     at Microsoft.SharePoint.UserCode.SPUserCodeExecutionHost.Execute(Type userCodeWrapperType, Guid siteCollectionId, SPUserToken userToken, String affinity, SPUserCodeExecutionContext executionContext)     at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)     at System.Runti… 28b119be-321a-42d6-892a-b7ddcf358e74

With no results on Google on how to fix this issues I tried a lot of things without ever being able to replicate it on another machine.
What I found is that there was another related error  :  (You can also check fix for this specific error here)
Unable to load assembly group. The user assembly group provider threw an exception while trying to provide user assemblies for the specified assembly group.

The Fix:

I added the Service Account running the Sandbox Service with Full Control rights on the Web Application (User Policy) and it worked. 

I deleted the Web Application and re-ran the script (without re-adding the Full Control rights) and it worked no problem.  

Say thanks if this helped :)

No comments:

Post a Comment