Nested Hops not working with AWS Rhino.Compute

Hi,
There is a GH definition which takes diameter and gives radius. Lets call this GH-A

There is a GH definition which calls GH-A as a Hops component which is used to create a shape. Lets call this GH-B.

Finally, there is a GH definition which calls GH-B as a Hops component. Lets call this GH-C

GH-B solves through AWS Rhino.Compute
But GH-C is not solving through AWS Rhino.Compute.

This is the Rhino.Compute log file on the AWS remote machine of GH-C. There is no error to debug the issue.

2025-01-21 11:16:19.761 +00:00 [INF] HTTP POST /grasshopper responded 200 in 1.5250 ms
2025-01-21 11:16:19.782 +00:00 [INF] HTTP POST /grasshopper responded 200 in 0.5345 ms
2025-01-21 11:16:19.835 +00:00 [INF] HTTP POST /grasshopper responded 200 in 29.2987 ms
2025-01-21 11:16:19.857 +00:00 [INF] HTTP POST /grasshopper responded 200 in 1.9282 ms
2025-01-21 11:16:19.904 +00:00 [INF] HTTP POST /grasshopper responded 200 in 0.7499 ms
2025-01-21 11:16:20.747 +00:00 [INF] HTTP POST /grasshopper responded 200 in 1.5327 ms

GH-A.gh (7.3 KB)
GH-B.gh (11.2 KB)
GH-C.gh (7.7 KB)

@AndyPayne would you be able to help with this? If there is any more information required I can continue this as a DM. We really unable to proceed as there is no error being shown on the Hops component that we can go off of to understand what the issue is.

I believe that you will need to log into your VM and launch Rhino and Grasshopper. Hops should be automatically installed now as part of the bootstrap script but if it isn’t installed then you’ll need to do that. Then go to the Grasshopper Preferences->Solver->Hops Preferences section. In the URL section, you’ll need to include the URL to your VM (this should match the same URL that you use when you send a Hips definition from a local machine). You’ll also want to put in the API key that you have assigned. Then restart the VM. After that, try your nested definition and see if it works.

Hi @AndyPayne, thanks for the quick response. We followed your steps but nothing has changed.

We have set up the VM Rhino & Grasshopper in the Admin profile and not the RhinoComputeUser. Could that be the issue with this? We tried setting it up in the RhinoComputeUser as well, but nothing changed. The logs are being received in the Admin profile only.

I’m confused. Are you using IIS? Did you use the bootstrap script outlined in this guide? How did you “setup the VM to use Rhino and Grasshopper in the Admin profile”? If you’re using IIS with the bootstrap script, then Rhino.Compute will launch the Compute.Geometry process using the RhinoComputeUser profile. I guess I’m just really confused as to how you’ve configured your VM. Following the guide (linked above) should automatically set everything up to work and you shouldn’t need to do any further customization (except for possibly adding in the Hops credentials/URLS that I mentioned above).

We have followed the exact guide you have linked and set everything up using the bootstrap script.

The IIS is set up in the Admin Profile. But as you mentioned, it spawns the Compute.Geometry processes in the RhinoComputeUser profile. So is this a point of conflict? Since you asked us to set the URL and API key in the grasshopper solver, we are not sure which profile to set it up in.

Regardless, we tried setting it up in both the Admin & RhinoComputeUser profiles. But there is still no output from the Hops component in GH-C.

As mentioned before, non-nested Hops components work just fine, which means that bootstrap installation is as per the guide you have linked, and is successful. This issue is only regarding nested Hops components.

Adding below the log-rhino-compute from testing GH-C. As the response code is 200, the response is successful. But there is no output from the nested Hops Component

