Hops is giving error while launching GH script on compute

Hi,

I am getting below error on whenever I am launching my GH script on ec2 machine with administrator login. surprisingly same gh script is running fine in RhinoComputeUser. The reason I am doing this on ec2 machine is to debug why my compute response is failing when the same GH script works fine on my local machine and on local compute call.

Can someone please help, I need to make it work ?

Thanks and regards,
Shivam

@AndyPayne

can you please help me out here ? I am not able to understand this issue. Again today I installed the dependencies from the scratch and make this GH script work on administrator which in results working from my postman as well. But after sometime same issue occur the one attached in snapshot above. I would really appreciate if you could guide me with this.

Regards,
Shivam

Do you have Hops installed on the VM (in administrator mode)? What about on your local machine? Can you attach the file you’re trying to use so I can troubleshoot on my end?

Hi Andy,

Thanks for getting back.

Unfortunately, I won’t be able to share the actual files due to data sensitivity policies. However, I can explain the structure:

The main Grasshopper file we are running includes multiple Hops components, each of which calls other individual .gh files. These nested .gh files themselves may also use Hops, making it a sort of recursive Hops calling structure.

This setup works fine on my local machine and on EC2 when using the RhinoComputeUser profile (which sometimes doesnt works). However, when I try the same from an Administrator user on EC2 (which work fine for sometime and then fails), I intermittently face issues—even after fresh installations of all dependencies.

I can share the logs though
compute logs.txt (1.9 KB)

Thanks and regards,
Shivam

Hi @AndyPayne ,

I made one similar structure GH script and recreated the issue on ec2. If you could troubleshoot this then I think we can use same solution for our original GH file as well. Please find the attachment and run HopsTest_sum minus 1.gh

HopsTest.7z (12.0 KB)

thanks and regards,
Shivam

I haven’t had a chance to test your script yet, but I think I may know what the issue might be. When you log into your VM as RhinoComputeUser and go to the Grasshopper preferences dialog… what do you have set as your Hops URL? Your URL section needs to use the URL for your main server (ie. what you would use if you’re trying to send a definition to your VM from a remote machine). For example, if you normally would put the URL in as http://52.168.38.105:80/, then you need to use that same URL in the Hops preferences section when you’re logged in as RhinoComputeUser. You also need to supply the same API Key (again in the Hops preferences section) that you are using on your VM. Lastly, all paths to nested definitions need to be full paths and exist. If you’re using a URL as your path, then you should be fine because it can pull this from any instance… But, if you’re using a local path from your remote machine, the same path needs to be accessible from the VM. There’s a more thorough breakdown of this issue which you can read about here. Anyway, if you check those three things, then I’m hopeful that we can get this working for you.

It worked after putting IP address of VM in hops preferences thanks @AndyPayne. Just curious if we make custom endpoint and invoking that endpoint from my web-app or postman why and how it is should only work if we put an IP of the VM in Hops preferences ?. Also If I have to scale the VMs dynamically can we set the IPs from any config file because manually it is not possible to put it in hops preferences whenever new VM is launched.

For nested definitions, the Hops component looks to the stored URL for where to send the request to the server. If it is blank, then it automatically spins up a new server instance and uses that one. But when you’re using a VM, this fails and you need to specify to use the main server instance that all requests are routed through. Hopefully that makes sense. I’ll need to do some thinking about the scaling issue. I’ll try to get back to you with a solution.