Debug compute.geometry grasshopper execution failure that works in GUI

Since several years I am using Rhino.compute for automating the parametrized evaluation of a grasshopper document - so I know how to define the RH_INs and RH_OUTS.
I am currently facing a problem where I am not aware of a way on how to debug / solve it.


I have a grasshopper document that has RH_ins that are used in the GH document to directly load geometry from absolute pathes instead of supplying it as mesh parameter, transforms those geometries and then exports the geometry again to a path provided also provided as RH_IN. The RH_OUT in this case are some statistical information about the pathes.

The problem: for all sets I am using the SAME grasshopper definition, but under some unknown circumstances it might work in the GUI but not with compute on the SAME machine (tested for Rhino compute with Rhino 7 & 8):

parameter set A and several others: works in Grasshopper GUI, works with compute

parameter set B. works in Grasshopper GUI, does not work with compute

The only differences is the different set of parameters provided - no changes on the GH file.


Unfortunatelly due to legal reasons I can’t provide neither the GH definition nor the input geometries.

What are reasons / differences that this mismatch might happen? How to configure the GUI Grasshopper to replicate the issue faced while using Rhino.compute? How to debug / find the reason for this failure (apart from using scripting components for manual “logging” at relevant places of the document)? The compute logs don’t really help right now

Thanks for your insights / help.

Have you tried to use Hops to test your definitions? Since you can run this locally, and is backed by Rhino.Compute, it is a tool you could add to your development to see if the definition is working well in a Rhino.Compute environment.

Another thing to try is to switch from RH_IN / RH_OUT to use the context components.

Would be curious if these suggestions might reveal anything about the issue you are having.

2 Likes

Thanks for the quick reply!

I didn’t think about using Hops yet, but I’ll try it out and come back here with the results.

1 Like

It does indeed work with hops :thinking: - I have to take a closer on this issue tomorrow.

I narrowed down the issue - the evaluation of the grasshopper file works when executed using the the compute.exe that was lauchned by Rhino / Grasshopper directly.

I converted the GH document to hops and ensured that the types and shape of the parameters are actually the same as the one serialized by RhinoCompute.cs using the export:
image

- compute.rhino3d/src/compute.geometry/RhinoCompute.cs at 05bb6d21d368f79a3ef9850c63e103784afce741 · mcneel/compute.rhino3d · GitHub

If I use the most current commit from Github (branch 8.x 05bb6d21d368f79a3ef9850c63e103784afce741) or even the same EXE that is started by Rhino / Grasshopper I see the same issue that I face when using compute.geometry directly.

Approach:


Here I ensure that I can see the compute output, this way I can also see the port and send requests to the same compute endpoint that Hops is using - using that compute instance everything works as expected.

Window logs from compute.exe launched directly by Rhino / Grasshopper (works as expected):

