Named query failing on gateway scripting project

A bit of a strange one... we have a button script which calls a named query, and so far has been working successfully for some time.

Recently it has been failing and returning the follow error:

Error running action 'component.onActionPerformed' on Reporting/LotPackReports@C/root/Buttons/GenerateSPCReports: Traceback (most recent call last): File "<function:runAction>", line 103, in runAction at com.inductiveautomation.ignition.gateway.script.GatewayDBUtilities.interpretWithOptionalProject(GatewayDBUtilities.java:476) at com.inductiveautomation.ignition.gateway.script.GatewayDBUtilities.runNamedQuery(GatewayDBUtilities.java:391) at jdk.internal.reflect.GeneratedMethodAccessor936.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Project name required for script execution: the Gateway Scripting Project is not set.

It's strange because the gateway scripting project is set, always has been, nothing has changed here. Also, I would have thought gateway scripting project would not be relevant in perspective session scope? I have confirmed that the named query still exists and is receiving the correct parameters.

groups = system.db.runNamedQuery('Recipe/GetRecipeGroupsForOp',{'itemNumber':itemNumber,'operation':cell})

We are running 8.1.25 - I realise this is somewhat old now but it's difficult to get the opportunity to update at this client site.

There are many, many other named queries in this project which are presumably working otherwise the whole system would have ground to a halt.

I have just been alerted to this thread, seems like a known bug.

Workaround for now just to add project name I guess.

2 Likes

I have just started experiencing this issue as well. Never had a gateway scripting project set, so default value of null. Now I get the same error when trying to run a report. More specifically, it's affecting my script that calls the system.report.executeAndDistribute function, which has always worked up until yesterday.