Named queries not found from gateway scripts

named queries not found from gateway scripts

Caused by: org.python.core.PyException: Traceback (most recent call last): File “”, line 1, in File “”, line 56, in getMissingMinutes at com.inductiveautomation.ignition.gateway.project.ProjectManagerImpl.executeNamedQuery( at com.inductiveautomation.ignition.gateway.db.namedquery.NamedQueryGatewayRpc.execute( at com.inductiveautomation.ignition.gateway.db.namedquery.NamedQueryGatewayRpc.execute( at com.inductiveautomation.ignition.gateway.script.GatewayDBUtilities.runNamedQuery( at sun.reflect.GeneratedMethodAccessor100.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) java.lang.Exception: java.lang.Exception: Project “MissingMinutes” not found.

So this is working from the Tools/Script Console
But from a Gatway Event Script, not at all.

What would be the reason for that one?

If you execute from gateway scope you need to include the project name:


This is already what I am doing

	namedQuery = "MissingHours"
	parameters = {"siteName":siteName,"startDate":lastCheck}
	table = system.db.runNamedQuery("Axium",namedQuery, parameters)

Maybe I need a folder name for the Query name?
Not sure what that would be?

This is for a named query called MissingHours. Are you trying to execute a named query called MissingMinutes somewhere else, perhaps line 56 of a script called getMissingMinutes? Post that part instead.