[08:47:11 INF] Rhino compute started at 9/10/2024 8:47:11 AM
[08:47:11 INF] Initiliazing reverse proxy at 9/10/2024 8:47:11 AM
[08:47:11 INF] Spawn children at startup is set to True
[08:47:11 INF] Now listening on: http://localhost:6500
[08:47:11 INF] Application started. Press Ctrl+C to shut down.
[08:47:11 INF] Hosting environment: Production
[08:47:11 INF] Content root path: C:\Users\borstm\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute
CG  [08:47:15 INF] Child process started at 10.09.2024 08:47:15
CG  [08:47:15 INF] Parsed port = 6001
CG  [08:47:15 INF] Compute 8.0.0.0, Rhino 8.4.24044.15001
CG  [08:47:20 INF] (1/3) Loading rhino scripting plugin
CG  [08:47:20 INF] Successfully loaded scripting plugin
CG  [08:47:20 INF] (2/3) Loading grasshopper
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pywin32_bootstrap'
CG  [08:47:27 INF] (3/3) Loading compute plug-ins
CG  [08:47:28 INF] Now listening on: http://localhost:6001
CG  [08:47:28 INF] Application started. Press Ctrl+C to shut down.
CG  [08:47:28 INF] Hosting environment: Production
CG  [08:47:28 INF] Content root path: C:\Users\borstm\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute
CG  [08:47:32 INF] Child process started at 10.09.2024 08:47:32
CG  [08:47:32 INF] Parsed port = 6002
CG  [08:47:32 INF] Compute 8.0.0.0, Rhino 8.4.24044.15001
CG  [08:47:37 INF] (1/3) Loading rhino scripting plugin
CG  [08:47:37 INF] Successfully loaded scripting plugin
CG  [08:47:37 INF] (2/3) Loading grasshopper
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pywin32_bootstrap'
CG  [08:47:45 INF] (3/3) Loading compute plug-ins
CG  [08:47:45 INF] Now listening on: http://localhost:6002
CG  [08:47:45 INF] Application started. Press Ctrl+C to shut down.
CG  [08:47:45 INF] Hosting environment: Production
CG  [08:47:45 INF] Content root path: C:\Users\borstm\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute
[08:48:10 INF] HTTP POST /io responded 200 in 795.7116 ms
[08:48:10 INF] HTTP POST /io responded 200 in 73.0895 ms
[08:48:11 INF] Max concurrent requests = 1
[08:49:11 INF] Max concurrent requests = 1
[08:50:11 INF] Max concurrent requests = 1
[08:51:07 INF] HTTP POST /grasshopper responded 200 in 163434.6650 ms
[08:51:11 INF] Max concurrent requests = 1
[08:52:11 INF] Max concurrent requests = 0
[08:53:11 INF] Max concurrent requests = 0
[08:54:09 INF] HTTP POST /io responded 200 in 61.7432 ms
[08:54:11 INF] Max concurrent requests = 1
[08:55:11 INF] Max concurrent requests = 1
[08:56:11 INF] Max concurrent requests = 1
[08:56:44 INF] HTTP POST /grasshopper responded 200 in 141295.1494 ms
[08:57:11 INF] Max concurrent requests = 1
[08:58:11 INF] Max concurrent requests = 0
[08:59:11 INF] Max concurrent requests = 0
[09:00:11 INF] Max concurrent requests = 0
[09:00:52 INF] HTTP POST /io responded 200 in 69.8339 ms
[09:01:11 INF] Max concurrent requests = 1
[09:02:11 INF] Max concurrent requests = 1
[09:03:11 INF] Max concurrent requests = 1
[09:04:11 INF] Max concurrent requests = 1
[09:05:11 INF] Max concurrent requests = 1
[09:06:11 INF] Max concurrent requests = 1
[09:07:11 INF] Max concurrent requests = 0
...
[09:38:11 INF] Max concurrent requests = 0
[09:39:11 INF] Max concurrent requests = 1
[09:40:11 INF] Max concurrent requests = 1
[09:40:22 INF] HTTP POST /grasshopper responded 200 in 105055.8712 ms
[09:41:11 INF] Max concurrent requests = 1
...
[09:47:11 INF] Max concurrent requests = 0
[09:47:16 INF] HTTP GET /idlespan responded 200 in 1.4124 ms
[09:47:33 INF] HTTP GET /idlespan responded 200 in 0.1006 ms
[09:48:11 INF] Max concurrent requests = 0

In the following “log output” I am using the SAME exe launched by CMD instead of by Rhino, only obvious difference to me is that I explicitly supplied the port as the default one is already used by the still running compute instance launched by Rhino / GH.

The pufferfish error is exactly the SAME as the one that I am facing when executing the GH document with compute.geometry.exe directly.

Microsoft Windows [Version 10.0.19045.4780]
(c) Microsoft Corporation. All rights reserved.


