OH3 - Logtail gone after restart openhab

  • Platform information:
    • Hardware: Raspberry Pi4.
    • OS: Openhabian 1.6.2 / Linux Debian
    • Java Runtime Environment: Java 11
    • openHAB version: 3.0

After restart openhab > sudo systemctl stop/start openhab.service, logtail won’t come back > http://192.168.0.36:9001. The only way to get it back online is to reinstall it via openhabian-config (option 21).

Not sure how to solve or analyse this problem.

I am not running openhabian but installed frontail manually on OH3, did you try to start frontail via CLI manually to see if it is still there? Command is github.

did not try that, but will do when I have to restart again. I will keep this thread updated.

Thank!

That command on github isn’t right, it should be: tail -f /var/log/openhab/openhab.log /var/log/openhab/events.log

But when I execute it, it see the logging of both files in my console. But 192.168.0.36:9001 shows: ERR_CONNECTION_REFUSED

Sounds like a port not opened or blocked on the raspberry pi. After openhabian-config > option 21 it works again, so there must be a command excuted that opens the port.

[edit] looks like the service never starts at openhab start. When these two are executed:

2021-01-04_11:17:40_CET [openHABian] Setting up openHAB Log Viewer (frontail) service... OK
2021-01-04_11:17:43_CET [openHABian] Adding an openHAB dashboard tile for 'frontail'... Replacing... OK

after entering option 21 in openhabian-config, the site is accessible again

What is the output of

sudo journalctl -u frontail

resp.

sudo systemctl status frontail.service

after a restart / reboot of your system.
The output should give hints about why the service was not started.

sudo journalctl -u frontail

Jan 03 11:53:43 openHABianDevice frontail[623]: tail: '/var/log/openhab/openhab.log' has been replaced;  following new file
Jan 04 10:06:09 openHABianDevice systemd[1]: Stopping Frontail openHAB instance, reachable at http://openHABianDevice:9001...
Jan 04 10:06:09 openHABianDevice systemd[1]: frontail.service: Succeeded.
Jan 04 10:06:09 openHABianDevice systemd[1]: Stopped Frontail openHAB instance, reachable at http://openHABianDevice:9001.
Jan 04 10:09:47 openHABianDevice systemd[1]: Started Frontail openHAB instance, reachable at http://openHABianDevice:9001.
Jan 04 10:50:12 openHABianDevice systemd[1]: Stopping Frontail openHAB instance, reachable at http://openHABianDevice:9001...
Jan 04 10:50:12 openHABianDevice systemd[1]: frontail.service: Succeeded.
Jan 04 10:50:12 openHABianDevice systemd[1]: Stopped Frontail openHAB instance, reachable at http://openHABianDevice:9001.
Jan 04 10:52:13 openHABianDevice systemd[1]: Started Frontail openHAB instance, reachable at http://openHABianDevice:9001.
Jan 04 11:10:56 openHABianDevice systemd[1]: Stopping Frontail openHAB instance, reachable at http://openHABianDevice:9001...
Jan 04 11:10:56 openHABianDevice systemd[1]: frontail.service: Succeeded.
Jan 04 11:10:56 openHABianDevice systemd[1]: Stopped Frontail openHAB instance, reachable at http://openHABianDevice:9001.
Jan 04 11:17:42 openHABianDevice systemd[1]: Started Frontail openHAB instance, reachable at http://openHABianDevice:9001.

It looks like the systemd is stopped when openhab stops but never started when openhab starts. The log’s we see are the ones after executing option 21 in openhabian-config I think.

[edit]

Can confirm, the service isn’t started after openhab starts. When i manually start the service: sudo systemctl start frontail.service its working like before. Some bug in the new OH3 i guess?

The frontail.service description file contains ( should contain ) PartOf=openhab.service.
This is why frontail is being stopped once openhab.service is stoppend and it also should be started once openhab.serivce is being started.

You may run “sudo journalctl” without “-u frontail” to get a more verbose logging from/for the other services.

Checked the journal but not sure what i can do. How should this be fixed you think?

I want to bump this question:
I have a bash script that stops and starts openhab, works fine execpt for frontail not starting anymore

