Bug #42005 Service Manager does not handle master_ip fails from agent
Submitted: 9 Jan 2009 19:47 Modified: 2 Mar 2009 17:47
Reporter: Diego Medina Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Monitor: Server Severity:S3 (Non-critical)
Version:2.0.1.7125 OS:Any
Assigned to: MC Brown CPU Architecture:Any

[9 Jan 2009 19:47] Diego Medina
Description:
Somehow I was able to send invalid data using the agent to the service manager and now the service manager does not restart.

On the logs I see

===========
2009-01-09 14:39:50,472 ERROR [main:org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'serverConnectionMonitor' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Unsatisfied dependency expressed through constructor argument with index 2 of type [com.mysql.etools.monitor.bo.Manager]: Error creating bean with name 'manager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is com.mysql.etools.monitor.pom.UnsupportedAttributeException: 101c6b5b-15eb-49aa-916c-843c51b28d38: mysql.slavestatus.Master_ip
======================

I'll attach the full log and backup of the mem database.

How to repeat:
1- Use attached backup of the mem database
2- restart your service manager
3- Look at the service manager log
[9 Jan 2009 19:48] Diego Medina
service manager log

Attachment: mysql-monitor.log (application/octet-stream, text), 28.39 KiB.

[15 Jan 2009 20:49] Darren Oldag
it was previously assumed that the agent would *never* send a slave status object without a master_ip, even if that master_ip was null.  in other words, master_ip was assume to be 'supported' on the service manager side.

well, in the case of a weird master_host that the agent cannot resolve into a master_ip, the agent will *not* send master_ip as a supported item, thus wreaking havoc on service manager assumptions and object wiring.

the fix will be to handle the case where we get a slave status report with no master_ip, as this is found to be a valid use case.

(AND, as the first bug topic pointed out, this results in the service mgr not being able to even restart)
[15 Jan 2009 21:03] Darren Oldag
made it possible to always listen on a master_ip, even if initially reported
as not-supported.  

made the "i am a real slave" check use master_host, master_ip, AND master_port
so that setting master_ip to supported won't mess up the slave support logic.

patch pushed to trunk.  awaiting review for decision on inclusion into 2.0 maintenance, or 2.1 release.
[26 Feb 2009 22:45] Diego Medina
Verified fixed on 2.0.5.7146
[2 Mar 2009 17:47] Tony Bedford
An entry was added to the 2.0.5 changelog:

The Service Manager did not handle the case where the agent failed to supply a valid master_ip. The Service Manager would then not restart. The logs contained the following:

2009-01-09 14:39:50,472 ERROR [main:org.springframework.web.context.ContextLoader] Context
initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with
name 'serverConnectionMonitor' defined in ServletContext resource
[/WEB-INF/applicationContext.xml]: Unsatisfied dependency expressed through constructor
argument with index 2 of type [com.mysql.etools.monitor.bo.Manager]: Error creating bean
with name 'manager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]:
Invocation of init method failed; nested exception is
com.mysql.etools.monitor.pom.UnsupportedAttributeException:
101c6b5b-15eb-49aa-916c-843c51b28d38: mysql.slavestatus.Master_ip