C:\Users\borstm\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute>rhino.compute.exe --port=8085
[09:55:25 INF] Rhino compute started at 9/10/2024 9:55:25 AM
[09:55:25 INF] Initiliazing reverse proxy at 9/10/2024 9:55:25 AM
[09:55:25 INF] Spawn children at startup is set to False
[09:55:25 INF] Now listening on: http://localhost:8085
[09:55:25 INF] Application started. Press Ctrl+C to shut down.
[09:55:25 INF] Hosting environment: Production
[09:55:25 INF] Content root path: C:\Users\borstm\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute
[09:56:25 INF] Max concurrent requests = 0
CG  [09:56:36 INF] Child process started at 10.09.2024 09:56:36
CG  [09:56:37 INF] Parsed port = 6003
CG  [09:56:37 INF] Compute 8.0.0.0, Rhino 8.4.24044.15001
CG  [09:56:41 INF] (1/3) Loading rhino scripting plugin
CG  [09:56:41 INF] Successfully loaded scripting plugin
CG  [09:56:41 INF] (2/3) Loading grasshopper
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pywin32_bootstrap'
CG  [09:56:47 INF] (3/3) Loading compute plug-ins
CG  [09:56:48 INF] Now listening on: http://localhost:6003
CG  [09:56:48 INF] Application started. Press Ctrl+C to shut down.
CG  [09:56:48 INF] Hosting environment: Production
CG  [09:56:48 INF] Content root path: C:\Users\borstm\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute
CG  [09:56:52 INF] Child process started at 10.09.2024 09:56:52
CG  [09:56:52 INF] Parsed port = 6004
CG  [09:56:52 INF] Compute 8.0.0.0, Rhino 8.4.24044.15001
CG  [09:56:56 INF] Child process started at 10.09.2024 09:56:56
CG  [09:56:56 INF] Parsed port = 6005
CG  [09:56:57 INF] Compute 8.0.0.0, Rhino 8.4.24044.15001
CG  [09:56:57 INF] (1/3) Loading rhino scripting plugin
CG  [09:56:57 INF] Successfully loaded scripting plugin
CG  [09:56:57 INF] (2/3) Loading grasshopper
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pywin32_bootstrap'
CG  [09:57:01 INF] Child process started at 10.09.2024 09:57:01
CG  [09:57:01 INF] Parsed port = 6006
CG  [09:57:01 INF] Compute 8.0.0.0, Rhino 8.4.24044.15001
CG  [09:57:01 INF] (1/3) Loading rhino scripting plugin
CG  [09:57:02 INF] Successfully loaded scripting plugin
CG  [09:57:02 INF] (2/3) Loading grasshopper
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pywin32_bootstrap'
CG  [09:57:05 INF] (3/3) Loading compute plug-ins
CG  [09:57:05 INF] Now listening on: http://localhost:6004
CG  [09:57:05 INF] Application started. Press Ctrl+C to shut down.
CG  [09:57:05 INF] Hosting environment: Production
CG  [09:57:05 INF] Content root path: C:\Users\borstm\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute
CG  [09:57:06 INF] (1/3) Loading rhino scripting plugin
CG  [09:57:06 INF] Successfully loaded scripting plugin
CG  [09:57:06 INF] (2/3) Loading grasshopper
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pywin32_bootstrap'
CG  [09:57:11 INF] (3/3) Loading compute plug-ins
CG  [09:57:11 INF] Now listening on: http://localhost:6005
CG  [09:57:11 INF] Application started. Press Ctrl+C to shut down.
CG  [09:57:11 INF] Hosting environment: Production
CG  [09:57:11 INF] Content root path: C:\Users\borstm\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute
CG  [09:57:15 INF] (3/3) Loading compute plug-ins
CG  [09:57:15 INF] Now listening on: http://localhost:6006
CG  [09:57:15 INF] Application started. Press Ctrl+C to shut down.
CG  [09:57:15 INF] Hosting environment: Production
CG  [09:57:15 INF] Content root path: C:\Users\borstm\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute
CG  [09:57:17 ERR] An exception occurred while processing request
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Rhino.Geometry.Collections.BrepFaceList.get_Item(Int32 index)
   at Pufferfish.Components.Components_Surface._4_Surface.RebuildSurface.SolveInstance(IGH_DataAccess DA)
   at Grasshopper.Kernel.GH_Component.Solution_Compute_MixedAccess(GH_StructureIterator it)
