Not able to reach exposed console on localhost

Hello, I’m having some issues reaching my exposed GUI on localhost:8161.
Everything I’m trying results in This page isn’t working error in the browser.

small note: every time I mention GUI/console in the thread I mean ActiveMQ’s management GUI on port 8161

Dockerfile

FROM opensuse/leap:15.4

# install and setup application (ActiveMQ Artemis)
# ...
# ...

EXPOSE 61616 8161
CMD ["/software/artemis/bin/artemis", "run"]

Build and run command

docker build -t activemq:latest -f Dockerfile_artemis .
docker run --name artemis -d -t -p 61616:61616 -p 8161:8161 activemq

Using Docker Desktop I see the 0.0.0.0:8161 link.
But when I try to reach my console GUI on either localhost:8161 or localhost:8161/console I get:

This page isn’t working
localhost didn’t send any data.
ERR_EMPTY_RESPONSE

When I go into the container log/terminal I see the application running:

AMQ101000: Starting ActiveMQ Artemis Server
...
AMQ241001: HTTP Server started at http://localhost:8161
AMQ241002: Artemis Jolokia REST API available at http://localhost:8161/console/jolokia
AMQ241004: Artemis Console available at http://localhost:8161/console

When I do wget inside of the of container on localhost:8161/console, I download the expected login page. So I have confirmed that the application is up and running in my container.

I have tried to look for a solution on this forum and google, I find tons of results, but regardless of what I try I’m unable to reach the GUI.

Anyone have a suggestion on what could be the problem?

Small other note: In another container, with Wildfly, I have the exact same problem, I expose 9990 and -p 9990:9990 to reach the application management console. And can verify inside the container that it is available, but cannot reach it on localhost:9990 in my browser.

Hi

The problem is this:

AMQ241001: HTTP Server started at http://localhost:8161
AMQ241002: Artemis Jolokia REST API available at http://localhost:8161/console/jolokia
AMQ241004: Artemis Console available at http://localhost:8161/console

If its listning on localhost, that means that its listning only in the container ( as you also experience ), for it to be correct it needs to listen on all interface, typically 0.0.0.0.

What you can try for a quick-fix, is to run it like:

docker run --name artemis -d -t --network=host activemq

That will make the container run “as if it was starting as a service on the host”, note that ports arent defined ( -p … ) since its not needed for network mode host.

2 Likes

Thank you for your reply.

I will try with “--network=host” when running the container later today.

Will also try to understand why ActiveMQ does not start with 0.0.0.0 instead of localhost, even if I have configured it to 0.0.0.0.

Same situation with Wildfly. I run Wildfly with the additional startup command “-b 0.0.0.0” which is how I run my Wildfly in our Azure environment, where it works as expected. However, I will still not able to reach my Wildfly Management GUI on localhost:9990.

Hi terpz.

I tried to run the container with docker run --name artemis -d -t --network=host activemq and I now got another error message in my browser, ERR_CONNECTION_REFUSED instead of ERR_EMPTY_RESPONSE.

Again I could use the containers terminal and download the expected console page with wget localhost:8161/console.

Not sure how to continue from here. I could try to make ActiveMQ “say” 0.0.0.0:8161/console instead of localhost:8161/console, however I think I already have configured it to 0.0.0.0, and have the exact same problem with Wildfly on another container, where I pretty sure I have bound it to 0.0.0.0 already.

Any other suggestions?

ActiveMQ start-up log if intereseting

AMQ101000: Starting ActiveMQ Artemis Server
AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=false,journalDirectory=data/journal,bindingsDirectory=data/bindings,largeMessagesDirectory=data/large-messages,pagingDirectory=data/paging)
AMQ221013: Using NIO Journal
AMQ221057: Global Max Size is being adjusted to 1/2 of the JVM max size (-Xmx). being defined as 1,073,741,824
AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE
AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP
AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding protocol support for: HORNETQ
AMQ221043: Protocol module found: [artemis-mqtt-protocol]. Adding protocol support for: MQTT
AMQ221043: Protocol module found: [artemis-openwire-protocol]. Adding protocol support for: OPENWIRE
AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support for: STOMP
AMQ221034: Waiting indefinitely to obtain live lock
AMQ221035: Live Server Obtained live lock
AMQ221080: Deploying address DLQ supporting [ANYCAST]
AMQ221003: Deploying ANYCAST queue DLQ on address DLQ
AMQ221080: Deploying address ExpiryQueue supporting [ANYCAST]
AMQ221003: Deploying ANYCAST queue ExpiryQueue on address ExpiryQueue
AMQ221020: Started EPOLL Acceptor at 0.0.0.0:61616 for protocols [CORE,MQTT,AMQP,STOMP,HORNETQ,OPENWIRE]
AMQ221020: Started EPOLL Acceptor at 0.0.0.0:5445 for protocols [HORNETQ,STOMP]
AMQ221020: Started EPOLL Acceptor at 0.0.0.0:5672 for protocols [AMQP]
AMQ221020: Started EPOLL Acceptor at 0.0.0.0:1883 for protocols [MQTT]
AMQ221020: Started EPOLL Acceptor at 0.0.0.0:61613 for protocols [STOMP]
AMQ221007: Server is now live
AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.9.0 [0.0.0.0, nodeID=78df10e3-3dba-11ee-8b83-02420365c9ec]
Initialized activemq-branding plugin
Initialized artemis-plugin plugin
Initialising hawtio services
Configuration will be discovered via system properties
Welcome to hawtio 1.5.5 : http://hawt.io/ : Don’t cha wish your console was hawt like me? :wink:
Starting hawtio authentication filter, JAAS realm: “activemq” authorized role(s): “amq” role principal classes: “org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal”
Using MBean [hawtio:type=security,area=jmx,rank=0,name=HawtioDummyJMXSecurity] for role based access control
Initial proxy whitelist: [localhost, 127.0.0.1, 192.168.65.4]
AMQ241001: HTTP Server started at http://localhost:8161
AMQ241002: Artemis Jolokia REST API available at http://localhost:8161/console/jolokia
AMQ241004: Artemis Console available at http://localhost:8161/console

Thank you it worked now.

I assumed installing ActiveMQ with the --host 0.0.0.0 command would do the trick. But it looks like it assumes 0.0.0.0 is localhost. Therefore I had to manually edit one of the configuration files from localhost to 0.0.0.0 to make it work. Also because I had the exact same Wildfly issue, I thought something not related to the application software was the issue.

Thank you for pointing out the issue.