Description of problem: Second invocation of agent configuration (e.g. in case of incorrect server url) adds duplicated element (<subsystem xmlns="urn:org.hawkular.agent:agent:1.0") and eap fails to start. Version-Release number of selected component (if applicable): mm DR04 eap7-middleware-manager-agent-0.29.3-1.Final_redhat_1.1.ep7.el7 How reproducible: Always Steps to Reproduce: 1. install EAP 7 (yum groupinstall jboss-eap7) 2. install hawkular wildfly agent (yum install eap7-middleware-manager-agent-0.29.3-1.Final_redhat_1.1.ep7.el7.noarch.rpm) 3. configure the agent: export JBOSS_HOME=/opt/rh/eap7/root/usr/share/wildfly/ java -jar ${JBOSS_HOME}/bin/hawkular-wildfly-agent-installer.^Cr --target-location=${JBOSS_HOME} --server-url=http://hawkular.bc.jonqe.lab.eng.bos.redhat.com:8080 --username=jdoe --password=password --config-only=true 4. start eap 5. stop eap 6. configure the agent again with different server: java -jar ${JBOSS_HOME}/bin/hawkular-wildfly-agent-installer.^Cr --target-location=${JBOSS_HOME} --server-url=http://hawkular-new.bc.jonqe.lab.eng.bos.redhat.com:8080 --username=jdoe --password=password --config-only=true 7. start eap Actual results: After step 4 everything is ok. After step 7 the eap fails to start with: Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[817,9] Message: WFLYCTL0069: Duplicate subsystem declaration The duplicated element is <subsystem xmlns="urn:org.hawkular.agent:agent:1.0" Expected results: It should be possible to update agent configuration. Additional info:
You can't run the installer twice on the same server. The installer is meant to install the agent in a server that doesn't have an agent. If it already has an agent, it is not valid to run the installer on it again. The installer isn't meant to update or change an existing agent's configuration. If you run the installer twice on the same server, bad things happen (like this BZ shows). If you want to update the agent configuration (which is what this BZ wants to do) there are two ways: 1) if the server is running, use the JBoss CLI to do it (to change the server URL like this BZ wants to do, you would modify the "hawkular" outbound server socket binding.) You will then have to restart the server. Note: if you want to use the CLI and the server is not running, just start the server in admin-only mode, run the CLI, then you can shut the server down again. Something like this: ==== # if the server isn't running yet, start it in admin-only mode $ standalone.sh --admin-only # update the agent configuration - here I change the hawkular server URL the agent uses $jboss-cli.sh --connect '/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=hawkular/:write-attribute(name=host,value=your.new.hawkular.server.hostname)' # You can run additional CLI commands to change any other agent configuration settings you want to update. # at this point you can shutdown the server and restart it in normal (non-admin-only) mode ==== 2) if the server is not running, (and for this BZ is it not running - step 5 shuts it down) just edit standalone.xml's outbound server socket binding element with your new setting. Or, like I mention above, you can start the server in admin-only mode and use the CLI.
Is it possible to insert a test for an agent config in the script and if a config is found, exit with a message saying that a configuration exists and modifications should be made through the mgmt APIs?
(In reply to John Doyle from comment #3) > Is it possible to insert a test for an agent config in the script and if a > config is found, exit with a message saying that a configuration exists and > modifications should be made through the mgmt APIs? Yes, we can add a test inside the installer... if (agent is already installed) then print "The agent is already installed. Installer will abort" exit end if
That would satisfy me.
(In reply to John Doyle from comment #5) > That would satisfy me. Added JIRA to address this: https://issues.jboss.org/browse/HWKAGENT-168
(In reply to John Mazzitelli from comment #6) > (In reply to John Doyle from comment #5) > > That would satisfy me. > > Added JIRA to address this: https://issues.jboss.org/browse/HWKAGENT-168 This has been implemented and merged into master: https://github.com/hawkular/hawkular-agent/pull/324
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.