Had a very stange problem yesterday.
Symptom :
After deploying a full farm solution (not Sandboxed) to SharePoint some pages (such as “Farm Solutions”) stop working. After tracking the error down it appears to be related to a .Net compilation issue. This WSP has been deployed in over a 1000 different Farms and this error has never shown up so I am very confident its not the .Net code contained within it.
What is even stranger is that when the “SP User Code” Windows Service is restarted the errors disappear and the code is JIT’d correctly. Any ideas?
Here’s the stack trace :
11/17/2014 08:56:55.56 SPUCHostService.exe (0x079C) 0x0838 SharePoint Foundation Sandboxed Code Service fe88 Medium – – Error starting worker process. – Inner Exception: System.InvalidOperationException: No process is associated with this object. at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value) at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.CreateWindowsProcess(String processExeName)
11/17/2014 08:56:55.56 SPUCHostService.exe (0x079C) 0x0838 SharePoint Foundation Sandboxed Code Service ei0t Medium – Process creation/initialization threw an exception. Stopping this process. “ipc://c817eb03-9cc7-4613-bdbb-c664c197b2f6:7000”
11/17/2014 08:56:55.56 SPUCHostService.exe (0x079C) 0x0838 SharePoint Foundation Sandboxed Code Service fe87 Medium – – Error starting worker process. – Starting worker process threw – Inner Exception: System.InvalidOperationException: No process is associated with this object. at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value) at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.CreateWindowsProcess(String processExeName)
11/17/2014 08:57:05.56 SPUCHostService.exe (0x079C) 0x0838 SharePoint Foundation Sandboxed Code Service fe88 Medium – – Error starting worker process. – Inner Exception: System.InvalidOperationException: No process is associated with this object. at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value) at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.CreateWindowsProcess(String processExeName)
11/17/2014 08:57:05.56 SPUCHostService.exe (0x079C) 0x0838 SharePoint Foundation Sandboxed Code Service ei0t Medium – Process creation/initialization threw an exception. Stopping this process. “ipc://74711209-c66c-4a53-a9a5-3d9ddbe2f8b3:7000”
11/17/2014 08:57:05.56 SPUCHostService.exe (0x079C) 0x0838 SharePoint Foundation Sandboxed Code Service fe87 Medium – – Error starting worker process. – Starting worker process threw – Inner Exception: System.InvalidOperationException: No process is associated with this object. at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value) at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.CreateWindowsProcess(String processExeName)
11/17/2014 08:57:13.03 w3wp.exe (0x3DD4) 0x0824 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Request (GET:http://ca-test2k8dc:27607/_admin/Solutions.aspx))
11/17/2014 08:57:13.03 w3wp.exe (0x3DD4) 0x0824 SharePoint Foundation Logging Correlation Data xmnv Medium Name=Request (GET:http://ca-test2k8dc:27607/_admin/Solutions.aspx) f1b83d2f-1fb4-49f9-942b-4e4631992cf1
11/17/2014 08:57:13.06 w3wp.exe (0x3DD4) 0x0824 SharePoint Foundation Runtime tkau Unexpected System.Web.HttpCompileException: External component has thrown an exception. at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert… f1b83d2f-1fb4-49f9-942b-4e4631992cf1
11/17/2014 08:57:13.06* w3wp.exe (0x3DD4) 0x0824 SharePoint Foundation Runtime tkau Unexpected …) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) f1b83d2f-1fb4-49f9-942b-4e4631992cf1
11/17/2014 08:57:13.09 w3wp.exe (0x3DD4) 0x0824 SharePoint Foundation Logging Correlation Data xmnv Medium Site=/ f1b83d2f-1fb4-49f9-942b-4e4631992cf1
11/17/2014 08:57:13.10 w3wp.exe (0x3DD4) 0x0824 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Request (GET:http://ca-test2k8dc:27607/_admin/Solutions.aspx)). Execution Time=63.9258620858238 f1b83d2f-1fb4-49f9-942b-4e4631992cf1
11/17/2014 08:57:13.10 w3wp.exe (0x3DD4) 0x3E00 SharePoint Foundation Monitoring nasq Medium Entering monitored scope (Request (GET:http://ca-test2k8dc:27607/_layouts/error.aspx))
11/17/2014 08:57:13.10 w3wp.exe (0x3DD4) 0x3E00 SharePoint Foundation Logging Correlation Data xmnv Medium Name=Request (GET:http://ca-test2k8dc:27607/_layouts/error.aspx) 951ab15b-3c9e-4ee4-b496-173cdd059357
11/17/2014 08:57:13.10 w3wp.exe (0x3DD4) 0x3E00 SharePoint Foundation Runtime tkau Unexpected System.Web.HttpCompileException: External component has thrown an exception. at System.Web.Compilation.BuildManager.PostProcessFoundBuildResult(BuildResult result, Boolean keyFromVPP, VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetBuildResultFromCacheInternal(String cacheKey, Boolean keyFromVPP, VirtualPath virtualPath, Int64 hashCode) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(Vir… 951ab15b-3c9e-4ee4-b496-173cdd059357
11/17/2014 08:57:13.10* w3wp.exe (0x3DD4) 0x3E00 SharePoint Foundation Runtime tkau Unexpected …tualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 951ab15b-3c9e-4ee4-b496-173cdd059357
11/17/2014 08:57:13.10 w3wp.exe (0x3DD4) 0x3E00 SharePoint Foundation Monitoring b4ly Medium Leaving Monitored Scope (Request (GET:http://ca-test2k8dc:27607/_layouts/error.aspx)). Execution Time=2.46574634485668 951ab15b-3c9e-4ee4-b496-173cdd059357
11/17/2014 08:57:15.56 SPUCHostService.exe (0x079C) 0x0868 SharePoint Foundation Sandboxed Code Service fe88 Medium – – Error starting worker process. – Inner Exception: System.InvalidOperationException: No process is associated with this object. at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value) at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.CreateWindowsProcess(String processExeName)
11/17/2014 08:57:15.56 SPUCHostService.exe (0x079C) 0x0868 SharePoint Foundation Sandboxed Code Service ei0t Medium – Process creation/initialization threw an exception. Stopping this process. “ipc://81825818-ab62-4710-9b98-e85736445b69:7000”
11/17/2014 08:57:15.56 SPUCHostService.exe (0x079C) 0x0868 SharePoint Foundation Sandboxed Code Service fe87 Medium – – Error starting worker process. – Starting worker process threw – Inner Exception: System.InvalidOperationException: No process is associated with this object. at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value) at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.CreateWindowsProcess(String processExeName)
11/17/2014 08:57:25.56 SPUCHostService.exe (0x079C) 0x0868 SharePoint Foundation Sandboxed Code Service fe88 Medium – – Error starting worker process. – Inner Exception: System.InvalidOperationException: No process is associated with this object. at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value) at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.CreateWindowsProcess(String processExeName)
11/17/2014 08:57:25.56 SPUCHostService.exe (0x079C) 0x0868 SharePoint Foundation Sandboxed Code Service ei0t Medium – Process creation/initialization threw an exception. Stopping this process. “ipc://16a16291-6f1b-4928-bf29-f8b92a894639:7000”
11/17/2014 08:57:25.56 SPUCHostService.exe (0x079C) 0x0868 SharePoint Foundation Sandboxed Code Service fe87 Medium – – Error starting worker process. – Starting worker process threw – Inner Exception: System.InvalidOperationException: No process is associated with this object. at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) at System.Diagnostics.Process.set_PriorityClass(ProcessPriorityClass value) at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.CreateWindowsProcess(String processExeName)
Things to check:
From MSDN Blogs: http://blogs.msdn.com/b/sharepointdev/archive/2011/02/08/error-the-sandboxed-code-execution-request-was-refused-because-the-sandboxed-code-host-service-was-too-busy-to-handle-the-request.aspx
Technet: https://social.technet.microsoft.com/Forums/sharepoint/en-US/3b50dd8b-d789-4a2d-86f2-784b0e73c6a8/foundation-many-spucworkerprocessproxyexe-processes-and-high-memory-load?forum=sharepointadminprevious
Quote from technet: (With the account its running under it may be this)
The resolution in my case was to grant certain rights to some registry keys for buildin\users (local machine users group)
HKLM\System\CurrentControlSet\Control\ComputerName\ActiveComputerName –> READ
HKLM\System\CurrentControlSet\Control\ComputerName\ComputerName –> READ
HKLM\System\CurrentControlSet\Control\Nls\Sorting\Versions –> READ
HKLM\Software\Policies\Microsoft\Windows\Safer\CodeIdentifiers –> QueryValue
HKLM\System\CurrentControlSet\Control\Session Manager –> QueryValue
Restart the Microsoft SharePoint Foundation Sandboxed Code Service and voila it works. The SPUCServiceHost.exe launched a SPUCWorkerProcessProxy.exe which again launched the SPUCWorkerProcess.exe – an exe I never managed to get run before.
This issue might have been caused by some weird AD policy limitation, we actually never figured this out
Hi Natesan … it’s single server and running. A restart fixes it.
I have had similar issue with sandboxed solution before. Is the SPUC service in Central admin running fine on all servers in the farm?
Hi Mark,
It is strange but have you managed to deploy the solution to a similar environment (If it is Prod then do you have a similar test or Pre-prod environment)? Just to isolate the environment issue.