Version: 8.3.1
I have a Scheduled job in a project which runs every 10 minutes to build reports on the gateway, calling system.report.executeReport in a script.
This works fine except when the server is restarted in which case the job tries to run a few seconds after the gateway starts up and I start seeing the following error when calling this function:
NullPointerException: java.lang.NullPointerException: Module "com.inductiveautomation.reporting" not found.
After another 10 minutes the job runs again and executes without error. This is not fatal, as I can change the schedule, but I wanted to report it.
Probably not going to be fixed, as Ignition is (deliberately) extremely parallelized.
Consider examining the system state in your startup script and deferring (via a background thread) if the system state is not yet running. See the tag provider caching functionality in my Tag Report utility in the exchange for an example.
Can you/have you already reported this via support?
I'm not as confident as Phil that this can't/won't be fixed, and either way it's a poor failure mode - we could at least throw a more descriptive error if we can't actually catch this.
Tough to be more precise with a reporting-specific message when you cannot even get a reference to the module. 
Perhaps it's possible, but doesn't strike me as simple.
It looks like a fairly standard race condition - initializeScriptManager has run (otherwise it'd be an AttributeError on system.report) but somewhere internally in the body of executeReport the function is expecting the module to exist and it doesn't.
If we can't/don't fix it with a lifecycle/startup ordering change (which I concede is possible and even likely, there be dragons), then at some layer we could at least catch the NPE and present it more nicely.
1 Like