System.Exception: Unable to start a local compute server

I cannot use hops for some reason:

image

[11:36:28 INF] Rhino compute started at 5/29/2023 11:36:28 AM
[11:36:28 INF] Initiliazing reverse proxy at 5/29/2023 11:36:28 AM
[11:36:28 INF] Spawn children at startup is set to True
[11:36:28 INF] Now listening on: http://localhost:6500
[11:36:28 INF] Application started. Press Ctrl+C to shut down.
[11:36:28 INF] Hosting environment: Production
[11:36:28 INF] Content root path: C:\Users\pcuser\AppData\Roaming\McNeel\Rhinoceros\packages\7.0\Hops\0.16.0\rhino.compute
CG [11:36:33 INF] Child process started at 5/29/2023 11:36:33 AM
CG [11:36:34 INF] Configuration Result:
[Success] Name compute.geometry
[Success] DisplayName rhino.compute
[Success] Description rhino.compute
[Success] ServiceName compute.geometry
CG [11:36:34 INF] Topshelf v4.1.0.172, .NET Framework v4.0.30319.42000
CG [11:36:34 INF] Compute 1.0.0.0, Rhino 7.30.23130.11001
CG [11:36:34 INF] Launching RhinoCore library as pcuser
CG 6001 [11:36:37 INF] (1/2) Loading grasshopper
CG 6001 [11:37:00 INF] (2/2) Loading compute plug-ins
CG 6001 [11:37:01 INF] The compute.geometry service is now running, press Control+C to exit.
[11:37:28 INF] Max concurrent requests = 0
[11:37:34 INF] Unable to start a local compute server
[11:38:28 INF] Max concurrent requests = 0
[11:38:32 ERR] HTTP POST /io responded 500 in 26.9662 ms
System.Exception: Unable to start a local compute server
at rhino.compute.ComputeChildren.LaunchCompute(Queue1 processQueue, Boolean waitUntilServing) in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ComputeChildren.cs:line 224 at rhino.compute.ComputeChildren.GetComputeServerBaseUrl() in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ComputeChildren.cs:line 96 at rhino.compute.ReverseProxyModule.<>c.<InitializeChildren>b__5_0() in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 41 at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b__277_0(Object ) at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread , ExecutionContext , ContextCallback , Object ) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread , ExecutionContext , ContextCallback , Object ) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& , Thread ) --- End of stack trace from previous location --- at rhino.compute.ReverseProxyModule.AwaitInitTask() in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 113 at rhino.compute.ReverseProxyModule.ReverseProxyPost(HttpRequest req, HttpResponse res) in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 173 at Carter.CarterExtensions.<>c__DisplayClass1_0.<<CreateRouteHandler>b__0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext) [11:38:32 ERR] Connection id "0HMQVUNHPKD0F", Request id "0HMQVUNHPKD0F:00000002": An unhandled exception was thrown by the application. System.Exception: Unable to start a local compute server at rhino.compute.ComputeChildren.LaunchCompute(Queue1 processQueue, Boolean waitUntilServing) in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ComputeChildren.cs:line 224
at rhino.compute.ComputeChildren.GetComputeServerBaseUrl() in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ComputeChildren.cs:line 96
at rhino.compute.ReverseProxyModule.<>c.b__5_0() in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 41
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__277_0(Object )
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread , ExecutionContext , ContextCallback , Object )
— End of stack trace from previous location —
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread , ExecutionContext , ContextCallback , Object )
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& , Thread )
— End of stack trace from previous location —
at rhino.compute.ReverseProxyModule.AwaitInitTask() in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 113
at rhino.compute.ReverseProxyModule.ReverseProxyPost(HttpRequest req, HttpResponse res) in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 173
at Carter.CarterExtensions.<>c__DisplayClass1_0.<b__0>d.MoveNext()
— End of stack trace from previous location —
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication1 application) [11:39:08 ERR] HTTP POST /io responded 500 in 1.5704 ms System.Exception: Unable to start a local compute server at rhino.compute.ComputeChildren.LaunchCompute(Queue1 processQueue, Boolean waitUntilServing) in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ComputeChildren.cs:line 224
at rhino.compute.ComputeChildren.GetComputeServerBaseUrl() in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ComputeChildren.cs:line 96
at rhino.compute.ReverseProxyModule.<>c.b__5_0() in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 41
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__277_0(Object )
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread , ExecutionContext , ContextCallback , Object )
— End of stack trace from previous location —
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread , ExecutionContext , ContextCallback , Object )
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& , Thread )
— End of stack trace from previous location —
at rhino.compute.ReverseProxyModule.AwaitInitTask() in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 113
at rhino.compute.ReverseProxyModule.ReverseProxyPost(HttpRequest req, HttpResponse res) in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 173
at Carter.CarterExtensions.<>c__DisplayClass1_0.<b__0>d.MoveNext()
— End of stack trace from previous location —
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext)
[11:39:08 ERR] Connection id “0HMQVUNHPKD0G”, Request id “0HMQVUNHPKD0G:00000002”: An unhandled exception was thrown by the application.
System.Exception: Unable to start a local compute server
at rhino.compute.ComputeChildren.LaunchCompute(Queue1 processQueue, Boolean waitUntilServing) in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ComputeChildren.cs:line 224 at rhino.compute.ComputeChildren.GetComputeServerBaseUrl() in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ComputeChildren.cs:line 96 at rhino.compute.ReverseProxyModule.<>c.<InitializeChildren>b__5_0() in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 41 at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b__277_0(Object ) at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread , ExecutionContext , ContextCallback , Object ) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread , ExecutionContext , ContextCallback , Object ) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& , Thread ) --- End of stack trace from previous location --- at rhino.compute.ReverseProxyModule.AwaitInitTask() in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 113 at rhino.compute.ReverseProxyModule.ReverseProxyPost(HttpRequest req, HttpResponse res) in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 173 at Carter.CarterExtensions.<>c__DisplayClass1_0.<<CreateRouteHandler>b__0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication1 application)
[11:39:28 INF] Max concurrent requests = 0

