Compute Grasshopper issue - Null ReferenceException

Hi @will, I regularly use the ChopChop component in my grasshopper scripts.

However, Rhino.Compute throws a NullReference exception for this component:
Attached is a simple script to reproduce the error message:

System.NullReferenceException: Object reference not set to an instance of an object.
at ChopChop.ChopChopComponent.SolveInstance(IGH_DataAccess DA)

The script runs just fine on my local desktop.
If I remove the ChopChop component then it runs fine on Rhino.Compute.
(I should point out that on the server the ChopChop gha file is correctly installed and if I remote on to the server I can manually run the script via Rhino Grasshopper. I also added a package (v6 and v7) for the ChopChop component using the package manager just in case Compute needed to download it on demand. None of these actions has made any difference).

Is this likely to be some esoteric issue in the code in the chopchop component that its author should address or is there some general issue at play here - how do i identify or screen out components that will cause issues in Compute context? - is it a case by case process as and when they are found to be problematic? (12.2 KB)

Hi @MonkeyFace. So, this works fine if you run it locally, or if you remote into your VM and run it locally there… but if you send a file from your local computer to a remote VM then it fails, is that right?
Can you tell me a little bit about how you set up your VM? Did you set it up using this guide? Or are you using some custom setup? I only ask because we ran into this issue when I was setting up IIS and it wasn’t able to find certain 3rd party plugins. The workaround we came up with was to create a new “user” called RhinoComputeUser which gets created when running the bootstrap script. IIS uses this profile when it runs rhino.compute.exe and so it’s looking in that user’s AppData/Roaming/etc folder to look for plugins. If you’ve installed your 3rd party plugins using your Admin account for the VM, then it wont look in that users folder when it runs rhino.compute.exe and thus this might be why it’s failing.

When you run the bootstrap script, when it’s completed, it will print to the console the RhinoComputeUser’s account information (user name and password). It’s recommended to write those down and save them somewhere secure so you can log back in later in case you need to install some plugins. So, the two options I see are:

1.Retrieve the password for the RhinoComputeUser account on your VM and then login using those credentials and reinstall chop-chop.
2. Copy/Paste the chop-chop.gha file to the C:\Program Files\Rhino 7\Plug-ins\Grasshopper\Components directory. This will automatically load any plugins regardless of the user profile.

Note: It is strongly recommended to use option 1 over option 2. Option 2 is really only supposed to be used for standard GH components (not third party plugins). It will work, but option 1 is really the better method.
Let me know if this helps.

Looks like you’ve described exactly our situation…

NO i didn’t use the ISS setup you linked. We have a custom setup with Compute running as a process rather than a service and using an ISS url-rewrite rule to forward inbound traffic to Rhino.Compute’s local port number (5000 i think?) .

When the linked article was published I attempted to start over again and followed its guidance. However I ran into difficulties and rolled back to my previous setup.

wasn’t able to find certain 3rd party plugins.

Does it also cause issues with any of the standard components? For example this really simple script won’t run in our Compute environment despite working in desktop Rhino on the VM.

Adding logging shows that the MemberIndex component is the component that is failing as it is returning null . Compute’s console also indicates a Missing Definition object:

Any idea if this is related to our server setup too? (11.7 KB)

I think something must be wrong with your server setup. I downloaded your file and tried to run it locally and I got some weird behavior (ie. it created two outputs even though there was only one group with RH_OUT in the file). So, I replaced all of the groups with RH_OUT and RH_IN with their proper contextual components and this time it worked as expected locally. I then tried sending it to a VM I had setup (using the guide I mentioned above) and it worked as well. So, I’m guessing there’s something off with how your running rhino.compute. Any chance you could try giving the guide another try (maybe on a test VM)? (11.4 KB)

Thanks Andy - i’ll have to take another look at the setup i guess.

(I don’t understand why you got different behaviour (locally) for RH_IN/OUT groups versus contextual components - do you have a theory?)