CG  [09:57:17 ERR] An exception occurred while processing request
System.MissingMemberException: 'NoneType' object has no attribute 'PointAt'
   at Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at IronPython.Runtime.Binding.PythonGetMemberBinder.FastMethodGet`1.GetMethod(CallSite site, TSelfType target, CodeContext context)
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`5.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
   at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
   at RhinoPython.PyCompiledCode.Execute(PythonScript scope) in D:\BuildAgent\work\dujour\src4\rhino4\Plug-ins\ironpython\core\Runtime.cs:line 177
   at GhPython.Component.ScriptingAncestorComponent.SafeSolveInstance(IGH_DataAccess da)
CG  [09:57:17 ERR] An exception occurred while processing request
System.MissingMemberException: 'NoneType' object has no attribute 'PointAt'
   at Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at IronPython.Runtime.Binding.PythonGetMemberBinder.FastMethodGet`1.GetMethod(CallSite site, TSelfType target, CodeContext context)
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`5.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
   at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
   at RhinoPython.PyCompiledCode.Execute(PythonScript scope) in D:\BuildAgent\work\dujour\src4\rhino4\Plug-ins\ironpython\core\Runtime.cs:line 177
   at GhPython.Component.ScriptingAncestorComponent.SafeSolveInstance(IGH_DataAccess da)
   at Grasshopper.Kernel.GH_Component.Solution_Compute_MixedAccess(GH_StructureIterator it)
[09:57:25 INF] Max concurrent requests = 1
[09:58:25 INF] Max concurrent requests = 1
[09:59:25 INF] Max concurrent requests = 1
[10:00:25 INF] Max concurrent requests = 1
[10:01:25 INF] Max concurrent requests = 1
[10:02:25 INF] Max concurrent requests = 1
[10:03:25 INF] Max concurrent requests = 1

@fraguada do you have any idea what could cause this problem and how to fix it?

It seems like I am doing something wrong when launching compute.exe / compute.geometry.exe

I am not sure I appreciate the differences. In one test, you solve the definition via Hops, with local compute, and it works fine? But when you try to target local (or remote) compute from outside of Rhino, you get the error?

It works fine with hops and also my own application if I call the compute that starts automatically with Rhino / Grasshopper. So I don’t think there is an issue in my own application.


The compute process launched by Rhino is listening on localhost:6500, that’s what I called from my application as a test.

If I start compute or compute.geometry myself, it raises the exception shown in the second “log”.

The compute executable in both cases is the same, the difference simply is that Rhino is starting it and the other time I started the application using the command line.

1 Like

Ok. Question for you, when you start Rhino manually, do you know if you have switched the dotnet runtime with the _SetDotNetRuntime command? I’m trying to understand what are the differences between a manual start and a cli start.

Hmm not to my knowledge - I as far is I know, I am using the “default” installation, not any custom settings.

What information could I provide to help you debug this?

Then the only thing I can think of is that something in the pufferfish gha and component you are using is expecting something it is not finding in the headless compute environment. This is why it works when you manually run Rhino, and why it fails from CLI. Is there any way to set up a test where you do not use pufferfish to see if that is the issue in the headless / CLI setup?

I mean it DOES run headless too - the rhino.compute started by Rhino is also headless, isn’t it?

Somehow it also works with a different project (meaning I provide different values for the input parameters of the grasshopper document). So it’s not an issue with pufferfish and rhino.compute in general.

What I forgot to mention earlier: the same issue shows when using rhino.compute / compute.geometry with Rhino 7 & Rhino 8.

What CLI arguments are provided to the compute exe when launched from within Rhino?
What ENV variables are specifically set for the process?

1 Like

Thanks - I adapted the code so it fits my use case.

The issue persists which is unexpected for me.

