Bug 1295153 - ./bin/jboss-cli.sh -c "patch apply ..." end in 'patching exception'
./bin/jboss-cli.sh -c "patch apply ..." end in 'patching exception'
Status: CLOSED NOTABUG
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Patching (Show other bugs)
6.4.5
Unspecified Other
unspecified Severity low
: ---
: ---
Assigned To: jboss-set
Jan Martiska
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-02 19:30 EST by Jiri Belka
Modified: 2016-01-04 10:27 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-01-04 10:27:02 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jiri Belka 2016-01-02 19:30:09 EST
Description of problem:

For my own testing/studying purpose i'm trying JBEAP 6.4.x on unsupported OS and I do following steps to have JBEAP 6.4.x up-to-date:

- extract 6.4.0.zip
- cd to dir where it is extracted
- ./bin/jboss-cli.sh -c "patch apply jboss-eap-6.4.5-patch.zip"


Thus the steps are so-called 'offline' patching on completely pristine extracted distribution archive.

The last step doesn't finish successfully as it fails, returns '1' and the output states:

  patching exception

I modified ./bin/jboss-cli-logging.properties to get more info and here it is:

~~~
01:24:37,767 INFO  [org.jboss.modules] JBoss Modules version 1.3.6.Final-redhat-1
01:24:37,975 DEBUG [org.jboss.logging] Logging Provider: org.jboss.logging.JBossLogManagerProvider
01:24:38,219 DEBUG [org.jboss.as.cli.CommandContext] connecting to localhost:9999 as null
01:24:38,227 DEBUG [org.jboss.modules] Module org.jboss.marshalling.river:main defined by local module loader @619a5dff (finder: local module finder @1ed6993a (roots: /home/jirib/openbsd/pobj/jbeap-eap-6.4.5/jboss-eap-6.4/modules,/home/jirib/openbsd/pobj/jbeap-eap-6.4.5/jboss-eap-6.4/modules/system/layers/base))
01:24:38,244 DEBUG [org.jboss.modules] Module org.jboss.xnio.nio:main defined by local module loader @619a5dff (finder: local module finder @1ed6993a (roots: /home/jirib/openbsd/pobj/jbeap-eap-6.4.5/jboss-eap-6.4/modules,/home/jirib/openbsd/pobj/jbeap-eap-6.4.5/jboss-eap-6.4/modules/system/layers/base))
01:24:38,273 INFO  [org.xnio] XNIO Version 3.0.13.GA-redhat-1
01:24:38,282 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.13.GA-redhat-1
01:24:38,314 INFO  [org.jboss.remoting] JBoss Remoting version 3.3.4.Final-redhat-1
01:24:38,333 DEBUG [org.xnio.nio] Started channel thread 'Remoting "cli-client" read-1', selector sun.nio.ch.KQueueSelectorImpl@7e6ef856
01:24:38,345 DEBUG [org.xnio.nio] Started channel thread 'Remoting "cli-client" write-1', selector sun.nio.ch.KQueueSelectorImpl@55c6993
01:24:39,137 DEBUG [org.jboss.modules] Module org.jboss.as.core-security:main defined by local module loader @619a5dff (finder: local module finder @1ed6993a (roots: /home/jirib/openbsd/pobj/jbeap-eap-6.4.5/jboss-eap-6.4/modules,/home/jirib/openbsd/pobj/jbeap-eap-6.4.5/jboss-eap-6.4/modules/system/layers/base))
01:24:39,141 DEBUG [org.jboss.modules] Module org.jboss.as.core-security-api:main defined by local module loader @619a5dff (finder: local module finder @1ed6993a (roots: /home/jirib/openbsd/pobj/jbeap-eap-6.4.5/jboss-eap-6.4/modules,/home/jirib/openbsd/pobj/jbeap-eap-6.4.5/jboss-eap-6.4/modules/system/layers/base))
01:25:24,567 ERROR [org.jboss.as.cli.CommandContext] patching exception
~~~

I'm not sure if above steps are supposed to be working. I just wanted to make jbeap application package for myself with latest patch included.

Version-Release number of selected component (if applicable):
6.4.5

How reproducible:
100%

Steps to Reproduce:
1. extract 6.4.0.zip
2. cd to dir where 6.4.0.zip was extracted
3. ./bin/jboss-cli.sh -c "patch apply /usr/ports/distfiles/jboss-eap-6.4.5-patch.zip" ; echo $?

Actual results:
patching exception

Expected results:
would be nice if it would be working and i could update with above steps, so i could package jbeap for my own purpose on my unsupported OS :)

Additional info:
$ sysctl kern.version ; java -version                                                                                                                                                  
kern.version=OpenBSD 5.8-current (GENERIC.MP) #1706: Fri Dec  4 01:49:55 MST 2015
    deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP

