Unable to start a local compute server

Hi,

I have been trying to get Rhino.Compute running but running into some issues when running it on a Windows Server. I have been getting an exception “Unable to start a local compute server” when I send a request to Rhino.Compute. Complete output of the log:

As a separate test I also started compute.geometry.exe up and was able to connect and execute endpoints, however because compute.geometry.exe appears to bill for uptime not for usage it’s not sustainable for us to keep the exe running outside of just verifying that it does work and our Rhino Token is valid.

Any help/suggestions appreciated!

Thanks,
Daniel

Hi Daniel. Thanks for your inquiry. Looking at the top of the picture you provided, I can see that you’re launching the rhino.compute.exe manually. You don’t need to do this (assuming you’ve run the bootstrap script described here). Instead, whenever you start your VM, IIS will automatically get started. When IIS gets started, it will then automatically try to launch rhino.compute.exe. This is the parent program but when this is launched, you are not getting billed by McNeel (via core-hour billing). Rhino.compute.exe will wait for any incoming HTTP requests sent to it via IIS whenever it receives one on port 80. You will need to include the API key that you should have provided during the bootstrap process as part of the header in the HTTP request. So, once you send it a proper request with your API key, IIS will get it and forward it to rhino.compute.exe. Then, rhino.compute.exe will authenticate your request (checking the API key) and then look to see if there are any children processes of compute.geometry.exe already running. If not, it will start one up. Whenever an instance of compute.geometry.exe is started up… that’s when your core-hour billing will then kick in. So, the rhino.compute.exe will spin up a child process of compute.geometry.exe and then forward the request that it received on to the child. The child will then process the request and send the response back to you. If, after 1 hour (which is the default idlespan parameter) the rhino.compute.exe has not received any new authenticated requests, then it will automatically shut down any child processes that are currently running. This means you will then stop being billed by McNeel. The parent process will then stay up and listening for requests, but again, you aren’t billed until you actually send a properly authenticated request and the child compute.geometry.exe actually gets started.
So, long story short… I think you need to not manually launch the rhino.compute.exe process. Instead, simply restart your VM and let IIS launch everything for you. Ideally, you should be able to send a GET request to your VM URL (making sure you’re on port 80 and that you’ve included your API key in the header) to the endpoint /healthcheck and it should return a value of Healthy if all is working. You can then send another request to the endpoint /activeChildren which will return an integer showing you how many child processes are running. The first time, this will likely be zero but this endpoint will tell rhino.compute.exe to spin up the default number of children (which is set to 4) so if you send this again after a short amount of time (allowing the time to start 4 instances of rhino and grasshopper in the background) then this value should show something larger than zero (hopefully 4). Let me know if this helps.

1 Like

Hi Andy,

I have tried running with IIS and it worked for a little while and then stopped, so I have been trying to run rhino compute through the console to get some logs because no logs were reported when using IIS. I assume that Rhino Compute running on IIS is pretty much the same as running it in the console as long as I supply the correct CLI arguments?

Thanks,
Daniel

Yes, that is correct. Launching the rhino.compute.exe manually via the CLI is essentially the same as having IIS do it. If you look at the web.config file in the rhino.compute directory, you can look at the default settings/parameters for how IIS launches rhino.compute.exe.

Awesome, thanks Andy.

So then getting the exception I am is not because I have launched it through CLI but there is actually an exception occurring within Rhino Compute?

Thanks,
Daniel

Hi Andy,

I’m having trouble setting up Rhino Compute on my local machine. Without starting rhino.compute.exe, localhost:5000 does not respond. When I start rhino.compute.exe, I get:

localhost:5000 → "compute.rhino3d"

localhost:5000/healthcheck → "Healthy"

However, when I try to access localhost:5000/version, the request never completes, and I eventually get a runtime error.
Terminal Output:

At startup:

