Port for logging not longer working

I guess I messed something up when I tried to enable debugging with VSCode with my windows machine. Now IP:9001 is not producing the log output any more.

On my raspi I used

sudo systemctl stop openhab.service 
sudo openhab-cli start --debug

to start in the debugging mode. Debugging mode was working - more or less.

ps -auxw < grep openhabian shows:

openhab   7295 93.2  5.5 535732 221092 ?       Ssl  17:31   0:37 /usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr/share/openhab -Dopenhab.conf=/etc/openhab -Dopenhab.runtime=/usr/share/openhab/runtime -Dopenhab.userdata=/var/lib/openhab -Dopenhab.logdir=/var/log/openhab -Dfelix.cm.dir=/var/lib/openhab/config -Djava.library.path=/var/lib/openhab/tmp/lib -Djetty.host=0.0.0.0 -Djetty.http.compliance=RFC2616 -Dnashorn.args=--no-deprecation-warning -Dorg.apache.cxf.osgi.http.transport.disable=true -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 -Xms192m -Xmx320m --add-reads=java.xml=java.logging --add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED --patch-module java.base=/usr/share/openhab/runtime/lib/endorsed/org.apache.karaf.specs.locator-4.3.2.jar --patch-module java.xml=/usr/share/openhab/runtime/lib/endorsed/org.apache.karaf.specs.java.xml-4.3.2.jar --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.naming/javax.naming.spi=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.file=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.ftp=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED --add-exports=java.base/sun.net.www.content.text=ALL-UNNAMED --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED --add-exports java.security.sasl/com.sun.security.sasl=ALL-UNNAMED -Dkaraf.instances=/var/lib/openhab/tmp/instances -Dkaraf.home=/usr/share/openhab/runtime -Dkaraf.base=/var/lib/openhab -Dkaraf.data=/var/lib/openhab -Dkaraf.etc=/var/lib/openhab/etc -Dkaraf.log=/var/log/openhab -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/var/lib/openhab/tmp -Djava.util.logging.config.file=/var/lib/openhab/etc/java.util.logging.properties -Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -classpath /usr/share/openhab/runtime/lib/boot/org.apache.karaf.diagnostic.boot-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.jaas.boot-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.main-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/org.apache.karaf.specs.activator-4.3.2.jar:/usr/share/openhab/runtime/lib/boot/osgi.core-7.0.0.jar:/usr/share/openhab/runtime/lib/jdk9plus/istack-commons-runtime-3.0.10.jar:/usr/share/openhab/runtime/lib/jdk9plus/jakarta.xml.bind-api-2.3.3.jar:/usr/share/openhab/runtime/lib/jdk9plus/javax.activation-1.2.0.jar:/usr/share/openhab/runtime/lib/jdk9plus/javax.annotation-api-1.3.1.jar:/usr/share/openhab/runtime/lib/jdk9plus/jaxb-runtime-2.3.3.jar:/usr/share/openhab/runtime/lib/jdk9plus/txw2-2.3.3.jar org.apache.karaf.main.Main

log:display in the Karaf console is working fine.

Is there a way to get back to the original setup? { My backup is older than a month :}

You use port 9001 for frontail, right ?
What does

netstat -tulpn

show ? Search for port 9001 resp. frontail. Is it listed ? If not frontail is not running.

Yes, that is part of the standard installation of openhab 3.0.
I find:


tcp        0      0 0.0.0.0:9001            0.0.0.0:*               LISTEN      -

tcp6       0      0 :::8080                 :::*                    LISTEN      -

and a similar entry for port 8443, 8080 is working and used for paperUI.
No entry for 5005 which I used for debugging
The entry for 9001 has 0.0.0.0. in front instead of ::

Hm - I reinstalled frontail and now I can see the entries of events.log and openhabian.log but only entries which are from 6 hours before, newer entries visible with tail in putty are not shown.

Is the parameter

-XX:-UsePerfData

shown in ps -auxw correct?
Where do I find the config / parameters to start openhab?

… I think that is not correct. frontail uses port 9001 in case it would be a standard port of OH3 frontail would not be able to use that port. Unfortunately the last column of the output of the netstat command is missing. It should listen the process that is running on that port. In case of frontail it should list node. In case of openhab it would show java.

is part of the ps output here as well.

that means it is listening on IPv4 addresses instead of on IPv6 addresses as also identified by tcp vs. tcp6.

=> openhab.log

what would you like to change ?

Thank you for helping me. The problem doesn’t seem to be related to frontail.
netstat -tulpn shows

tcp        0      0 0.0.0.0:9001            0.0.0.0:*               LISTEN      -

and IP:9001 is showing output ending yesterday at 17:30.

So I looked at /var/log/openhab:

-rw-rw-r-- 1 openhab openhab          0 Jan 15 17:54 audit.log
-rw-r--r-- 1 root    root         26476 Jun 12 17:30 events.log
-rw-r--r-- 1 openhab openhab     220545 Jun  9 17:49 events.log.1
 (up to 7)
-rw-r--r-- 1 root    root         77098 Jun 12 17:30 openhab.log
-rw-r--r-- 1 openhab openhab     347355 Jun  9 17:50 openhab.log.1
 (up to 7)

It seems that openhab stopped adding data to the logfiles yesterday at 17:30.

But when I invoke log:display from the Karaf console I get:

21:58:50.272 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'GoeCharger_Temperaturetma2' changed from UNDEF to 28.625 °C
21:58:50.856 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'FroniusSymoInverter_GridPower' changed from 10.07 to 4.78

Where can I look to correct this?

I guess I found the error myself.
In

somebody had a similar problem. He had to change the owner of /var/log/openhab.
I changed the owner of events.log and openhab.log to openhab:openhab
with sudo chown openhab:openhab events.log
Now IP:9001 is working again.

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.