openjdk version "1.8.0_45"
OpenJDK Runtime Environment (build 1.8.0_45-b14)
OpenJDK 64-Bit Server VM (build 25.45-b02, mixed mode)
Comment 1 Jiri Belka 2016-01-02 19:52:45 EST
I tried the same steps on one RHEL6.7 and I see different output:

~~~
./bin/jboss-cli.sh -c "patch apply ../jboss-eap-6.4.5-patch.zip"
org.jboss.as.cli.CliInitializationException: Failed to connect to the controller
        at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:299)
        at org.jboss.as.cli.impl.CliLauncher.main(CliLauncher.java:265)
        at org.jboss.as.cli.CommandLineMain.main(CommandLineMain.java:45)
        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:622)
        at org.jboss.modules.Module.run(Module.java:312)
        at org.jboss.modules.Main.main(Main.java:473)
Caused by: org.jboss.as.cli.CommandLineException: The controller is not available at localhost:9999
        at org.jboss.as.cli.impl.CommandContextImpl.tryConnection(CommandContextImpl.java:1057)
        at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:887)
        at org.jboss.as.cli.impl.CommandContextImpl.connectController(CommandContextImpl.java:863)
        at org.jboss.as.cli.impl.CliLauncher.initCommandContext(CliLauncher.java:297)
        ... 8 more
Caused by: java.io.IOException: java.net.ConnectException: JBAS012174: Could not connect to remote://localhost:9999. The connection failed
        at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:149)
        at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:75)
        at org.jboss.as.cli.impl.CommandContextImpl.tryConnection(CommandContextImpl.java:1035)
        ... 11 more
Caused by: java.net.ConnectException: JBAS012174: Could not connect to remote://localhost:9999. The connection failed
        at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:133)
        at org.jboss.as.protocol.ProtocolConnectionManager$EstablishingConnection.connect(ProtocolConnectionManager.java:256)
        at org.jboss.as.protocol.ProtocolConnectionManager.connect(ProtocolConnectionManager.java:70)
        at org.jboss.as.protocol.mgmt.FutureManagementChannel$Establishing.getChannel(FutureManagementChannel.java:208)
        at org.jboss.as.cli.impl.CLIModelControllerClient.getOrCreateChannel(CLIModelControllerClient.java:169)
        at org.jboss.as.cli.impl.CLIModelControllerClient$2.getChannel(CLIModelControllerClient.java:129)
        at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:123)
        at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:98)
        at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:263)
        at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:168)
        at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:147)
        ... 13 more
Caused by: java.io.IOException: Received an invalid message length of 1433625888
        at org.xnio.channels.FramedMessageChannel.receive(FramedMessageChannel.java:106)
        at org.jboss.remoting3.remote.ClientConnectionOpenListener$Greeting.handleEvent(ClientConnectionOpenListener.java:165)
        at org.jboss.remoting3.remote.ClientConnectionOpenListener$Greeting.handleEvent(ClientConnectionOpenListener.java:156)
        at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
        at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
        at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
        at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
        at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
        at org.xnio.ssl.JsseConnectedSslStreamChannel.handleReadable(JsseConnectedSslStreamChannel.java:183)
        at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
        at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
        at org.xnio.nio.NioHandle.run(NioHandle.java:90)
        at org.xnio.nio.WorkerThread.run(WorkerThread.java:198)
        at ...asynchronous invocation...(Unknown Source)
        at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:270)
        at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:251)
        at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:349)
        at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:337)
        at org.jboss.as.protocol.ProtocolConnectionUtils.connect(ProtocolConnectionUtils.java:84)
        at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:103)
        ... 23 more
~~~

Any idea what could suppress above output on OpenBSD?
Comment 2 Jan Martiska 2016-01-04 01:10:40 EST
I don't know how you managed to get that 'Received an invalid message length of 1433625888' on RHEL with a stopped EAP but the problem is apparently that you are telling the CLI to connect (go to online mode, using -c parameter) when EAP is not started. I think you have confused -c (alias for --connect) with --command, which is used when you need to invoke a command and exit.

The command for offline patching needs to be
./bin/jboss-cli.sh --command="patch apply jboss-eap-6.4.5-patch.zip"

Output of just "patching exception" on OpenBSD looks to me like a bug in exception handling.
Comment 3 Jiri Belka 2016-01-04 10:27:02 EST
Yes, PEBKAC :)

$ ./bin/jboss-cli.sh --command="patch apply ../jboss-eap-6.4.5-patch.zip" 
INFO  [org.jboss.modules] JBoss Modules version 1.3.6.Final-redhat-1
INFO  [org.jboss.as.cli.CommandContext] {
    "outcome" : "success",
    "result" : {}
}
{
    "outcome" : "success",
    "result" : {}
}

$ cat version.txt  
Red Hat JBoss Enterprise Application Platform - Version 6.4.5.GA

Note You need to log in before you can comment on or make changes to this bug.