RC  [13:27:19 INF] Rhino compute started at 4/3/2025 1:27:19 PM
RC  [13:27:20 DBG] Hosting starting
RC  [13:27:20 DBG] Found module rhino.compute.ReverseProxyModule
RC  [13:27:20 DBG] Initiliazing reverse proxy at 4/3/2025 1:27:20 PM
RC  [13:27:20 DBG] Spawn children at startup is set to False
RC  [13:27:20 INF] Now listening on: http://localhost:5000
RC  [13:27:20 INF] Application started. Press Ctrl+C to shut down.
RC  [13:27:20 INF] Hosting environment: Production
RC  [13:27:20 INF] Content root path: C:\Users\gifi2\source\repos\src\bin\Debug\rhino.compute
RC  [13:27:20 DBG] Hosting started
RC  [13:27:23 INF] HTTP GET / responded 200 in 69.4377 ms
RC  [13:27:27 INF] Starting compute.geometry instance on port 6001
The specified framework 'Microsoft.NETCore.App', version '7.0.0', apply_patches=1, version_compatibility_range=patch cannot roll-forward to the previously referenced version '8.0.14'.
RC  [13:27:33 INF] HTTP GET / responded 200 in 1.4708 ms

When accessing /version:

RC  [13:30:38 INF] Unable to start a local compute server
RC  [13:30:38 ERR] HTTP GET /version responded 500 in 128032.3765 ms
System.Exception: Unable to start a local compute server
   at rhino.compute.ComputeChildren.LaunchCompute(Queue`1 processQueue, Boolean waitUntilServing) in C:\Users\gifi2\source\repos\src\rhino.compute\ComputeChildren.cs:line 229
   at rhino.compute.ComputeChildren.GetComputeServerBaseUrl() in C:\Users\gifi2\source\repos\src\rhino.compute\ComputeChildren.cs:line 98
   at rhino.compute.ReverseProxyModule.<>c.<InitializeChildren>b__5_0() in C:\Users\gifi2\source\repos\src\rhino.compute\ReverseProxy.cs:line 43
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at rhino.compute.ReverseProxyModule.AwaitInitTask() in C:\Users\gifi2\source\repos\src\rhino.compute\ReverseProxy.cs:line 119
   at rhino.compute.ReverseProxyModule.ReverseProxyGet(HttpRequest req, HttpResponse res) in C:\Users\gifi2\source\repos\src\rhino.compute\ReverseProxy.cs:line 162
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext)
RC  [13:30:38 ERR] Connection id "0HNBIKA0IOFNJ", Request id "0HNBIKA0IOFNJ:00000005": An unhandled exception was thrown by the application.
System.Exception: Unable to start a local compute server
   at rhino.compute.ComputeChildren.LaunchCompute(Queue`1 processQueue, Boolean waitUntilServing) in C:\Users\gifi2\source\repos\src\rhino.compute\ComputeChildren.cs:line 229
   at rhino.compute.ComputeChildren.GetComputeServerBaseUrl() in C:\Users\gifi2\source\repos\src\rhino.compute\ComputeChildren.cs:line 98
   at rhino.compute.ReverseProxyModule.<>c.<InitializeChildren>b__5_0() in C:\Users\gifi2\source\repos\src\rhino.compute\ReverseProxy.cs:line 43
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at rhino.compute.ReverseProxyModule.AwaitInitTask() in C:\Users\gifi2\source\repos\src\rhino.compute\.cs:line 119ReverseProxy`Preformatted text`
   at rhino.compute.ReverseProxyModule.ReverseProxyGet(HttpRequest req, HttpResponse res) in C:\Users\gifi2\source\repos\src\rhino.compute\ReverseProxy.cs:line 162
   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](IHttpApplication`1 application)

Same in screenshot (trying to access /version):

What I have tried:

Do you see what could be causing the probelm in my case?
If you need any more information to help me troubleshoot, let me know.

Thanks in advance for your help!

SOLVED:
I installed the Microsoft .NET Core 7.0.14.
(8.?.? did not work and 7.0.0 did not work as well even though roll forward for minor versions was enabled in the code. So 7.0.0 should have worked in my opinion.)

With 7.0.14 installed (I did not need to uninstall 7.0.0) it now works.

Hope this helps if someone else has the same problem.

1 Like

Great. Thanks for digging deep on that. I was about to form a reply today and saw that you just fixed it. Cheers!