Bug #30753 NPE in Advisor Log after updating from 1.1 to 1.2 with an advisor scheduled
Submitted: 31 Aug 2007 23:41 Modified: 8 Jul 2009 18:20
Reporter: Bill Weber Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Server Severity:S3 (Non-critical)
Version:1.2.0.7355 OS:Any
Assigned to: Eric Herman CPU Architecture:Any
Tags: mer 121

[31 Aug 2007 23:41] Bill Weber
Description:
After updating from 1.1.1 (5780) to 1.2.0 (7355) where at least 1 rule was scheduled in 1.1.1, there is are 3 NPEs in the Advisor Log with the following stack trace:

java.lang.NullPointerException at com.mysql.merlin.server.inventory.dao.ServerEntry.getScheduleAndEnsureTask(ServerEntry.java:432) at com.mysql.merlin.server.inventory.dao.ServerEntry.schedule(ServerEntry.java:417) at com.mysql.merlin.server.monitors.MonitorService.scheduleNewCollects(MonitorService.java:194) at com.mysql.merlin.server.monitors.MonitorService.importMonitor(MonitorService.java:557) at com.mysql.merlin.server.monitors.MonitorService.importAdvisors(MonitorService.java:322) at com.mysql.merlin.server.monitors.MonitorService.init(MonitorService.java:83) at com.mysql.merlin.server.ServiceMgr.createServices(ServiceMgr.java:331) at com.mysql.merlin.server.ServiceMgr.<init>(ServiceMgr.java:145) at com.mysql.etools.ApplicationFactory.initApps(ApplicationFactory.java:29) at com.mysql.etools.ApplicationFactory.getApplicationService(ApplicationFactory.java:55) at com.mysql.merlin.server.MerlinServlet.init(MerlinServlet.java:64) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022) at org.apache.catalina.core.StandardHost.start(StandardHost.java:736) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:448) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:552) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)

How to repeat:
- install a 1.1.1 agent and service manager
- start the 1.1.1 agent and service manager
- schedule at least 1 rule against the server (doesn't matter which one or if more than 1)
- stop 1.1.1 agent
- update the service manager to 1.2
- re-start tomcat/mysqld and launch dashboard in browser
- go to Settings tab, Logs page, Advisor Log
| should see the 3 NPEs right before "MonitorService started" entry
[1 Sep 2007 0:56] Darren Oldag
The schema 1.1.1 dump that we have for migration tests exhibits the problem when imported, and then starting the service manager.

It appears like the imported monitors have items that are not "real" yet (no item_id from the database, just the namespace.type.attribute info filled in), and our detection for seeing if the schedule already exists is based on having a real item_id.
[8 Jul 2009 11:03] Enterprise Tools JIRA Robot
Eric Herman writes: 
I think this issue is way out-of-date given the references to v1.1 and to SVN in the notes (not BZR).

I think this issue can be closed, but if not, perhaps it should be re-formulated for the modern day.
[8 Jul 2009 11:05] Enterprise Tools JIRA Robot
Eric Herman writes: 
moved to "available in build" because it's either done, and needs to be closed or it needs to be rephrased for current system.
[8 Jul 2009 18:20] Enterprise Tools JIRA Robot
Bill Weber writes: 
not currently relevant