Unable to access Artemis GUI when listening on 0.0.0.0
Asked Answered
T

1

7

I am initializing brokers in 2 different ways. One that listens on 0.0.0.0 and the other that listens on the node IP i.e. 172.29.245.17.

Broker 1 :

[root@amq-1 apache-artemis-2.4.0]# bin/artemis create --name BROKER-1 /var/tmp/BROKER-1  --user admin --password admin --http-host 0.0.0.0 --http-port 8080 --allow-anonymous

Broker 2 :

[root@amq-1 apache-artemis-2.4.0]# bin/artemis create --name BROKER-2 /var/tmp/BROKER-2  --user admin --password admin --http-host 172.29.245.17 --http-port 8080 --allow-anonymous

As you can see, the only difference is which IP to listen on. One is open to all(0.0.0.0). The other listens only on 1 specific IP().

There is no problem accessing the GUI of Broker-2 (one listening on 172.29.245.17)

Now when I start Broker-1 (listening on 0.0.0.0), I get redirected to /console/jvm/connect

enter image description here

ERROR states ::

[Core] Operation unknown failed due to: java.lang.Exception : Origin http://172.29.245.17:8080 is not allowed to call this agent
[Core] ActiveMQ Management Console started
[Window] Uncaught TypeError: Cannot read property 'apply' of undefined (http://172.29.245.17:8080/console/app/app.js?0d5300a336117972:16:14366)
[Window] Uncaught TypeError: Cannot read property 'apply' of undefined (http://172.29.245.17:8080/console/app/app.js?0d5300a336117972:16:14366)
[Window] Uncaught TypeError: Cannot read property 'apply' of undefined (http://172.29.245.17:8080/console/app/app.js?0d5300a336117972:16:14366)
[Window] Uncaught TypeError: Cannot read property 'apply' of undefined (http://172.29.245.17:8080/console/app/app.js?0d5300a336117972:16:14366)

For Broker-1 , the jolokia-access.xml states ::

<restrict>

    <cors>
        <!-- Allow cross origin access from 0.0.0.0 ... -->
        <allow-origin>*://0.0.0.0*</allow-origin>

        <!-- Check for the proper origin on the server side, too -->
        <strict-checking/>
    </cors>

</restrict>

For Broker-2, the jolokia-access.xml states :

<restrict>

    <cors>
        <!-- Allow cross origin access from 172.29.245.17 ... -->
        <allow-origin>*://172.29.245.17*</allow-origin>

        <!-- Check for the proper origin on the server side, too -->
        <strict-checking/>
    </cors>

</restrict>

I am unable to figure out why the issue occurs when Im trying to listen on 0.0.0.0. Any ideas ?

All other configurations are default. I have not modified any other config.

Trimolecular answered 9/3, 2018 at 19:48 Comment(0)
C
10

I believe the problem here is that your jolokia-access.xml on Broker-1 is using this:

<allow-origin>*://0.0.0.0*</allow-origin>

However, in your browser you are attempting to access the console via 172.29.245.17:8080 which isn't allowed based on your jolokia-access.xml. Therefore you need to either change your browser to connect to 0.0.0.0:8080 (which will only work when the broker/console is running locally) or change the jolokia-access.xml to allow the IP:port you're actually going to use to connect.

You can read more about the jolokia-access.xml in the Jolokia security documentation.

Coffey answered 28/3, 2018 at 17:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.