Fork me on GitHub
#immutant
<
2017-10-30
>
symbit15:10:37

Is there an event handler, on-shutdown?

ricardo20:10:03

We just got this strange issue with immutant.

2017-10-30 18:11:19,724 [main] INFO  luminus.http-server - starting HTTP server on port 3000
2017-10-30 18:11:19,779 [main] INFO  org.xnio - XNIO version 3.3.6.Final
2017-10-30 18:11:19,905 [main] ERROR luminus.http-server - server failed to start on port 3000
java.lang.RuntimeException: java.net.UnknownHostException: 127.0.0.1:3000: invalid IPv6 address
    at io.undertow.Undertow.start(Undertow.java:186) ~[undertow-core-1.3.23.Final.jar:1.3.23.Final]
    at org.projectodd.wunderboss.web.undertow.UndertowWeb.start(UndertowWeb.java:83) ~[wunderboss-web-undertow-0.12.2.jar:na]
    at org.projectodd.wunderboss.web.undertow.UndertowWeb.registerHandler(UndertowWeb.java:143) ~[wunderboss-web-undertow-0.12.2.jar:na]
    at org.projectodd.wunderboss.web.undertow.UndertowWeb.registerHandler(UndertowWeb.java:124) ~[wunderboss-web-undertow-0.12.2.jar:na]
    at org.projectodd.wunderboss.web.undertow.UndertowWeb.registerHandler(UndertowWeb.java:68) ~[wunderboss-web-undertow-0.12.2.jar:na]
    at immutant.web.internal.wunderboss$mount.invokeStatic(wunderboss.clj:79) ~[na:na]
We’re not using an IPv6 address, so that’s weird., but then it got weirder. We tried changing adding a host to localhost on the config.edn (which gets read via cprop from a resource) but it had no impact. Then I tried changing it to port 3001, just to test, and got:
2017-10-30 18:11:19,724 [main] INFO  luminus.http-server - starting HTTP server on port 3001
2017-10-30 18:11:19,779 [main] INFO  org.xnio - XNIO version 3.3.6.Final
2017-10-30 18:11:19,905 [main] ERROR luminus.http-server - server failed to start on port 3001
java.lang.RuntimeException: java.net.UnknownHostException: 127.0.0.1:3000: invalid IPv6 address
    at io.undertow.Undertow.start(Undertow.java:186) ~[undertow-core-1.3.23.Final.jar:1.3.23.Final]
    at org.projectodd.wunderboss.web.undertow.UndertowWeb.start(UndertowWeb.java:83) ~[wunderboss-web-undertow-0.12.2.jar:na]
    at org.projectodd.wunderboss.web.undertow.UndertowWeb.registerHandler(UndertowWeb.java:143) ~[wunderboss-web-undertow-0.12.2.jar:na]
    at org.projectodd.wunderboss.web.undertow.UndertowWeb.registerHandler(UndertowWeb.java:124) ~[wunderboss-web-undertow-0.12.2.jar:na]
    at org.projectodd.wunderboss.web.undertow.UndertowWeb.registerHandler(UndertowWeb.java:68) ~[wunderboss-web-undertow-0.12.2.jar:na]
    at immutant.web.internal.wunderboss$mount.invokeStatic(wunderboss.clj:79) ~[na:na]
Where it looks like it did get the proper port on the first three lines, but then the “invalid IPv6 address” line still has port 3000. As far as I can tell, we aren’t configuring the port anywhere else.

ricardo11:11:03

Figured it out. The machine in question had a HOST environment variable set to “127.0.0.1:3000” for historical reasons.

ricardo20:10:13

Anyone run into something like this?