sudo systemctl start openhab

is used to start openhab

Any ideas?

what does that mean ? openhab is not started during boot but manually after booting by running your script ?

Hi Wolfgang.
I’m trying to get backup/restore working from within OH. Backup works fine, but for restore I need to stop OH; resotore; start OH. Which works fine except from frontail not starting anymore.
A sudo reboot did not start it either.
To be more precise: I can see the log until earlier this morning, before I started messing up the system, but no new entries are made.

Hi pspl,
please excuse that I am asking one more question:
you wrote:

and

from your wording on one hand it sounds like frontail does not start ( that would mean your browser connection to frontail must get a timeout as the port 9001 must be closed if frontail does not start ) on the other hand it sounds like you have access to frontail but you do not see any new log entries in frontail. Of course it also could mean that you used tail / more / vi or whatever to check the content of the files /var/log/openhab/openhab.log resp. /var/log/openhab/events.log itself.

Would you please describe this a bit more in detail so that it’s more clear.
Thank you.

thanks for the patience.

I can access the existing event.log file using “myOpenhab_IP”.9001. It shows me all that is inside the event.log.
Using nano event.log I can see the same entries like the ones I can see in the web browser. It looks like the events are no longer written to the events.log file: the last entry was a couple of hours ago.
The openhab.log stopped logging at the same timepoint.

OK - thanks for clarifying. That is different compared to what happened to the person that opened this thread. While in that case frontail did not start in your case it looks like no additional entries are added to the log files and thus they are not shown in frontail.
You use OH3, right ? The backup that you restored contains OH3 data ?
There is a file /var/lib/openhab/etc/log4j2.xml and that file ( it describes what to log where ) looks ok ?

I ended up deleting all files in /var/log/openhab/ and restarting openhab.service, waiting for 3 min, restart frontail.service. That did the trick and log’s are working again.
My backup bash-script now works when called als user openhab form command line, but using a rule a keep getting command not on exec.whitelist. I added the command to exec.whitelist and it does work for my backup command, not for my backup script. I’ll have to figure that one out later.

1 Like

Same here except I didn’t have to delete those files. Just stop openhab, restart logtail service and start again. After that never had a problem anymore.

[edit] - upgraded to openhab 3.1.0 snapshot, same problem again, reload fronttail solved it again…

I have the same problem.
I see many events in the log and than it stops this morning at 3 o’clock no more events did come in to the log ?
Restart the Raspberry PI and everything is OK till 1, 2 or 3 days depending on the many event there are coming !

Hello are you dutch ? That reads better for me. or maybe you can go to private massage ? I do not know if that is possible ?

But for now in English :slight_smile:

I have the same problem.
I see many events in the log and than it stops this morning at 3 o’clock no more events did come in to the log ?
Restart the Raspberry PI and everything is OK till 1, 2 or 3 days depending on the many event there are coming !

can you explain me what you did do i have the same problem !

Same problem here,
Logging just stopped at 6-7-2021 00:00:18 :smile:
Event logfiles also stopped at that point.

Frontail service is running okay but no events are added to the events log.
Stopping and starting the log service is not helping in any way. Restarting OH also
not solving anything. frontail service file looking okay.

Will empty my openhab log folder and or delete my cache and see what happens.

While migrating from openHab2 to 3 I noticed that the tailer was still pointing to the logs location for hab2.
I addressed this by changing this file: /etc/systemd/system/frontail.service and altered the line:
ExecStart=/usr/lib/node_modules/frontail/bin/frontail --ui-highlight --ui-highlight-preset /usr/lib/node_modules/frontail/preset/openhab.json -t openhab -l 2000 -n 200 /var/log/openhab2/openhab.log /var/log/openhab2/events.log
to:
ExecStart=/usr/lib/node_modules/frontail/bin/frontail --ui-highlight --ui-highlight-preset /usr/lib/node_modules/frontail/preset/openhab.json -t openhab -l 2000 -n 200 /var/log/openhab/openhab.log /var/log/openhab/events.log
Then restarted the service with: sudo service frontail restart
This fixed my issue where the logs did not pick up the new logs with openhab3.