1

I want to check whether my JBoss EAP 7 is started via jboss-cli.

With JBoss EAP 6 I could use the following command

jboss-cli.bat -c --commands="read-attribute server-state"

While the server is starting, the response is starting. When the server booted successfully, the response is running.

After migrating to JBoss EAP 7.0, the same command returns the following message, while the server is starting. Failed to connect to the controller: Timeout waiting for the system to boot. When the server started successfully, the usual message running is returned.

My question is: Why can't the jboss-cli connect to the server until it started?

SilverNak
  • 3,283
  • 4
  • 28
  • 44
  • That likely means the management interface is not yet up and listening. It might work if you change the `` in the `$JBOSS_HOME/bin/jboss-cli.sh`. – James R. Perkins May 25 '18 at 21:47

2 Answers2

1

In EAP 7.x and EAP 6.3.0 or later, you can configure jboss.as.management.blocking.timeout system property to tune timeout (seconds) waiting for service container stability. Try setting this parameter once connected via CLI.

Since EAP 6.3.0.ER8 there is a new class in jboss.as.controller: BlockingTimeout. This class loads the value of system property jboss.as.management.blocking.timeout or defaults to 300 (seconds). Note: This property is not a timeout per deployment but a timeout on container stability and if jboss.as.management.blocking.timeout is reached during startup then all applications will be undeployed and the container shutdown. The reasoning behind this is that having a half-working server is potentially dangerous as you may not notice major failures. Thus if your application is unable to load within the given timeout value,CLI will throw the errorFailed to connect to the controller: Timeout waiting for the system to boot

jboss-cli.sh --connect --controller=IP:PORT --timeout=40000 configure timeouts value to be more then the amount of time your server takes to start.

Sweta Patra
  • 341
  • 1
  • 4
  • Funny thing is, I haven't set `jboss.as.management.blocking.timeout`, but the Timeout occurs after roughly 2 seconds. After about a minute the server deployed all applications correctly and the CLI works properly. – SilverNak May 30 '18 at 09:06
  • You can try by setting this system property via-CLI restart server: `/system-property=jboss.as.management.blocking.timeout:add(value=600)` and check if it changes anything – Sweta Patra May 30 '18 at 09:14
  • I tried that, but nothing changes. The server started in 34688ms – SilverNak May 30 '18 at 10:15
  • 1
    That means issue is just with CLI,we can roll out EAP deployment delay now.Try using `jboss-cli.sh --connect --controller=10.10.10.10:9999 --timeout=40000`,this should work,just add your EAP port,IP properly. – Sweta Patra May 30 '18 at 11:29
  • Sorry, somehow I did not see the notification. With `--timeout=40000` the cli waits until the server is running, which kind of resolves the issue. Nontheless I wonder why the `starting` message did vanish? – SilverNak Jun 01 '18 at 11:04
  • Hi @SilverNak, did you find another solution than setting the `timeout` parameter? – Janfy Apr 11 '19 at 07:46
  • @Janfy I kind of worked around that issue by not checking for `started` but for `Failed to connect ` and retrying. – SilverNak Apr 11 '19 at 08:04
0

Actual command line is ./jboss-cli.sh --connect command=":read-attribute(name=server-state)"

vishy dewangan
  • 1,061
  • 7
  • 9