I’ll involve a colleague of mine to make sure that I am not the problem here :sweat_smile: / I didn’t overlook an important aspect.

        private void LaunchCompute()
        {
            var pathToRhinoCompute =
                @"C:\Users\borstm\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute\rhino.compute.exe";
            var startInfo = new ProcessStartInfo(pathToRhinoCompute);
            int childCount = 3;

            int thisProc = Process.GetCurrentProcess().Id;
            startInfo.Arguments =
                $"--childof {thisProc} --childcount {childCount} --port {8086} --spawn-on-startup";
            startInfo.WindowStyle = ProcessWindowStyle.Minimized;
            // uncomment next line to ease debugging
            // startInfo.WindowStyle = ProcessWindowStyle.Normal;
            // Important: Keep UseShellExecute = true
            // If UseShellExecute is false, the child process inherits file handles from
            // the parent process. We found this out by noticing that Rhino suddenly thought
            // all of it's files were read-only. If we want to go with UseShellExecute = false
            // then we need to write a pInvoke to CreateProcess with the copyFileHandles
            // set to false.
            startInfo.UseShellExecute = true;
            startInfo.CreateNoWindow = false;
            string assemblyPath = Assembly.GetExecutingAssembly().Location;
            // 6 April 2022 - S. Baer (COMPUTE-241)
            // When grasshopper memory loads assemblies, the above line results in an
            // empty string. In this case use the assemblyinfo location property.
            //if (string.IsNullOrWhiteSpace(assemblyPath))
            //{
            //    assemblyPath = GhaAssemblyInfo.TheAssemblyInfo.Location;
            //}
            //string parentPath = Path.GetDirectoryName(assemblyPath);
            var wd =
                @"C:\Users\borstm\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute";
            startInfo.WorkingDirectory = wd;
            var process = Process.Start(startInfo);
        }
[14:02:43 INF] Rhino compute started at 9/10/2024 2:02:43 PM
[14:02:43 INF] Initiliazing reverse proxy at 9/10/2024 2:02:43 PM
[14:02:43 INF] Spawn children at startup is set to True
[14:02:43 INF] Now listening on: http://localhost:8086
[14:02:43 INF] Application started. Press Ctrl+C to shut down.
[14:02:43 INF] Hosting environment: Production
[14:02:43 INF] Content root path: C:\Users\borstm\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute
CG  [14:02:47 INF] Child process started at 10.09.2024 14:02:47
CG  [14:02:47 INF] Parsed port = 6003
CG  [14:02:47 INF] Compute 8.0.0.0, Rhino 8.4.24044.15001
CG  [14:02:52 INF] (1/3) Loading rhino scripting plugin
CG  [14:02:52 INF] Successfully loaded scripting plugin
CG  [14:02:52 INF] (2/3) Loading grasshopper
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pywin32_bootstrap'
CG  [14:02:58 INF] (3/3) Loading compute plug-ins
CG  [14:02:59 INF] Now listening on: http://localhost:6003
CG  [14:02:59 INF] Application started. Press Ctrl+C to shut down.
CG  [14:02:59 INF] Hosting environment: Production
CG  [14:02:59 INF] Content root path: C:\Users\borstm\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute
CG  [14:03:03 INF] Child process started at 10.09.2024 14:03:03
CG  [14:03:03 INF] Parsed port = 6004
CG  [14:03:03 INF] Compute 8.0.0.0, Rhino 8.4.24044.15001
CG  [14:03:07 INF] Child process started at 10.09.2024 14:03:07
CG  [14:03:07 INF] Parsed port = 6005
CG  [14:03:07 INF] Compute 8.0.0.0, Rhino 8.4.24044.15001
CG  [14:03:08 INF] (1/3) Loading rhino scripting plugin
CG  [14:03:08 INF] Successfully loaded scripting plugin
CG  [14:03:08 INF] (2/3) Loading grasshopper
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pywin32_bootstrap'
CG  [14:03:12 INF] (1/3) Loading rhino scripting plugin
CG  [14:03:12 INF] Successfully loaded scripting plugin
CG  [14:03:12 INF] (2/3) Loading grasshopper
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pywin32_bootstrap'
CG  [14:03:16 INF] (3/3) Loading compute plug-ins
CG  [14:03:16 INF] Now listening on: http://localhost:6004
CG  [14:03:16 INF] Application started. Press Ctrl+C to shut down.
CG  [14:03:16 INF] Hosting environment: Production
CG  [14:03:16 INF] Content root path: C:\Users\borstm\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute
CG  [14:03:20 INF] (3/3) Loading compute plug-ins
CG  [14:03:21 INF] Now listening on: http://localhost:6005
CG  [14:03:21 INF] Application started. Press Ctrl+C to shut down.
CG  [14:03:21 INF] Hosting environment: Production
CG  [14:03:21 INF] Content root path: C:\Users\borstm\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute
[14:03:43 INF] Max concurrent requests = 1
CG  [14:03:51 ERR] An exception occurred while processing request
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Rhino.Geometry.Collections.BrepFaceList.get_Item(Int32 index)
   at Pufferfish.Components.Components_Surface._4_Surface.RebuildSurface.SolveInstance(IGH_DataAccess DA)
   at Grasshopper.Kernel.GH_Component.Solution_Compute_MixedAccess(GH_StructureIterator it)
