Bug #29667 Error is NOT reported in GUI when scheduling rule with invalid DC item
Submitted: 9 Jul 2007 23:56 Modified: 11 Jul 2007 1:57
Reporter: Andy Bang Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Server Severity:S2 (Serious)
Version:1.2.0.6506 OS:Any
Assigned to: Joshua Ganderson CPU Architecture:Any

[9 Jul 2007 23:56] Andy Bang
Description:
An error is NOT reported in GUI when scheduling a rule with an invalid data collection item.

I think this is a server bug, but could be a GUI bug.

How to repeat:
1) Schedule the "XA Distributed Transaction Support Enabled For InnoDB" rule against a 4.x server.
2) The GUI popup does not report an error even though the rule uses the innodb_support_xa variable that isn't available until 5.0.x.
3) Go to Settings->Logs and look in the AgentTasks log.  You'll see the following:

Information Jul 9, 2007 4:49 PM Andys Laptop 4.1 (453cf17a-a5de-4053-92fe-e8d23d59ef12): attrib is unknown: mysql::server->innodb_support_xa 
Warning Jul 9, 2007 4:49 PM Terminating unsupported data collecton: attrib is unknown: mysql::server->innodb_support_xa 

Suggested fix:
Show the error in the GUI like we used to.
[10 Jul 2007 0:45] Joshua Ganderson
Sounds like something I should review before passing the buck to the server team.
[10 Jul 2007 1:09] Joshua Ganderson
It looks as though we stopped throwing an error during the schedule process and started returning a ScheduleAndWarnings object that contains an Exception collection. While in the process of updating the UI to accommodate this change, I noted that the exceptions returned were no longer particularly useful. Instead of getting an error about not being able to schedule a particular data collection on a rule, I instead just get a bunch of NPE's on 221 of Schedule. However, this exception may not be the invalid DC item exception.

I'll update the UI if someone can investigate the NPE's and let me know how this is supposed to work now.
[10 Jul 2007 10:15] Eric Herman
Perhaps the php layer used to do something with throwing this exception? Looking back at the 1.1 branch, it looks like we've used "ScheduleAndWarnings" for quite some time.

from "MonitorCommandProcessor" in the br_4788_1.1.0_beta1

    private String createMonitorSchedule(Map<String, String> parameters) {

        final String scheduleXML = parameters
                .get(Merlin.SERVLET_MONITOR_SCHEDULE_XML);

        final Schedule schedule = Schedule.fromXml(monitorService
                .getMonitorDb(), scheduleXML);

        final ScheduleAndWarnings saw = monitorService
                .scheduleMonitorTransaction(schedule, true);

        return SerializedXML.toXMLWithHeader(str, saw.schedule);
    }

Regardless, NPEs aren't very useful, so I'll see if we can easily get more useful error messages in there.
[10 Jul 2007 11:25] Eric Herman
Hopefully this will give the UI what it needs.

Also, let's attach any NPE stacktraces to the bug if we are see any more of them.

svn commit -m "BUG#29667, protecting againgst NPE in Schedule and making UnsupportedItems the first exception in list"
Sending        WEB-INF/src/com/mysql/merlin/server/inventory/dao/ServerEntry.java
Sending        WEB-INF/src/com/mysql/merlin/server/monitors/dao/Schedule.java
Transmitting file data ..
Committed revision 6522.
[10 Jul 2007 17:50] Joshua Ganderson
R6537 - While I couldn't easily replicate this error, I believe I have addressed it on the UI side and Eric has completed addressing the NPE safety issue that was blocking me.
[11 Jul 2007 1:57] Bill Weber
Verified fixed in build 1.2.0.6550.