[Solved] [Fedora27] OpenHAB does not listen on IPv4 socket

I’ve set up a Pine64 (arm64) with a fresh Fedora 27 (minimal) and installed all updates.
Additionally I’ve installed java-1.8.0-openjdk, the OpenHAB RPM repository and the openhab2 package.
Finally I’ve started and enabled openhab2. 30 minutes later I’m still not able to get anything served on IPv4 port 8080
(browser says ERR_ADDRESS_UNREACHABLE when using http://<device-IPv4>:8080).

I am able to connect via SSH, so I am sure that networking works. netstat -tulpn does not show any IPv4 TCP server besides my SSH daemon. To make things even more strange, netstat shows that OpenHAB is serving on the tcp6 port 8080. I’ve come to the point, where I’d like to ask for some ideas to debug the issue.
FWIW, typing http://[<device-IPv6]:8080 in the browser does not solve the problem either.
Find some more infos in the following.

Any ideas?

[root@openhab ~]# java -version
openjdk version "1.8.0_161"
OpenJDK Runtime Environment (build 1.8.0_161-b14)
OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)

[root@openhab ~]# cat /var/log/openhab2/openhab.log 
2018-02-03 15:40:19.311 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at http://192.168.188.54:8080
2018-02-03 15:40:19.356 [INFO ] [.dashboard.internal.DashboardService] - Started dashboard at https://192.168.188.54:8443
2018-02-03 15:40:33.247 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007

[root@openhab ~]# systemctl status openhab2
● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2018-02-03 15:38:19 CET; 31min ago
     Docs: http://docs.openhab.org
           https://community.openhab.org
 Main PID: 1009 (java)
    Tasks: 97 (limit: 4915)
   CGroup: /system.slice/openhab2.service
           └─1009 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/openhab2 -Dfelix.cm.dir=/var/lib/openhab2/config -Djetty.host=0.0.0.0 -Djetty.http.compliance=RFC2616 -Dorg.ops4j.pax.web.listening.addresses=0.0.0.0 -Dorg.osgi.service.http.port=8080 -Dorg.osgi.service.http.port.secure=8443 -Djava.awt.headless=true -Djava.endorsed.dirs=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.fc27.aarch64/jre/jre/lib/endorsed:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.fc27.aarch64/jre/lib/endorsed:/usr/share/openhab2/runtime/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.fc27.aarch64/jre/jre/lib/ext:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.161-0.b14.fc27.aarch64/jre/lib/ext:/usr/share/openhab2/runtime/lib/ext -Dkaraf.instances=/var/lib/openhab2/tmp/instances -Dkaraf.home=/usr/share/openhab2/runtime -Dkaraf.base=/var/lib/openhab2 -Dkaraf.data=/var/lib/openhab2 -Dkaraf.etc=/var/lib/openhab2/etc -Dkaraf.logs=/var/log/openhab2 -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/var/lib/openhab2/tmp -Djava.util.logging.config.file=/var/lib/openhab2/etc/java.util.logging.properties -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -classpath /usr/share/openhab2/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.1.3.jar:/usr/share/openhab2/runtime/lib/boot/org.apache.karaf.jaas.boot-4.1.3.jar:/usr/share/openhab2/runtime/lib/boot/org.apache.karaf.main-4.1.3.jar:/usr/share/openhab2/runtime/lib/boot/org.osgi.core-6.0.0.jar org.apache.karaf.main.Main
Feb 03 15:38:19 openhab systemd[1]: Started openHAB 2 - empowering the smart home.

[root@openhab ~]# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      650/sshd            
tcp6       0      0 127.0.0.1:8101          :::*                    LISTEN      1009/java           
tcp6       0      0 :::5007                 :::*                    LISTEN      1009/java           
tcp6       0      0 :::8080                 :::*                    LISTEN      1009/java           
tcp6       0      0 :::22                   :::*                    LISTEN      650/sshd            
tcp6       0      0 :::8443                 :::*                    LISTEN      1009/java           
tcp6       0      0 127.0.0.1:41759         :::*                    LISTEN      1009/java           
udp        0      0 0.0.0.0:68              0.0.0.0:*                           795/dhclient        
udp        0      0 127.0.0.1:323           0.0.0.0:*                           591/chronyd         
udp6       0      0 :::1900                 :::*                                1009/java           
udp6       0      0 :::5353                 :::*                                1009/java           
udp6       0      0 ::1:323                 :::*                                591/chronyd         
udp6       0      0 192.168.188.54:58846    :::*                                1009/java

I’ve just tested this in a fresh Fedora 27 VM (x86_64) and I can reproduce the issue. So it is no aarch64 specific.
Access via http://localhost:8080 works (tested with lynx).

Of course it was the firewall, which blocked everything from working like stated in the OpenHAB documentation.
So in case you find yourself with the same problem, here is a possible solution:

#Add TCP port 8080 to public zone in permanent configuration
firewall-cmd --permanent --zone=public --add-port=8080/tcp
#Apply the permanent configuration to the runtime configuration
firewall-cmd --reload

In case you want to close the opened port again, you can use the following commands:

firewall-cmd --permanent --zone=public --remove-port=8080/tcp
firewall-cmd --reload

I had the very same issue, but in my case the root cause was different, so I think it could help people to share it as well here.

In my case, I realized that when ipv6 is enabled on my all new system based on ubuntu and 2.4 M4, openhab listen on port 8080 on the ipv6 address only, while the log frontend listent on the ipv4 . As soon as I disabled ipv6 and reboot my soc, the openhab was now accessible from the network.