How to Solve Error Message Failed to connect to the controller: Timeout waiting for the system to boot when stopping Wildfly Application Server

Posted on

Introduction

This article will show how to solve the error message exist in the title of this article. The error exist upon terminating or shutting down the Wildfly Application Server. This article has a strong connection with the previous article. It is an article about how to stop Wildfly Application Server. The article itself exist in this link. It is an article with the title of ‘How to Stop Wildfly Application Server’s service in Microsoft Windows’.

Actually, the process for stopping the Wildfly Application Server is a success in that article. But in this article, the process for stopping the Wildfly Application Server ends in failure. The following is the error message appear after running the command for stopping the Wildfly Application Server :

Failed to connect to the controller: Timeout waiting for the system to boot.

The following is the actual execution of the command for trying several times to stop the Wildfly Application Server :

C:\wildfly-20.0.1.Final\bin>jboss-cli.bat --connect --controller=localhost:9990 --command=:shutdown
Failed to connect to the controller: Timeout waiting for the system to boot.
Press any key to continue . . .

C:\wildfly-20.0.1.Final\bin>jboss-cli.bat --connect --controller=localhost:9990 --command=:shutdown
Failed to connect to the controller: Timeout waiting for the system to boot.
Press any key to continue . . .

C:\wildfly-20.0.1.Final\bin>jboss-cli.bat --connect --controller=localhost:9990 --command=:shutdown
Failed to connect to the controller: Timeout waiting for the system to boot.
Press any key to continue . . .

C:\wildfly-20.0.1.Final\bin>jboss-cli.bat --connect --controller=localhost:9990 --command=:shutdown
{
"outcome" => "success",
"result" => undefined
}
Press any key to continue . . .

C:\wildfly-20.0.1.Final\bin>

Solution

Actually, the error message is very clear. The command for executing the shutdown process depends on the availability of the Wildfly Application Server’s controller. It is the Administration Console of the Wildfly Application Server which is running in port 9990 by default. It does not have to take any clear action to solve this problem.

Unless there is actually a disturbance or an error in the Administration Console’s service of the Wildfly Application Server. In this context of the article, actually the Administration Console of the Wildfly Application Server is not ready yet.

So, the solution is very simple, just wait for the Wildfly Application Server is finally finish the process for booting up the service. The following is the actual output log message informing that the Wildfly Application Server is currently running and finish the boot up process :

C:\wildfly-20.0.1.Final\bin>standalone.bat
Calling "C:\wildfly-20.0.1.Final\bin\standalone.conf.bat"
Setting JAVA property to "C:\jdk-14\bin\java"
===============================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: "C:\wildfly-20.0.1.Final"

  JAVA: "C:\jdk-14\bin\java"

  JAVA_OPTS: "-Dprogram.name=standalone.bat -Xms1024M -Xmx1024M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman  --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED"

===============================================================================