2025-01-27 12:34:08.898 +00:00 [INF] Rhino compute started at 1/27/2025 12:34:08 PM
2025-01-27 12:34:08.961 +00:00 [INF] Initiliazing reverse proxy at 1/27/2025 12:34:08 PM
2025-01-27 12:34:08.961 +00:00 [INF] Spawn children at startup is set to False
2025-01-27 12:34:08.983 +00:00 [INF] Application started. Press Ctrl+C to shut down.
2025-01-27 12:34:08.984 +00:00 [INF] Hosting environment: Production
2025-01-27 12:34:08.985 +00:00 [INF] Content root path: C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\rhino.compute
2025-01-27 12:34:09.045 +00:00 [INF] HTTP GET / responded 401 in 39.4953 ms
2025-01-27 14:14:43.811 +00:00 [INF] Rhino compute started at 1/27/2025 2:14:43 PM
2025-01-27 14:14:43.917 +00:00 [INF] Initiliazing reverse proxy at 1/27/2025 2:14:43 PM
2025-01-27 14:14:43.917 +00:00 [INF] Spawn children at startup is set to False
2025-01-27 14:14:44.014 +00:00 [INF] Application started. Press Ctrl+C to shut down.
2025-01-27 14:14:44.015 +00:00 [INF] Hosting environment: Production
2025-01-27 14:14:44.017 +00:00 [INF] Content root path: C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\rhino.compute
2025-01-27 14:14:44.189 +00:00 [INF] HTTP GET / responded 401 in 122.7727 ms
2025-01-27 14:15:44.114 +00:00 [INF] Max concurrent requests = 1
2025-01-27 14:15:47.460 +00:00 [INF] HTTP POST /io responded 200 in 63087.2492 ms
2025-01-27 14:15:48.716 +00:00 [INF] HTTP POST /grasshopper responded 200 in 674.9418 ms
2025-01-27 14:16:08.768 +00:00 [INF] HTTP POST /grasshopper responded 200 in 342.7828 ms
2025-01-27 14:16:09.887 +00:00 [INF] HTTP POST /grasshopper responded 200 in 5.3119 ms
2025-01-27 14:16:44.091 +00:00 [INF] Max concurrent requests = 1
2025-01-27 14:17:44.155 +00:00 [INF] Max concurrent requests = 0
2025-01-27 14:17:56.322 +00:00 [INF] HTTP POST /grasshopper responded 200 in 144.4811 ms
2025-01-27 14:17:56.352 +00:00 [INF] HTTP POST /grasshopper responded 200 in 2.4510 ms
2025-01-27 14:17:56.387 +00:00 [INF] HTTP POST /grasshopper responded 200 in 3.0343 ms
2025-01-27 14:17:57.428 +00:00 [INF] HTTP POST /grasshopper responded 200 in 1.6200 ms
2025-01-27 14:17:57.462 +00:00 [INF] HTTP POST /grasshopper responded 200 in 2.9952 ms
2025-01-27 14:17:57.488 +00:00 [INF] HTTP POST /grasshopper responded 200 in 3.5107 ms
2025-01-27 14:17:58.381 +00:00 [INF] HTTP POST /grasshopper responded 200 in 2.6546 ms
2025-01-27 14:17:58.414 +00:00 [INF] HTTP POST /grasshopper responded 200 in 3.0020 ms
2025-01-27 14:17:58.439 +00:00 [INF] HTTP POST /grasshopper responded 200 in 2.8276 ms
2025-01-27 14:17:58.466 +00:00 [INF] HTTP POST /grasshopper responded 200 in 2.4502 ms
2025-01-27 14:17:58.503 +00:00 [INF] HTTP POST /grasshopper responded 200 in 2.4499 ms
2025-01-27 14:17:58.532 +00:00 [INF] HTTP POST /grasshopper responded 200 in 5.9079 ms
2025-01-27 14:17:58.558 +00:00 [INF] HTTP POST /grasshopper responded 200 in 3.5213 ms
2025-01-27 14:17:58.587 +00:00 [INF] HTTP POST /grasshopper responded 200 in 1.1539 ms
2025-01-27 14:17:58.612 +00:00 [INF] HTTP POST /grasshopper responded 200 in 2.1253 ms
2025-01-27 14:17:58.644 +00:00 [INF] HTTP POST /grasshopper responded 200 in 1.0781 ms
2025-01-27 14:17:58.667 +00:00 [INF] HTTP POST /grasshopper responded 200 in 1.4348 ms
2025-01-27 14:17:58.694 +00:00 [INF] HTTP POST /grasshopper responded 200 in 1.8263 ms
2025-01-27 14:17:58.716 +00:00 [INF] HTTP POST /grasshopper responded 200 in 0.8457 ms
2025-01-27 14:17:58.770 +00:00 [INF] HTTP POST /grasshopper responded 200 in 1.2988 ms
2025-01-27 14:17:58.797 +00:00 [INF] HTTP POST /grasshopper responded 200 in 2.2951 ms
2025-01-27 14:17:58.832 +00:00 [INF] HTTP POST /grasshopper responded 200 in 1.2833 ms
2025-01-27 14:17:58.857 +00:00 [INF] HTTP POST /grasshopper responded 200 in 2.2972 ms
2025-01-27 14:17:58.889 +00:00 [INF] HTTP POST /grasshopper responded 200 in 2.4119 ms
2025-01-27 14:17:58.926 +00:00 [INF] HTTP POST /grasshopper responded 200 in 1.3128 ms
2025-01-27 14:17:59.020 +00:00 [INF] HTTP POST /grasshopper responded 200 in 1.3949 ms
2025-01-27 14:18:44.197 +00:00 [INF] Max concurrent requests = 1