CG  [14:03:51 ERR] An exception occurred while processing request
System.MissingMemberException: 'NoneType' object has no attribute 'PointAt'
   at Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at IronPython.Runtime.Binding.PythonGetMemberBinder.FastMethodGet`1.GetMethod(CallSite site, TSelfType target, CodeContext context)
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`5.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
   at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
   at RhinoPython.PyCompiledCode.Execute(PythonScript scope) in D:\BuildAgent\work\dujour\src4\rhino4\Plug-ins\ironpython\core\Runtime.cs:line 177
   at GhPython.Component.ScriptingAncestorComponent.SafeSolveInstance(IGH_DataAccess da)
CG  [14:03:51 ERR] An exception occurred while processing request
System.MissingMemberException: 'NoneType' object has no attribute 'PointAt'
   at Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at IronPython.Runtime.Binding.PythonGetMemberBinder.FastMethodGet`1.GetMethod(CallSite site, TSelfType target, CodeContext context)
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`5.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
   at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
   at RhinoPython.PyCompiledCode.Execute(PythonScript scope) in D:\BuildAgent\work\dujour\src4\rhino4\Plug-ins\ironpython\core\Runtime.cs:line 177
   at GhPython.Component.ScriptingAncestorComponent.SafeSolveInstance(IGH_DataAccess da)
   at Grasshopper.Kernel.GH_Component.Solution_Compute_MixedAccess(GH_StructureIterator it)
[14:04:43 INF] Max concurrent requests = 1
[14:05:18 ERR] HTTP POST /grasshopper responded 500 in 100042.3439 ms
System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
 ---> System.TimeoutException: The operation was canceled.
 ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
 ---> System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
 ---> System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request.
   --- End of inner exception stack trace ---
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
   at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async)
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at rhino.compute.ReverseProxyModule.SendProxyRequest(HttpRequest initialRequest, HttpMethod method, String baseurl) in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 146
   at rhino.compute.ReverseProxyModule.ReverseProxyGrasshopper(HttpRequest req, HttpResponse res) in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 202
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext)
[14:05:18 ERR] Connection id "0HN6HI2DD2G82", Request id "0HN6HI2DD2G82:00000001": An unhandled exception was thrown by the application.
System.Threading.Tasks.TaskCanceledException: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
 ---> System.TimeoutException: The operation was canceled.
 ---> System.Threading.Tasks.TaskCanceledException: The operation was canceled.
 ---> System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
 ---> System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request.
   --- End of inner exception stack trace ---
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
   at System.Net.Http.HttpConnection.InitialFillAsync(Boolean async)
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.DiagnosticsHandler.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at rhino.compute.ReverseProxyModule.SendProxyRequest(HttpRequest initialRequest, HttpMethod method, String baseurl) in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 146
   at rhino.compute.ReverseProxyModule.ReverseProxyGrasshopper(HttpRequest req, HttpResponse res) in D:\BuildAgent\work\4852f584398a78e4\src\rhino.compute\ReverseProxy.cs:line 202
   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)
