When I open my Grasshopper/Hops files in Rhino 8, they Hops component usually casts one of the following error message:
1. Solution exception:One or more errors occurred. (One or more errors occurred. (Invalid URI: The hostname could not be parsed.))
1. Unable to solve on compute
I found out Hops works just fine in rh8 if I first open a rh7 instance with the same Hops component.
How can I make Hops run fine in just Rhino 8?
Here’s a Compute log of the load rh8 loading process:
[12:50:21 INF] Rhino compute started at 24/11/07 12:50:21
[12:50:21 INF] Initiliazing reverse proxy at 24/11/07 12:50:21
[12:50:21 INF] Spawn children at startup is set to True
[12:50:21 INF] Now listening on: http://localhost:6500
[12:50:21 INF] Application started. Press Ctrl+C to shut down.
[12:50:21 INF] Hosting environment: Production
[12:50:21 INF] Content root path: C:\Users\shwde\AppData\Roaming\McNeel\Rhinoceros\packages\7.0\Hops\0.16.0\rhino.compute
CG [12:50:26 INF] Child process started at 24/11/07 12:50:26
CG [12:50:26 INF] Configuration Result:
[Success] Name compute.geometry
[Success] DisplayName rhino.compute
[Success] Description rhino.compute
[Success] ServiceName compute.geometry
CG [12:50:26 INF] Topshelf v4.1.0.172, .NET Framework v4.0.30319.42000
CG [12:50:26 INF] Compute 1.0.0.0, Rhino 7.37.24107.15001
CG [12:50:26 INF] Launching RhinoCore library as shwde
CG 6001 [12:50:30 INF] (1/2) Loading grasshopper
CG 6001 [12:50:39 INF] (2/2) Loading compute plug-ins
CG 6001 [12:50:40 INF] The compute.geometry service is now running, press Control+C to exit.
[12:51:21 INF] Max concurrent requests = 0
CG 6001 [12:52:07 ERR] Exception in DocumentAdded event handler
System.NullReferenceException: Object reference not set to an instance of an object.
at SnippetManager.AssemblyPriority.DocumentServer_DocumentAdded(GH_DocumentServer sender, GH_Document doc)
at Grasshopper.Kernel.GH_DocumentServer.DocumentAddedEventHandler.Invoke(GH_DocumentServer sender, GH_Document doc)
at Grasshopper.Kernel.GH_DocumentServer.AddDocument(GH_Document document)
at compute.geometry.GrasshopperDefinition.Construct(GH_Archive archive) in D:\BuildAgent\work\4852f584398a78e4\src\compute.geometry\GrasshopperDefinition.cs:line 201
CG 6001 [12:52:08 INF] ::1 - [2024-11-07T12:52:08.0246369+01:00] “POST /io HTTP/1.1” 200 -
[12:52:08 INF] HTTP POST /io responded 200 in 864.1936 ms
CG 6001 [12:52:08 ERR] Exception in DocumentAdded event handler
System.NullReferenceException: Object reference not set to an instance of an object.
at SnippetManager.AssemblyPriority.DocumentServer_DocumentAdded(GH_DocumentServer sender, GH_Document doc)
at Grasshopper.Kernel.GH_DocumentServer.DocumentAddedEventHandler.Invoke(GH_DocumentServer sender, GH_Document doc)
at Grasshopper.Kernel.GH_DocumentServer.AddDocument(GH_Document document)
at compute.geometry.GrasshopperDefinition.Construct(GH_Archive archive) in D:\BuildAgent\work\4852f584398a78e4\src\compute.geometry\GrasshopperDefinition.cs:line 201
CG 6001 [12:52:08 INF] ::1 - [2024-11-07T12:52:08.8517679+01:00] “POST /io HTTP/1.1” 200 -
[12:52:08 INF] HTTP POST /io responded 200 in 439.1245 ms
[12:52:21 INF] Max concurrent requests = 1
CG 6001 [12:52:26 INF] ::1 - [2024-11-07T12:52:26.3330357+01:00] “POST /grasshopper HTTP/1.1” 200 -
[12:52:26 INF] HTTP POST /grasshopper responded 200 in 13380.7377 ms
CG 6001 [12:52:40 INF] ::1 - [2024-11-07T12:52:40.1481639+01:00] “POST /grasshopper HTTP/1.1” 200 -
[12:52:40 INF] HTTP POST /grasshopper responded 200 in 7131.1096 ms
Is this the console log of the Rh8 instance? Or the Rh7 instance? Can you share the console log of the Rh8 instance (without launching the Rh7 instance first)? Also, you may want to set an environment variable on your system called RHINO_COMPUTE_DEBUG and set the value to True. This will add some more verbose logging information to the console log output which could be helpful to diagnose this problem.
Basically, my hunch is that the Rh8 instance is failing because of a plugin that you may have installed on your machine that’s causing compute to crash. When you launch the Rh7 instance first, it spins up fine, and then you launch Rh8 and it detects a running instance of compute on the proper port and it uses that to process requests. But, something is wrong with the Rh8 instance and causing it to crash (because you shouldn’t have to launch an Rh7 instance first to get things to work properly). You could try removing any 3rd party plugins and launch the Rh8 instance and see if it loads properly. If it does, then you can start adding back in your plugins to find the offending plugin.
I uninstalled all plugins and tried loading Hops again, but without luck.
I now get the following log (after enabling RHINO_COMPUTE_DEBUG):
[10:13:51 INF] Rhino compute started at 25/01/07 10:13:51
[10:13:51 INF] Initiliazing reverse proxy at 25/01/07 10:13:51
[10:13:51 INF] Spawn children at startup is set to True
[10:13:51 INF] Now listening on: http://localhost:6500
[10:13:51 INF] Application started. Press Ctrl+C to shut down.
[10:13:51 INF] Hosting environment: Production
[10:13:51 INF] Content root path: C:\Users\shwde\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.18\rhino.compute
You must install or update .NET to run this application.
App: C:\Users\shwde\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.18\compute.geometry\compute.geometry.exe
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '7.0.20' (x64)
.NET location: C:\Program Files\dotnet\
The following frameworks were found:
3.1.22 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
6.0.2 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
6.0.16 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
7.0.8 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=7.0.20&arch=x64&rid=win10-x64
[10:14:51 INF] Max concurrent requests = 0
[10:14:55 INF] Unable to start a local compute server
[10:14:55 ERR] HTTP POST /io responded 500 in 46552.0337 ms
System.Exception: Unable to start a local compute server
at rhino.compute.ComputeChildren.LaunchCompute(Queue`1 processQueue, Boolean waitUntilServing) in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ComputeChildren.cs:line 228
at rhino.compute.ComputeChildren.GetComputeServerBaseUrl() in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ComputeChildren.cs:line 98
at rhino.compute.ReverseProxyModule.<>c.<InitializeChildren>b__5_0() in D:\BuildAgent\work\4852f584398a78e4\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 D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 119
at rhino.compute.ReverseProxyModule.ReverseProxyPost(HttpRequest req, HttpResponse res) in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 179
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext)
[10:14:55 ERR] Connection id "0HN9EVEDD6L4V", Request id "0HN9EVEDD6L4V:00000001": 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 D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ComputeChildren.cs:line 228
at rhino.compute.ComputeChildren.GetComputeServerBaseUrl() in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ComputeChildren.cs:line 98
at rhino.compute.ReverseProxyModule.<>c.<InitializeChildren>b__5_0() in D:\BuildAgent\work\4852f584398a78e4\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 D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 119
at rhino.compute.ReverseProxyModule.ReverseProxyPost(HttpRequest req, HttpResponse res) in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 179
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)
[10:15:51 INF] Max concurrent requests = 0
[10:16:51 INF] Max concurrent requests = 0
[10:17:51 INF] Max concurrent requests = 0
The logs seem to show that you need to install a .NET framework package. I think if you click on this link and then install the package, then compute should work for you. You may need to restart your computer before the changes take effect. Please let me know if this doesn’t resolve the issue. Thanks.
Thank you very much, Andy. I did recall seeing the same line in my rh7 log, hence I ignored it, but I must have been mixing things up, since installing it did the trick.
Hops is loading fine now, but I do have a problem with executing rhinoscript commands in a Hops script, that call a Redraw, like rs.Explode(), rs.SplitCurve(), rs.CopyObject, etc.
I then get the below Runtime error.
Again, this is not happening when I load a Hops script in rh7 first.
Do you have an idea how to fix or work around this?
Runtime error (MissingMemberException): 'NoneType' object has no attribute 'Redraw'\n\nTraceback:\r\n line 1826, in TransformObjects, \"C:\\Users\\x\\AppData\\Roaming\\McNeel\\Rhinoceros\\8.0\\Plug-ins\\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\\settings\\lib\\rhinoscript\\object.py\"\r\n line 78, in CopyObjects, \"C:\\Users\\x\\AppData\\Roaming\\McNeel\\Rhinoceros\\8.0\\Plug-ins\\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\\settings\\lib\\rhinoscript\\object.py\"\r\n line 48, in CopyObject, \"C:\\Users\\x\\AppData\\Roaming\\McNeel\\Rhinoceros\\8.0\\Plug-ins\\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\\settings\\lib\\rhinoscript\\object.py\"\r\n line 2508, in script