I see. Thank you for the clarification. That makes more sense now. The URL/credentials were supposed to be used in the RhinoComputeUser profile. So, logging into your VM using the RhinoComputeUser password, then following the steps I mentioned above for setting the URL and API key.
Have you double checked that the URL and API key are the same as the one that you’re using on your local machine when you send your request? I had a different user have a similar issue as the one you’re reporting and adding in the URL and API key was the solution for that. Let me continue to look into this on my end and see if I can repeat the issue. Thanks for your patience.

Thanks for understanding and helping us out. I have double checked the URL and API key entered in the RhinoComputeUser profile. Its still not solving. Could you look into this and let us know what we can do?

Hi @AndyPayne any luck with this?

I’m still trying to track it down. I’ve spent the last several days adding additional logging to find out why it isn’t working but I haven’t figured it out yet. I’m definitely still working on it though. Thanks for your patience.

1 Like

Got it thank you! Just wanted to ensure that this wasn’t an issue on our end. Will be waiting patiently for this.

Good news. I finally figured out the issue. In hindsight, the fix should have been fairly obvious… but it took me quite a while and a bunch of logging in order to figure things out.

First, I have pushed a new version of Hops/Rhino.Compute (0.16.20) to the package manager. This new version has much more robust logging and it’s been streamlined across all of the various projects (ie. Rhino.Compute, Compute.Geometry, and Hops). I would recommend logging into your VM and running the update script to update your version of Rhino.Compute on your VM to the latest version. I would also recommend adding (if you haven’t already done so) an environment variable on this machine called RHINO_COMPUTE_DEBUG and set the value to True. This will enable a more verbose logging to occur which could help troubleshooting in the future. Then restart your VM.

Secondly, I would then log into your VM under the RhinoComputeUser profile and launch Rhino and the package manager. I would recommend updating your installation of Hops to use the latest version of the plugin (0.16.20). While you’re doing this, make sure that the URL in the Hops preferences still matches the URL you’re using when sending a request to your VM (same instructions as before). Also, double check to make sure your API key is correct. These two things still need to be in place to get the nested Hops definitions working. Once, you’ve done all of that, I’ll explain what the actual fix is in order to get nested Hops definitions working.

The key piece that I was missing is that file path for your nested definition needs to be able to be found on your remote VM. For example, you had a file called GH-B.gh and inside of that you had a Hops component pointing to another file (somewhere on your local computer) a file called GH-A.gh. When I was testing, the location of GH-A.gh was C:\Users\username\Downloads\GH-A.gh. However, when this file was deserialized on the remote VM and it went to look for this file at that location, it couldn’t find it. Now, there was a silent bug that I found (and fixed) which was not telling you that it couldn’t find this file. Instead, nothing happened which is why it was so hard to uncover why it wasn’t working.

So, the fix here is to go to your local machine and reassign the Hops component inside of GH-B.gh (ie. the one pointing to GH-A.gh) to a file that can be found on your remote VM. For example, I created a directory on my local machine called Rhino Compute Files at this location C:\Users\Public\Rhino Compute Files. I then logged into my remote VM and created a directory at this same location. Inside of this directory, I copied the GH-A.gh file. Now, when you open GH-C.gh, it will send the request containing the file GH-B.gh. When compute deserializes this file, it will detect a Hops component pointing to the GH-A.gh file located in your C:\Users\Public\Rhino Compute Files directory. It will find it, and proceed to make the appropriate calls to make the proper computations.

So ultimately, the issue came down to rhino.compute not being able to find the file of the nested Hops definition. The improved logging in the latest build of rhino.compute also helps troubleshoot this issue. Please test this on your end and let me know if this works for you.

2 Likes

Thank you @AndyPayne ! this seems to have solved the issue.

Also, appreciate the more detailed error logging on the hops component as well, this will help us speed up developing Hops scripts. I had noticed that when a Hops component failed it would not always show me where the error was happening and I’d have internalize data and go to the Hops script to figure out what the issue was.

Great to hear. I’m glad its working for you.