generateMetaPointHistory causes ERROR on LOG.debug()
-
In ma-core 2.8.8 I could not get the Generate History function to work on my script when there were debug logging function calls in the script.
generateMetaPointHistory causes ERROR on LOG.debug() even if log level is "None" in metadata script. No error messages were shown on the web interface. The history generation simply did not work. It was puzzling because the function worked, and other metadata history generation worked. Once I remembered to check ma.log, I found the problem:
2018-01-31 18:37:55,871 ERROR (com.serotonin.m2m2.meta.JavaScriptPointLocatorRT.executeImpl:54) - Big Cistern Leak Rate : TypeError: null has no such function "debug" in <eval> at line number 157 in <eval> at line number 157 javax.script.ScriptException: TypeError: null has no such function "debug" in <eval> at line number 157 in <eval> at line number 157 at com.serotonin.m2m2.rt.script.ScriptExecutor.prettyScriptMessage(ScriptExecutor.java:157) at com.serotonin.m2m2.rt.script.CompiledScriptExecutor.execute(CompiledScriptExecutor.java:83) at com.serotonin.m2m2.meta.JavaScriptPointLocatorRT.executeImpl(JavaScriptPointLocatorRT.java:50) at com.serotonin.m2m2.meta.MetaPointLocatorRT.execute(MetaPointLocatorRT.java:302) at com.serotonin.m2m2.meta.MetaPointLocatorRT$ScheduledUpdateTimeout.run(MetaPointLocatorRT.java:210) at com.serotonin.timer.TimerTask.runTask(TimerTask.java:148) at com.serotonin.timer.TimerTask.run(TimerTask.java:119) at com.serotonin.timer.SimulationTimer.fastForwardTo(SimulationTimer.java:53) at com.serotonin.m2m2.meta.MetaEditDwr.generateMetaPointHistory(MetaEditDwr.java:284) at sun.reflect.GeneratedMethodAccessor24392.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34) at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428) at com.serotonin.m2m2.web.dwr.util.TranslationsFilter.doFilter(TranslationsFilter.java:37) at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428) at com.serotonin.m2m2.web.dwr.util.ExceptionDetectionFilter.doFilter(ExceptionDetectionFilter.java:26) As a work around, I had to comment out all LOG.debug() calls from my script.
core 2.8.8 build 635 - paid
-
Hi Pedro,
Thanks for bringing this to our attention! I have fixed this in the next version of the module, 3.3.2
-
Thanks, that was quick. Is this in the core? If not, what is the module name?
-
The bug was in the Meta module. I didn't put it in the store yet, nor did I backport to the 2.8 Meta module.