You are not logged in.
I am encountering the following issue on a fresh Arch install, while trying to get an ActiveMQ server up and running through docker. I don't think it's this specific image's fault, but a configuration issue in my environment.
docker run rmohr/activemq:latest
The container crashes, with the following internal error:
INFO | Listening for connections at: tcp://4a415e89a54e:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600
INFO | Connector openwire started
INFO | Listening for connections at: amqp://4a415e89a54e:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600
INFO | Connector amqp started
INFO | Listening for connections at: stomp://4a415e89a54e:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600
INFO | Connector stomp started
INFO | Listening for connections at: mqtt://4a415e89a54e:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600
INFO | Connector mqtt started
WARN | ServletContext@o.e.j.s.ServletContextHandler@63611043{/,null,STARTING} has uncovered http methods for path: /
WARN | FAILED ServerConnector@5bf0fe62{HTTP/1.1}{olympos:61614}: java.net.BindException: Cannot assign requested address
java.net.BindException: Cannot assign requested address
at sun.nio.ch.Net.bind0(Native Method)[:1.8.0_181]
at sun.nio.ch.Net.bind(Net.java:433)[:1.8.0_181]
at sun.nio.ch.Net.bind(Net.java:425)[:1.8.0_181]
Note that all port binds succeed, using the container's hostname (4a4....54e). The last one fails (WebSockets), which tries to bind to `olympos`. The strange thing here is that `olympos` is the hostname one of my local machines, which is also hosting my DNS server (pihole). The activemq configuration defines binds on 0.0.0.0 for various ports. It is the one for WebSockets that fails, on 0.0.0.0:61614, which apparently is resolved to an attempted bind on olympos:61614. When I manually prepare the container's configuration and modify the default `0.0.0.0` to `127.0.0.1`, for the websocket server, the error does not occur anymore.
My question is: why would this behaviour occur, and how can I troubleshoot this? Other containers seems to behave fine, including port forwarding. There is no custom docker network or configuration defined.
Some environment info:
<empty>
# Generated by NetworkManager nameserver 192.168.178.3 nameserver 212.224.129.90 nameserver 212.224.129.94
127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 172.17.0.4 3d9cbff074fd
# Generated by NetworkManager nameserver 192.168.178.3 nameserver 212.224.129.90 nameserver 212.224.129.94
I did some extra digging and tried to figure out which parts failed exactly. Enabling a VPN connection changed the previous behaviour. I used two test cases:
Manually run the image
docker run -p 61616:61616 -p 8161:8161 -it --rm rmohr/activemq
Run it through compose
version: "3"
services:
qguard-guardian-activemq:
image: rmohr/activemq:latest
ports:
- "61616:61616"
- "8161:8161"
- When VPN is disabled, both methods fail the same way.
- When VPN is enabled, the manual method works as expected. The Java process now knows to bind to the container's hostname instead of `olympos` and ActiveMQ starts up correctly.
- When VPN is enabled, docker still fails. Tries to bind to olympos.
As the difference between compose and manual might be important, and they use different docker networks, I included a diff between both network configurations below:
[ [
{ {
"Name": "activemq_default", | "Name": "bridge",
"Id": "f67229f284b96eb0413ad1a2bcfad99d2b943f9d2593fe | "Id": "4777f75f3f64d8d54ade6cbed37107fd6471e08e8601a6
"Created": "2021-11-03T13:04:25.042820192+01:00", | "Created": "2021-11-03T10:58:57.703103186+01:00",
"Scope": "local", "Scope": "local",
"Driver": "bridge", "Driver": "bridge",
"EnableIPv6": false, "EnableIPv6": false,
"IPAM": { "IPAM": {
"Driver": "default", "Driver": "default",
"Options": null, "Options": null,
"Config": [ "Config": [
{ {
"Subnet": "172.21.0.0/16", | "Subnet": "172.17.0.0/16",
"Gateway": "172.21.0.1" | "Gateway": "172.17.0.1"
} }
] ]
}, },
"Internal": false, "Internal": false,
"Attachable": false, "Attachable": false,
"Ingress": false, "Ingress": false,
"ConfigFrom": { "ConfigFrom": {
"Network": "" "Network": ""
}, },
"ConfigOnly": false, "ConfigOnly": false,
"Containers": {}, "Containers": {},
"Options": {}, | "Options": {
"Labels": { | "com.docker.network.bridge.default_bridge": "true
"com.docker.compose.network": "default", | "com.docker.network.bridge.enable_icc": "true",
"com.docker.compose.project": "activemq", | "com.docker.network.bridge.enable_ip_masquerade":
"com.docker.compose.version": "2.0.1" | "com.docker.network.bridge.host_binding_ipv4": "0
} | "com.docker.network.bridge.name": "docker0",
> "com.docker.network.driver.mtu": "1500"
> },
> "Labels": {}
} }
] ]
Last edited by CountZukula (2021-11-03 12:33:01)
Offline