Message: "Failed to resolve host '127.0.0.1 10.33.63.237': Failed to create URI" when updating JBoss ON to 3.2.3

Solution Verified - Updated

Environment

  • Red Hat JBoss Operations Network (JON) 3.2.0 GA
  • File rhq-server.properties contains commented out jboss bind address like in the following example:
...
    jboss.bind.address=10.33.63.237
 
    # By default only local management connections 
    #jboss.bind.address.management=127.0.0.1
    jboss.bind.address.management=10.33.63.237
...

Issue

$ ./apply-updates.sh  /opt/jboss/jon-server-3.2.0.GA
        Successfully detected server [/opt/jboss/jon-server-3.2.0.GA] to be upgraded. Proceeding...
        Proceeding with application of patch '03' to /opt/jboss/jon-server-3.2.0.GA
        Successfully detected agent [/opt/jboss/rhq-agent] to be upgraded. Proceeding...
        Proceeding with application of patch '03' to /opt/jboss/rhq-agent
        Verifying that all [Server] component(s) are stopped...
        Successfull verified that [Server] is already shut down.
        Archiving legacy files. This list is cumulative and may attempt to remove files handled by earlier updates.
        Moving the following files to [./.old] for server and/or [./.old-agent] for agent:
        See './update.log' for more archive details.
        Applying the update contents.
        Applying additional JON Server updates...
        Starting JON Server...
        Starting JBoss CLI and applying patches...
org.jboss.as.cli.CliInitializationException: Failed to connect to the controller
        at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:280)
        at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:240)
        at org.jboss.as.cli.CommandLineMain.main(CommandLineMain.java:34)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.jboss.modules.Module.run(Module.java:270)
        at org.jboss.modules.Main.main(Main.java:411)
Caused by: org.jboss.as.cli.CommandLineException: Failed to resolve host '127.0.0.1
10.33.63.237': Failed to create URI
        at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:796)
        at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:766)
        at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:278)
        ... 8 more
        Stopping the JON Server...

        You have successfully extracted patch contents into (JON server) and/or (JON agent) installation folder(s).
        You should do the following as is necessary:
         i)Closely follow the remainder of the instructions delivered with this update.
         ii)restart your server(s)*
         iii)restart agents and request agent updates
        *NOTE: for HA environments you may need to repeat the steps here for each server before patch application is complete.

Resolution

This is a bug and it has been captured in the This content is not included.RH Bugzilla 1152965.

As a workaround, start JBoss ON Server and run the following jboss-cli command directly:

<RHQ_SERVER_HOME>/jbossas/bin/jboss-cli.sh --controller=<REAL_BIND_ADDRESS>:<REAL_JBOSS_MANAGEMENT_NATIVE_PORT> --connect --command='/subsystem=datasources/xa-data-source=RHQDS/:write-attribute(name="no-tx-separate-pool", value=true)'

where:

* <REAL_BIND_ADDRESS> should be replaced with *jboss.bind.address.management* from rhq-server.properties file
* <REAL_JBOSS_MANAGEMENT_NATIVE_PORT> should be replaced with *jboss.management.native.port* from rhq-server.properties file

Root Cause

The update was applied successfully for the most part.

What did not get applied is:

/subsystem=datasources/xa-data-source=RHQDS/:write-attribute(name="no-tx-separate-pool", value=true)

Above failed because apply-updates.sh script is incorrectly parsing the jboss bind address from rhq-server.properties file. Currently, JBOSS_BIND_ADDRESS is defined as:

JBOSS_BIND_ADDRESS=`grep "jboss.bind.address.management" "$INSTALL_PATCH_HOME"/bin/rhq-server.properties | cut -d'=' -f 2`

Above would match the following:

...
jboss.bind.address.management=<JBOSS_BIND_ADDRESS> 
# jboss.bind.address.management needs to be set
# Please set jboss.bind.address.management to something
#jboss.bind.address.management=127.0.0.1
...

and the result would be multiple lines and values being assigned to JBOSS_BIND_ADDRESS.

Diagnostic Steps

Confirm that rhq-server.properties file contains both uncommented and commented out jboss.bind.address.management property.

SBR
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.