[14:05:43 INF] Max concurrent requests = 1
[14:06:43 INF] Max concurrent requests = 0
[14:07:43 INF] Max concurrent requests = 0
[14:08:43 INF] Max concurrent requests = 0
[14:09:43 INF] Max concurrent requests = 0

We checked the whole thing together again.

The problem is still as stated in the messages above:

Works fully:

  • Executing using “pure Grasshopper”
  • Executing using Hops, Compute Server managed and started by Rhino
  • Calling Compute from WPF application using the Compute Server managed and started by Rhino

Works partially:

  • Calling Compute from WPF using Compute.Geometry & Compute with most current github commit started by CMD - wroks only for some parameter combinations.
  • Calling Compute from WPF using Compute packaged with Hops installation started by CMD - works only for some parameter combinations.
  • Calling Compute from WPF using Compute (Hops version + Github version) started by Process.Start in WPF application as posted by Steve - works only for some parameter combinations.

The error is always the same one and occurs with the same set of parameters (might be more than one set of parameters, didn’t fully test all yet).

The hops version was only tested with Rhino 8, the error also shows with Rhino 7 though when using the “traditional” RH_IN / RH_OUT.

As of this moment we are unsure on what further information we could provide apart from the concrete parameters to provide for solving this issue.

In the meantime I will ask a colleague to provide a simplified version of the problem that hopefully also leads to the error.

Why do you need to do any of this? Why can you not create a powershell script (or cmd script) to launch the rhino.compute.exe from the Hops directory. For example, I can launch powershell and navigate to the rhino.compute directory (ie. C:\Users\andyo\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\Hops\0.16.13\rhino.compute). I then enter the following command:

./rhino.compute.exe --port 7000 --childcount 3 --spawn-on-startup

Obviously, you can change the port number and child count to whatever you want. This will launch the rhino.compute.exe which in turn will automatically start the child processes of compute.geometry.exe (three times). This is essentially the same thing that happens when you launch Grasshopper and it automatically starts up this same procedure. Can you not do the same?

Also… and this is just an FYI, in Hops/Rhino.Compute version 0.16.9 we fixed a bug which now allows you to output more verbose logging information via the console window. If you create a new environment variable called RHINO_COMPUTE_DEBUG and set the value to True then the console window output will show you more information when it’s starting up. Perhaps this will help us troubleshoot your issue.

1 Like

This is one of the things I tested that only partially work (the other "configurations I tested it are stated in my previous post).

  • Calling Compute from WPF using Compute packaged with Hops installation started by CMD - works only for some parameter combinations.

The same (as in same absolute path) rhino.compute.exe from the hops directory executed my grasshopper file with given parameters without any issues in case it was launched by rhino itself, but fails when I do it with either CMD or C#.

I don’t know what’s the difference, but there has to be something that must cause the error :thinking:

image
Commits · mcneel/compute.rhino3d (github.com)

Unfortunately I can’t find a version 0.16.9 of hops anywhere - neither on Github, Food4Rhino nor in the package manager directly.

You don’t need to revert back to 0.16.9. I was just pointing out that if you’re using a version equal to or higher than that, then you should be able to use that environment variable and it should give you more verbose logging.

1 Like

Setting RHINO_COMPUTE_DEBUG did not have any effect for me as I am using Rhino 8.4.24044 and RHINO_COMPUTE_DEBUG only works with Rhino >=8.10.

Source: compute.rhino3d/CHANGELOG.HOPS.md at 8.x · mcneel/compute.rhino3d (github.com)

I’ll try to get a new version of Rhino installed.

EDIT: I will leave my current company by Friday, @Christian_Luger will take over this issue from then on