Rhino 8 Hops/Compute Issues

Hi everyone!

I’m testing hops 16.2 with Rhino 8. The compute server works fine, until I use C# script on my canvas, as on the picture:


When I use this gh script with hops, it throws a timeout after 100s.

Blockquote
[12:36:23 ERR] Connection id “0HMTLQSBBBPQA”, Request id “0HMTLQSBBBPQA: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.

Scripts without any C# work just fine:

My end goal is to load a .gtlf file (with a new Rhino 8 loader) and postprocess geometry. I wanted to follow this apporach: Pass RhinoDoc to Grasshopper in a C# Plugin hosted by Rhino.Compute

Any ideas what can cause this issue? :slight_smile:

I have the same issue with the script component. It seems it doesn’t work for both python 2 and 3. Any update on the topic?

Hi there, I was about to create a new ticket for this. Here is additional input for troubleshooting.
I guess @AndyPayne we would need your help to troubleshoot this.

So it seems something is wrong when calling python scripts within hops. Any idea how we could troubleshoot this ?

Here are grasshopper files for reproduction :
test_python_hops.gh (5.3 KB)
test_request.gh (2.7 KB)

Hi,

Another information, I could execute Python3 script just fine on the remote rhino.compute server using Remote Desktop Connection. So it only really happens when the python script is part of a .gh definition sent via hops to rhino.compute.

@Laoky This issue is resolved for the next version of compute.

For referernce:
COMPUTE-268 Ensure RhinoCodePlugin is loaded in Rhino 8 Compute

1 Like

Hi @Laoky As Ehsan mentioned, this issue was fixed yesterday in some changes with how Rhino.Compute handles loading the scripting plugins. In order to get this to work on your end, you will need to log into your VM (as Administrator) and then run the powershell script to update your version of Rhino.Compute to the latest nightly build. To do this, follow the instructions here. The actual powershell command that you need to run is copied below for convenience.

iwr -useb https://raw.githubusercontent.com/mcneel/compute.rhino3d/8.x/script/production/module_update_compute.ps1 -outfile update_compute.ps1; .\update_compute.ps1 

Now, I believe you already have Rhino 8.3 installed on your machine and I believe that is sufficient in this case… but I am unclear as to when the language specific scripting components were added to Grasshopper (either 8.3 or 8.4). What I mean by language specific components is that it appears you are using the dedicated Python scripting component in your grasshopper definition. You can use the regular scripting component and simply set the language to Python and it should work the exact same. The regular scripting component has been available since 8.0… So, if you see a message in hops/compute that says “Missing GH Components”… this is likely because your installed version of Rhino doesn’t yet have the language specific components yet. The solution to this error message in this case is:

  • Modify your Hops grasshopper definition and use the regular scripting component (set to Python) rather than the language specific version of the scripting component.
  • Wait until the first stable release of Rhino 8.4 is released and then run the Update Rhino powershell command that is outlined in the guides.

Again, you might not even run into this issue as I wasn’t able to determine exactly when those language specific components were added… but I do include the information here for others who might run into this issue.

1 Like

Thanks a lot @AndyPayne and @eirannejad for your quick reply, we really appreciate it ! I will give it a try

1 Like

Hi there,

So, yes, after following your instructions it works just fine.
Thanks again for the quick fix and the support :100:.

2 Likes

Hi All,
i was able to solve the problem for my python scripts thanks to Andys explanation. Thanks for this!! I still get the language error when using c# language specific component or the script component with c# selected. I have the new Version 8.5 installed Did i miss anything? Attached my testfile:


ctest.gh (7.2 KB)

I fixed a bug in the latest build that might be related to this. I’ll send you a link

Hi Ehsan,
thanks for your great help, it works!

Hi @AndyPayne ,
I tried to use the path you suggested though I got this error:(
Is there any way to fix this?

.\update_compute.ps1 : File C:\WINDOWS\system32\update_compute.ps1 cannot be loaded because running scripts is
disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:145

  • … _update_compute.ps1 -outfile update_compute.ps1; .\update_compute.ps1
  •                                                  ~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : SecurityError: (:slight_smile: , PSSecurityException
    • FullyQualifiedErrorId : UnauthorizedAccess

@Kamil_Kaptan1 You’d need to set the execution policy in powershell:

Set-ExecutionPolicy remotesigned

Hi @eirannejad ,
Now I got this as a result. I am assuming running the bootstrap script is explained in the link above and gonna try it tomorrow. It looks a bit complicated but hopefully, I’ll make it. Thanks for the reply, I appreciate it.

# # # # # # # # # # # # # # # # # # #

U P D A T E

R H I N O . C O M P U T E

S C R I P T

# # # # # # # # # # # # # # # # # # #

The rhino.compute or compute.geometry executable file could not be found.
Please run the bootstrap script first!
PS C:\WINDOWS\system32>

Yes. I believe that you need to run the two bootstrap scripts first. In fact, you shouldn’t need to run the script you’re currently trying to run after you run the bootstrap scripts because it will install the latest versions of everything that you need. The guide is very detailed so it should be pretty straightforward but please let us know if you run into any errors. You will need your core-hour billing auth token before you proceed so make sure you read the prerequisites section before you run the bootstrap scripts.

Yes, @AndyPayne I will let you know if I encounter any problem. Thank you for the information.

Hi @AndyPayne @eirannejad , I wanted to debug on my local machine rather than spamming our remote instance. It seems the same issue with the python scripts not being supported happens on my local. Not sure how I can remediate, as the compute instance is started automatically by Hops, I imagine Hops component would require an update and last release was in November 2023. Any thoughts on this ?

I also tried downgrading some script components to “Script” instead of “Python 3 Script”. It also does not work somehow.

image
image
image
image

I can issue a new release of Hops later today.

3 Likes

@Laoky Please test the lastest Hops Andy publishes and tag me if the issue persists.