18:38:00,908 INFO  [org.jboss.modules] (main) JBoss Modules version 1.10.1.Final
18:38:01,741 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.11.Final
18:38:01,756 INFO  [org.jboss.threads] (main) JBoss Threads version 2.3.3.Final
18:38:01,957 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 20.0.1.Final (WildFly Core 12.0.3.Final) starting
18:38:03,304 INFO  [org.wildfly.security] (ServerService Thread Pool -- 28) ELY00001: WildFly Elytron version 1.12.1.Final
18:38:04,276 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
18:38:04,310 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 15) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
18:38:04,595 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
18:38:04,614 INFO  [org.xnio] (MSC service thread 1-2) XNIO version 3.8.1.Final
18:38:04,621 INFO  [org.xnio.nio] (MSC service thread 1-2) XNIO NIO Implementation Version 3.8.1.Final
18:38:04,850 INFO  [org.wildfly.extension.microprofile.metrics.smallrye] (ServerService Thread Pool -- 64) WFLYMETRICS0001: Activating Eclipse MicroProfile Metrics Subsystem
18:38:04,862 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 44) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
18:38:04,888 INFO  [org.jboss.as.connector] (MSC service thread 1-3) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.22.Final)
18:38:04,903 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) WFLYJCA0018: Started Driver service with driver-name = h2
18:38:04,908 INFO  [org.jboss.as.jaxrs] (ServerService Thread Pool -- 54) WFLYRS0016: RESTEasy version 3.12.1.Final
18:38:04,935 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 52) WFLYCLINF0001: Activating Infinispan subsystem.
18:38:04,934 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 44) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
18:38:04,969 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 72) WFLYSEC0002: Activating Security Subsystem
18:38:04,966 INFO  [org.wildfly.extension.microprofile.health.smallrye] (ServerService Thread Pool -- 62) WFLYHEALTH0001: Activating Eclipse MicroProfile Health Subsystem
18:38:04,945 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 74) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique.
18:38:04,954 INFO  [org.wildfly.extension.microprofile.opentracing] (ServerService Thread Pool -- 65) WFLYTRACEXT0001: Activating MicroProfile OpenTracing Subsystem
18:38:04,951 INFO  [org.wildfly.extension.microprofile.config.smallrye._private] (ServerService Thread Pool -- 61) WFLYCONF0001: Activating WildFly MicroProfile Config Subsystem
18:38:04,948 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 76) WFLYWS0002: Activating WebServices Extension
18:38:04,946 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 66) WFLYNAM0001: Activating Naming Subsystem
18:38:04,983 INFO  [org.wildfly.extension.microprofile.jwt.smallrye._private] (ServerService Thread Pool -- 63) WFLYJWT0001: Activating WildFly MicroProfile JWT Subsystem
18:38:05,026 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) WFLYJCA0018: Started Driver service with driver-name = mysql
18:38:05,038 INFO  [org.jboss.as.security] (MSC service thread 1-5) WFLYSEC0001: Current PicketBox version=5.0.3.Final-redhat-00005
18:38:05,052 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 59) WFLYJSF0007: Activated the following JSF Implementations: [main]
18:38:05,102 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0003: Undertow 2.1.3.Final starting
18:38:05,272 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 75) WFLYUT0014: Creating file handler for path 'C:\wildfly-20.0.1.Final/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
18:38:05,395 INFO  [org.jboss.as.naming] (MSC service thread 1-7) WFLYNAM0003: Starting Naming Service
18:38:05,397 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-5) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
18:38:06,070 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 53) WFLYIO001: Worker 'default' has auto-configured to 16 IO threads with 128 max task threads based on your 8 available processors
18:38:06,101 INFO  [org.jboss.remoting] (MSC service thread 1-3) JBoss Remoting version 5.0.18.Final
18:38:06,127 INFO  [org.jboss.as.ejb3] (MSC service thread 1-5) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 32 (per class), which is derived from the number of CPUs on this host.
18:38:06,127 INFO  [org.jboss.as.ejb3] (MSC service thread 1-7) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 128 (per class), which is derived from thread worker pool sizing.
18:38:06,159 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0012: Started server default-server.
18:38:06,161 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0018: Host default-host starting
18:38:06,234 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
8:38:06,264 INFO [org.jboss.as.ejb3] (MSC service thread 1-7) WFLYEJB0493: EJB subsystem suspension complete
18:38:06,345 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-5) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
18:38:06,501 INFO [org.jboss.as.patching] (MSC service thread 1-7) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
18:38:06,518 WARN [org.jboss.as.domain.management.security] (MSC service thread 1-6) WFLYDM0111: Keystore C:\wildfly-20.0.1.Final\standalone\configuration\application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
18:38:06,524 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) WFLYDS0013: Started FileSystemDeploymentService for directory C:\wildfly-20.0.1.Final\standalone\deployments
18:38:06,776 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
18:38:07,080 INFO [org.jboss.ws.common.management] (MSC service thread 1-5) JBWS022052: Starting JBossWS 5.4.1.Final (Apache CXF 3.3.6)
18:38:09,468 INFO [org.infinispan.PERSISTENCE] (MSC service thread 1-1) ISPN000556: Starting user marshaller 'org.wildfly.clustering.infinispan.marshalling.jboss.JBossMarshaller'
18:38:09,508 INFO [org.infinispan.CONTAINER] (MSC service thread 1-1) ISPN000128: Infinispan version: Infinispan 'Turia' 10.1.8.Final
18:38:10,596 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 78) WFLYCLINF0002: Started client-mappings cache from ejb container

Actually, in the above output listing the log of Wildfly Application Server’s service, the starting point for the service to be available is in the following line about :

18:38:04,595 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)

It is obvious since it exist in the Wildfly Application Server’s configuration in the conf folder of the Wildfly Application Server. Actually, the Wildfly Application Server with the name of ‘standalone.conf’. It is available in ‘C:\wildfly-root-folder\standalone\configuration’ folder. For an example, if the root folder of the Wildfly Application Server is in ‘C:\wildfly-20.0.1-Final’, the location of the ‘standalone.conf’ will be in ‘C:\wildfly-20.0.1-Final\standalone\configuration’ folder.

In the configuration file with the name of ‘standalone.conf’ the following line is defining the management-http’s port definition :

<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>

So, look out for the log output of starting the Wildfly Application Server’s service. Check the line with the information about http management service creation. If it is a success the command for executing ‘jboss-cli.bat’ file with the additional parameter of the controller to connect to the http management will be possible. If the connection to the http management is possible then the command for shutting down the service also possible. Finally, if the command for shutting down the Wildfly Application Server is a success, the following is the actual output of it :

C:\wildfly-20.0.1.Final\bin>jboss-cli.bat --connect --controller=localhost:9990 --command=:shutdown
{
    "outcome" => "success",
    "result" => undefined
}
Press any key to continue . . .

Leave a Reply