Openhab Logviewer died on me - Solved

Hi All. i have resently upgraded my ubunth to the new lts. and now my log viewer seems not to work no more.
it shows on my gui . but once you click on it to go to port 9001. it just gives me This site can’t be reached.

i have a video of it .

The log viewer is a wholly separate third party application called Frontail. Check systemd to see if Frontail is running and whether it’s running into problems. If it is, looking on a Frontain forum will more likely lead to a solution.

this is all i get, did try to restart it but stil get the output.

[19:29:32] openhab@openhab:~$ systemctl status frontail.service
● frontail.service - Frontail openHAB instance, reachable at http://openhab:9001
     Loaded: loaded (/etc/systemd/system/frontail.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2020-10-05 19:29:33 SAST; 2s ago
       Docs: https://github.com/mthenw/frontail
             https://github.com/openhab/openhabian/issues/28
    Process: 151414 ExecStart=/usr/bin/frontail --ui-highlight --ui-highlight-preset /usr/lib/node_modules/frontai>
   Main PID: 151414 (code=exited, status=127)

Oct 05 19:29:33 openhab systemd[1]: frontail.service: Scheduled restart job, restart counter is at 4.
Oct 05 19:29:33 openhab systemd[1]: Stopped Frontail openHAB instance, reachable at http://openhab:9001.
Oct 05 19:29:33 openhab systemd[1]: Started Frontail openHAB instance, reachable at http://openhab:9001.
Oct 05 19:29:33 openhab systemd[1]: frontail.service: Main process exited, code=exited, status=127/n/a
Oct 05 19:29:33 openhab systemd[1]: frontail.service: Failed with result 'exit-code'.
Oct 05 19:29:33 openhab systemd[1]: frontail.service: Scheduled restart job, restart counter is at 5.
Oct 05 19:29:33 openhab systemd[1]: Stopped Frontail openHAB instance, reachable at http://openhab:9001.
Oct 05 19:29:33 openhab systemd[1]: frontail.service: Start request repeated too quickly.
Oct 05 19:29:33 openhab systemd[1]: frontail.service: Failed with result 'exit-code'.
Oct 05 19:29:33 openhab systemd[1]: Failed to start Frontail openHAB instance, reachable at http://openhab:9001.

What is the output of

sudo journalctl -u fronttail.service -b

Logs begin at Mon 2020-08-17 11:12:32 SAST, end at Mon 2020-10-05 19:38:12 SAST. –
– No entries –

Do you use ZRAM setup ?
What is the content of your frontail.service file ?

no not that i am aware of

not sure how to check

It seems possible if not probable that Frontail installed is not compatible with the new Ubuntu LTS. the first thing I would do is reinstall Frontail and if that doesn’t work go to the Frontail github repo and look at their issues to see if there is a known problem. Often one can find a work around in the comments to such an issue.

22:17:14] openhab@openhab:~$ sudo systemctl status frontail
● frontail.service - Frontail openHAB instance, reachable at http://openhab:9001
     Loaded: loaded (/etc/systemd/system/frontail.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2020-10-05 22:16:49 SAST; 27s ago
       Docs: https://github.com/mthenw/frontail
             https://github.com/openhab/openhabian/issues/28
    Process: 241175 ExecStart=/usr/bin/frontail --ui-highlight --ui-highlight-preset /usr/lib/node_modules/frontail/preset/openhab.json -t openhab -l 2000 -n 200 /var/log/openha>
   Main PID: 241175 (code=exited, status=1/FAILURE)

Oct 05 22:16:49 openhab systemd[1]: frontail.service: Scheduled restart job, restart counter is at 10.
Oct 05 22:16:49 openhab systemd[1]: Stopped Frontail openHAB instance, reachable at http://openhab:9001.
Oct 05 22:16:49 openhab systemd[1]: frontail.service: Start request repeated too quickly.
Oct 05 22:16:49 openhab systemd[1]: frontail.service: Failed with result 'exit-code'.
Oct 05 22:16:49 openhab systemd[1]: Failed to start Frontail openHAB instance, reachable at http://openhab:9001.

i have tried everything. from re installing it. it even fails on the install via openhabian config
cant find much on this

I think the file is located at /etc/systemd/system/frontail.service. What is the content.

[Unit]
Description=Frontail openHAB instance, reachable at http://%H:9001
Documentation=https://github.com/mthenw/frontail
Documentation=https://github.com/openhab/openhabian/issues/28
After=openhab2.service

[Service]
Type=simple
ExecStart=/usr/bin/frontail --ui-highlight --ui-highlight-preset /usr/lib/node_modules/frontail/preset/openhab.json ->
Restart=always
User=openhab
Group=openhab
Environment=PATH=/usr/bin/
Environment=NODE_ENV=production
WorkingDirectory=/usr/bin/

[Install]
WantedBy=multi-user.target

That is what is in the file.

The ExecStart entry is truncated.
Can you login to your OH instance and run

sudo -u openhab <ExecStartEntry>

Replace the part with the complete part that is to the right part of the = sign in the service file.
After you executed this command can you view the logfile in the browser or do you get an error message ?

not sure do you mean like this ?

[08:18:52] openhab@openhab:~$ sudo -u openhab /usr/bin/frontail --ui-highlight --ui-highlight-preset /usr/lib/node_modules/frontail/preset/openhab.json

if i run that i get this output : “Arguments needed, use --help”

Maybe related.
I had the same issue after upgrading from OpenHab2 2.5.8 to 2.5.9; both in the stable and master branch of openhabian.

Issue was that the username is hardcoded(?) in “/etc/systemd/system/frontail.service”

User=openhab

As I manually installed OpenHab(ian) on my Ubuntu 20.04.1 LTS my username is not “openhab”.
After changing the user to my user it worked again.
I never had this issue in the past, it started with the upgrade to 2.5.9 yesterday.

I think mit could be. here is a screen grabe of myne.

You may have missed that openHABian does not support Ubuntu. It never did BTW.

We actually wanted to support it but turns out too many of the optional components - frontail being among - keep changing often and don’t work on Ubuntu while on Debian which is what we develop on they do. We cannot spend the time it would need to work that out so we dropped the support plan.
If you figure it out drop me a note please (or to openhabian maintainers via Github).

thanks for the info. will check to move over to Debian. will investigate if my other programs will run on it. or do i stay on Ubunth that i only now have started to understand a bit ?

The command line is not complete. At least the log files to be shown are missing.
I think the complete command line should look like:

sudo -u openhab /usr/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

The openhabian group seems to be missing. This is why the user is not being added.
Check if it is missing. If it is missing add it and try to add the user again.

IT IS BORN AGAIN.

sudo addgroup openhabian
[sudo] password for openhab:
Adding group `openhabian' (GID 1001) ...
Done.
[14:26:08] openhab@openhab:~$ sudo openhabian-config
2020-10-08_14:26:15_SAST [openHABian] Checking for root privileges... OK
2020-10-08_14:26:16_SAST [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2020-10-08_14:26:16_SAST [openHABian] openHABian configuration tool version: [stable]v1.6-880(769ea17)
2020-10-08_14:26:30_SAST [openHABian] Checking for changes in origin branch HEAD... OK
2020-10-08_14:26:47_SAST [openHABian] Switching to branch stable... OK
2020-10-08_14:27:06_SAST [openHABian] Updating Linux package information... OK

$ useradd --groups openhabian,openhab -s /bin/bash -d /var/tmp frontail
2020-10-08_14:29:12_SAST [openHABian] Updating openHAB Log Viewer (frontail)...
$ npm update --force -g frontail
npm WARN using --force I sure hope you know what you are doing.
OK
2020-10-08_14:29:31_SAST [openHABian] Configuring openHAB Log Viewer (frontail)...
$ mkdir -p /usr/lib/node_modules/frontail/preset /usr/lib/node_modules/frontail/web/assets/styles

$ rm -rf /usr/lib/node_modules/frontail/preset/default.json /usr/lib/node_modules/frontail/preset/npmlog.json /usr/lib/node_modules/frontail/preset/python.json /usr/lib/node_modules/frontail/web/assets/styles/bootstrap.min.css /usr/lib/node_modules/frontail/web/assets/styles/dark.css /usr/lib/node_modules/frontail/web/assets/styles/default.css

$ cp /opt/openhabian/includes/frontail-preset.json /usr/lib/node_modules/frontail/preset/openhab.json

$ cp /opt/openhabian/includes/frontail-theme.css /usr/lib/node_modules/frontail/web/assets/styles/openhab.css
OK
2020-10-08_14:29:32_SAST [openHABian] Setting up openHAB Log Viewer (frontail) service...
$ chmod 644 /etc/systemd/system/frontail.service

$ systemctl enable --now frontail.service
OK
2020-10-08_14:29:57_SAST [openHABian] Adding an openHAB dashboard tile for 'frontail'... Replacing...
$ sed -i -e /^frontail.link.*$/d /etc/openhab2/services/dashboard.cfg
OK
\2020-10-08_14:30:31_SAST [openHABian] We hope you got what you came for! See you again soon ;)
[14:30:31] openhab@openhab:~$ \
1 Like