Do you have any 3rd party GHAs installed? If so, one of them may not like running in compute.

This is my definition:

Are you suggesting that even if I’m not using 3rd party ghas in my definition, trying to use local compute will fail?

I am able to run compute directly as explained by Andy Payne in another post, and by supplying the url in the hops preferences, this simple script runs just fine even with all my 3rd party dlls.

The server is running:

It just throws that exception when I try to compute the script.

Yes, that would be my first thing to look into. Are there a number of 3rd party GHAs installed?

I’ve removed all 3rd party libraries and user objects that I added manually. And the problem persists.

Do you know how I can quickly remove anything installed via the PackageManager? @stevebaer

I’ve reverted my rhino pretty much to default.

All packages except hops have been removed.
All 3rd party grasshopper libraries and userobjects have been removed.

The problem still persists.

1 Like

Interesting; how are you running compute directly? Hops is just trying to launch compute and it seems like if one technique worked then both should work.

I run it from the executable inside the hops folder, which uses port 8081.
When it launches from within Grasshopper it uses port 6500.

I did also compile and run it from visual studio in debug.

I did also at one time, a while ago and without reading things carefully try to run a deployment setup on my local machine and not a remote/vm machine as per the instructions.

Is there anything in the above two scenarios that could of changed some file/variable on my machine that could be conflicting with the launch of compute from inside grasshopper?

I’m coming up empty on ideas at the moment. @AndyPayne or @will, do we have any log files that Richard may be able to look at to help figure out what is going wrong?

Set the following registry keys, run Compute and look for a RhinoDebugMessages.txt in My Documents!

[HKEY_CURRENT_USER\SOFTWARE\McNeel\Rhinoceros\7.0\Global Options\Debug Logging]
"Enabled"=dword:00000001
"SaveTofile"=dword:00000001

Thanks Will. Here’s the logfile after running rhino and grasshopper and getting the system exception.

I’ve sent a copy to Andy as well. We will be meeting in the next day or so over zoom to see what we can discover.
RhinoDebugMessages.txt (9.3 KB)

Hello, I’ve run into a similiar issue, and am quite interested if any solution was found. :grinning:

I also encounter the issue on one computer. It did work for the user in the past, but when he came back from holidays, the error appeared. No additional software was installed, Windows and Rhino might have been updated though.

We recently received this error on our compute server.

Is there a solution to this @stevebaer?

Unable to start a local compute server

2024-01-15 12:14:15.913 +01:00 [ERR] HTTP POST /grasshopper responded 500 in 130292.8891 ms
System.Exception: Unable to start a local compute server
   at rhino.compute.ComputeChildren.LaunchCompute(Queue`1 processQueue, Boolean waitUntilServing) in /home/runner/work/compute.rhino3d/compute.rhino3d/src/rhino.compute/ComputeChildren.cs:line 224
   at rhino.compute.ComputeChildren.GetComputeServerBaseUrl() in /home/runner/work/compute.rhino3d/compute.rhino3d/src/rhino.compute/ComputeChildren.cs:line 96
   at rhino.compute.ReverseProxyModule.ReverseProxyGrasshopper(HttpRequest req, HttpResponse res) in /home/runner/work/compute.rhino3d/compute.rhino3d/src/rhino.compute/ReverseProxy.cs:line 205
   at Carter.CarterExtensions.<>c__DisplayClass1_0.<<CreateRouteHandler>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at rhino.compute.ApiKeyMiddleware.InvokeAsync(HttpContext context) in /home/runner/work/compute.rhino3d/compute.rhino3d/src/rhino.compute/ApiKeyMiddleware.cs:line 35
   at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext)

Is this in Rhino 7 or 8? Do you have any third party plugins installed?

Hi Andy, I’m just now looking back at this and realise that it was never followed up on by you guys after I submitted the log file.

I’m still experiencing the exact same issue as I was then, and only manually running compute.geometry.exe allows me to use hops.

Do you any URLs that you manually typed into the Hops preferences section?

Going back to the original steps we took last year, no.

I’ve gone through all the steps mentioned here and in other posts, and the issue still stands. The only way I can get it to work is the manually spin up compute.geometry.exe and add that url to the grasshopper settings.

Without that in place, the server spins up on 6500, but as soon as request is made, exception is thrown. Same as previously reported. Remember we did a web call on this.

Can you send a screenshot of the console window when you send it a request and it fails? Let’s clear the URLs and use the instance that gets started with Grasshoper. In addition, please create an environment variable called RHINO_COMPUTE_DEBUG and then set its value to True. This will hopefully give us some more detailed logging information. Also what version of Rhino and Hops are you using now?