OH 3.3.0 Frontail not Starting after fresh installation

The file /etc/systemd/system/frontail.service is missing.
Its content needs to be

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

[Service]
Type=simple
ExecStart=/usr/lib/node_modules/frontail/bin/frontail --disable-usage-stats --ui-highlight --ui-highlight-preset /usr/lib/node_modules/frontail/preset/openhab_AEM.json --theme openhab_AEM --lines 2000 --number 200 /var/log/openhab/openhab.log /var/log/openhab/events.log
Restart=always
User=frontail
Group=openhab
Environment=PATH=/usr/bin/
Environment=NODE_ENV=production
WorkingDirectory=/usr/bin/

[Install]
WantedBy=multi-user.target

Afterwards following commands enable the service:

sudo chmod 644 /etc/systemd/system/frontail.service
sudo systemctl -q daemon-reload
sudo systemctl enable --now frontail.service
sudo systemctl restart frontail.service
2 Likes

@Wolfgang_S : Thanks a lot! Frontail is now working, after creating the systemd service as described above.

1 Like

Hi there,
I seem to be in a similar position.
Fresh Installation on Raspi 4. Used β€œopenhabian-pi-raspios32-202208151955-gitbe9d23e-crc075defd9.img.xz”. Installation works smooth, OH 3.3.0 comes up and runs. Frontail missing. As I heavily rely on logs when configuring this is a showstopper for me (Have a working OH 2.5.12).
Firstboot has the following content

...
2022-11-28_22:21:48_CET [openHABian] Installing Frontail prerequsites (NodeJS)... OK
2022-11-28_22:22:29_CET [openHABian] Installing openHAB Log Viewer (frontail)... FAILED (install)
Failed to open terminal.
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Frontail not installed β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                                              β”‚
β”‚ Frontail is not installed!                                                   β”‚
β”‚                                                                              β”‚
β”‚ Canceling operation!                                                         β”‚
β”‚                                                                              β”‚
β”‚                                    <Ok>                                      β”‚
β”‚                                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
...

Followed the discussion here. Found that the file frontail.service was missing in /etc/systemd/system/ and /etc/systemd/system/multi-user.target.wants/.
Copied it to those directories. Tried manual installation (openhabian-config option 21). Still did get the error message. (There was an error or interruption during the execution of: β€œ20 | Optional Components”
Then did the following:

openhabian@openhabian:/etc/systemd/system $ sudo chmod 644 /etc/systemd/system/frontail.service
openhabian@openhabian:/etc/systemd/system $ sudo systemctl -q daemon-reload
openhabian@openhabian:/etc/systemd/system $ sudo systemctl enable --now frontail.service
Failed to enable unit: File /etc/systemd/system/multi-user.target.wants/frontail.service already exists.
openhabian@openhabian:/etc/systemd/system $ sudo systemctl restart frontail.service

Frontail is now working (also after reboot) - even if an installation with option 21 still produces the same error message. It looks completely different - compared to OH2 - but I think I can get used to it.

Thanks for all the hints (although I was a bit puzzled that the basic stuff in a standard setup isn’t working).
Cheers Frank

I followed the fix in OH 3.3.0 Frontail not Starting after fresh installation - #61 by Wolfgang_S and was able to get this working as well - http://[ip]:9001 works now. However, upon opening up the main link http://[ip]:8080, then clicking β€œOther Apps” in the upper-right corner, the Log Viewer link is not there - is there a way to add this manually? (I did try rebooting the device.)

I couldn’t agree more - doing a fresh install and a basic component not working is discouraging. I read all the back and forth, but it seems that this stopped working (or randomly stopped working since Markus cant duplicate it?) after the move from β€œNodeJS update to v16”, as indicated in Releases Β· openhab/openhabian Β· GitHub, starting with openHABian v1.7.4, though I have NOT tested this theory.

Have a look to /etc/openhab/services/runtime.cfg
There are three entries for an entry to be added e.g.:

org.openhab.core.ui.tiles:frontail-link-name=openHAB Log Viewer
org.openhab.core.ui.tiles:frontail-link-url=http://192.168.0.40:9001
org.openhab.core.ui.tiles:frontail-link-imageurl=data:image/png;base64,iVBORw0KGgoA........

Last row is incomplete and needs to contain a base64 encoded png image.
The image data can be found in /opt/openhabian/includes/dashboard-imagedata

1 Like

FYI: openhabian-pi-raspios32-202203300347-git1305ac7-crcc3eb5287.img Frontail fails install as well.

This is frustrating. About 6-9 months ago I installed openhabian-pi-raspios32-202111152140-git101ce3a-crcb86f6338.img.xz successfully. I tried installing it now and Frontail works! …But openhab doesnt installed properly! I see a β€œOpenJDK Zulu11-32… FAILED” error so I’m assuming that’s why. The transition from Zulu to OpenJDK is in the release notes, but one can see that the last year of β€œSTABLE” releases can’t do a successful fresh install.

Thank you @Wolfgang_S !

OH 3.3.0 Frontail not Starting after fresh installation - #61 by Wolfgang_S got Fronttail working.
OH 3.3.0 Frontail not Starting after fresh installation - #65 by Wolfgang_S added the link to the dashboard.

1 Like

hello,

for your information. with the latest version the frontail.service works immediately.

But i can’t install the deconz -service via openhabian-config now… I always get an error message.

it’s a real shame that when you take the time to reinstall, there’s always a problem somewhere. soon i’ll give up…

the real shame is having to read comments like this as someone who has put many times the time into building openHABian that you did. Needless to say for your benefit, for free.

the detailed version of that message should help to identify the root cause of the problem.

yes, you are right.
i wrote that in the immediate emotions i had after hours of troubleshooting.

i didn’t mean anyone personally. that came out wrong.
and yes, i appreciate your support very much, sorry.

1 Like

Hello,
I have also problems to start frontail:

I have installed openhab (Version 4.0.2) on raspberry pi Version 4 with 4GB:

sudo apt-get install openhab
  • Installed Java 17
sudo apt install openjdk-17-jdk -y

I started Openhab and made the setup and its running fine.
Then I reconized that frontail doesn’t run, so I tryed to install frontail (GitHub - mthenw/frontail: πŸ“ streaming logs to the browser. Sponsored by https://cloudash.dev)

sudo npm i frontail -g

Result: no npm installed!

I need node.js for installation (Version Node Major 20) (GitHub - nodesource/distributions: NodeSource Node.js Binary Distributions)

sudo apt-get install nodejs -y

Now I can start frontail with:

sudo frontail /var/log/openhab/openhab.log /var/log/openhab/events.log

And I can see in the Browser with ip:9001 that its running.

I want to start frontail as a sevice and no frontail.service ist installed. So I added the file with:

sudo nano /etc/systemd/system/frontail.service

I put this into the file:

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

[Service]
Type=simple
ExecStart=/usr/lib/node_modules/frontail/bin/frontail --disable-usage-stats --ui-highlight --ui-highlight-preset /usr/lib/node_modules/frontail/preset/openhab_AEM.json --theme openhab_AEM --lines 2000 --number 200 /var/log/openhab/openhab.log /var/log/openhab/events.log
Restart=always
User=frontail
Group=openhab
Environment=PATH=/usr/bin/
Environment=NODE_ENV=production
WorkingDirectory=/usr/bin/

[Install]
WantedBy=multi-user.target  

And made this commands:

sudo chmod 644 /etc/systemd/system/frontail.service
sudo systemctl -q daemon-reload
sudo systemctl enable --now frontail.service
sudo systemctl restart frontail.service

When I check the status its not runnung and I get this:

frontail.service - Frontail openHAB instance, reachable at http://openhab4:9001
     Loaded: loaded (/etc/systemd/system/frontail.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2023-09-05 12:42:21 CEST; 27s ago
       Docs: https://github.com/mthenw/frontail
    Process: 10486 ExecStart=/usr/lib/node_modules/frontail/bin/frontail --disable-usage-stats --ui-highlight   --ui-highlight-preset /usr/lib/node_modules/frontail/preset/openhab_AEM.json --theme openhab_AEM --lines 2000 --number 200 /va>
   Main PID: 10486 (code=exited, status=217/USER)
        CPU: 0

  Sep 05 12:42:21 openhab4 systemd[1]: frontail.service: Scheduled restart job, restart counter is at 5.
  Sep 05 12:42:21 openhab4 systemd[1]: Stopped Frontail openHAB instance, reachable at http://openhab4:9001.
  Sep 05 12:42:21 openhab4 systemd[1]: frontail.service: Start request repeated too quickly.
  Sep 05 12:42:21 openhab4 systemd[1]: frontail.service: Failed with result 'exit-code'.
  Sep 05 12:42:21 openhab4 systemd[1]: Failed to start Frontail openHAB instance, reachable at http://openhab4:9001.

Now I have no more idea how to solve it. Has anyone solved this? Or am I just not understanding the solution here?

Have you tried to install frontail service from openhabian-config?

I’m not sure if that’s possible. I haven’t installed openhabian. I just installed openhab on debian (Raspberry Pi OS).
Maybe this is the problem with the frontail.service file? But how can I fix this?

Now I found the Problem.

When I execute this in the shell:

/usr/lib/node_modules/frontail/bin/frontail --disable-usage-stats --ui-highlight --ui-highlight-preset /usr/lib/node_modules/frontail/preset/openhab_AEM.json --theme openhab_AEM --lines 2000 --number 200 /var/log/openhab/openhab.log /var/log/openhab/events.log

I get the error that openhab_AEM.json is mising. I changed it to default.json and then it works.

Hi All,

same thing here after update to OH 4. Is it actually possible to remove frontail via apt etc to reinstall it?
openhabian-config throws an error all the time and command line give this:

Any further ideas?

EDIT:
i got this with sudo journalctl -u frontail

Also upgrade to 4.1.0M1 but no luck.
However systemctl status frontail.service returns:

It is absolutly weird. Tried also to uninstall and reinstall frontail via npm but no difference.
Also installing the cookie-parser again via npm. nothing…

Frontail is independent of the OH release.
It depends on the npm version and related modules.
Does journalctl still show the same error message ?

Please copy / paste the messages and use code tags. It is not easy to read screenshots depending on one’s eye age …

Thanks for coming back on this. Yes, sorry please see below.
For whatever reason, openhab_AEM.json is within the folder.

openhabian@openhabian:~ $ sudo journalctl -u frontail
[sudo] password for openhabian:
-- Journal begins at Thu 2023-09-14 11:53:27 CEST, ends at Thu 2023-09-14 12:38:40 CEST. --
Sep 14 11:53:27 openhabian frontail[22030]:     at Object.<anonymous> (/usr/lib/node_modules/frontail/bin/frontail:2:1)
Sep 14 11:53:27 openhabian frontail[22030]:     at Module._compile (node:internal/modules/cjs/loader:1198:14)
Sep 14 11:53:27 openhabian frontail[22030]:     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252>Sep 14 11:53:27 openhabian systemd[1]: frontail.service: Main process exited, code=exited, status=1/FAILURE
Sep 14 11:53:27 openhabian systemd[1]: frontail.service: Failed with result 'exit-code'.
Sep 14 11:53:27 openhabian systemd[1]: frontail.service: Consumed 2.017s CPU time.
Sep 14 11:53:27 openhabian systemd[1]: frontail.service: Scheduled restart job, restart counter is at 2230.
Sep 14 11:53:27 openhabian systemd[1]: Stopped Frontail openHAB instance, reachable at http://openhabian:9001.
Sep 14 11:53:27 openhabian systemd[1]: frontail.service: Consumed 2.017s CPU time.
Sep 14 11:53:27 openhabian systemd[1]: Started Frontail openHAB instance, reachable at http://openhabian:9001.
Sep 14 11:53:29 openhabian frontail[22040]: /usr/lib/node_modules/frontail/index.js:121
Sep 14 11:53:29 openhabian frontail[22040]:       throw new Error(`Preset file ${presetPath} doesn't exists`);
Sep 14 11:53:29 openhabian frontail[22040]:       ^
Sep 14 11:53:29 openhabian frontail[22040]: Error: Preset file /usr/lib/node_modules/frontail/preset/openhab_AEM.json d>Sep 14 11:53:29 openhabian frontail[22040]:     at Object.<anonymous> (/usr/lib/node_modules/frontail/index.js:121:13)
Sep 14 11:53:29 openhabian frontail[22040]:     at Module._compile (node:internal/modules/cjs/loader:1198:14)
Sep 14 11:53:29 openhabian frontail[22040]:     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252>Sep 14 11:53:29 openhabian frontail[22040]:     at Module.load (node:internal/modules/cjs/loader:1076:32)
Sep 14 11:53:29 openhabian frontail[22040]:     at Function.Module._load (node:internal/modules/cjs/loader:911:12)
Sep 14 11:53:29 openhabian frontail[22040]:     at Module.require (node:internal/modules/cjs/loader:1100:19)
Sep 14 11:53:29 openhabian frontail[22040]:     at require (node:internal/modules/cjs/helpers:119:18)
Sep 14 11:53:29 openhabian frontail[22040]:     at Object.<anonymous> (/usr/lib/node_modules/frontail/bin/frontail:2:1)
Sep 14 11:53:29 openhabian frontail[22040]:     at Module._compile (node:internal/modules/cjs/loader:1198:14)
Sep 14 11:53:29 openhabian frontail[22040]:     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252>Sep 14 11:53:29 openhabian systemd[1]: frontail.service: Main process exited, code=exited, status=1/FAILURE
Sep 14 11:53:29 openhabian systemd[1]: frontail.service: Failed with result 'exit-code'.
Sep 14 11:53:29 openhabian systemd[1]: frontail.service: Consumed 2.103s CPU time.
Sep 14 11:53:29 openhabian systemd[1]: frontail.service: Scheduled restart job, restart counter is at 2231.
Sep 14 11:53:29 openhabian systemd[1]: Stopped Frontail openHAB instance, reachable at http://openhabian:9001.
Sep 14 11:53:29 openhabian systemd[1]: frontail.service: Consumed 2.103s CPU time.
Sep 14 11:53:29 openhabian systemd[1]: Started Frontail openHAB instance, reachable at http://openhabian:9001.
Sep 14 11:53:31 openhabian frontail[22054]: /usr/lib/node_modules/frontail/index.js:121
Sep 14 11:53:31 openhabian frontail[22054]:       throw new Error(`Preset file ${presetPath} doesn't exists`);
Sep 14 11:53:31 openhabian frontail[22054]:       ^
Sep 14 11:53:31 openhabian frontail[22054]: Error: Preset file /usr/lib/node_modules/frontail/preset/openhab_AEM.json d>Sep 14 11:53:31 openhabian frontail[22054]:     at Object.<anonymous> (/usr/lib/node_modules/frontail/index.js:121:13)
Sep 14 11:53:31 openhabian frontail[22054]:     at Module._compile (node:internal/modules/cjs/loader:1198:14)
Sep 14 11:53:31 openhabian frontail[22054]:     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252>Sep 14 11:53:31 openhabian frontail[22054]:     at Module.load (node:internal/modules/cjs/loader:1076:32)
Sep 14 11:53:31 openhabian frontail[22054]:     at Function.Module._load (node:internal/modules/cjs/loader:911:12)
Sep 14 11:53:31 openhabian frontail[22054]:     at Module.require (node:internal/modules/cjs/loader:1100:19)
lines 1-42...skipping...
-- Journal begins at Thu 2023-09-14 11:53:27 CEST, ends at Thu 2023-09-14 12:38:40 CEST. --
Sep 14 11:53:27 openhabian frontail[22030]:     at Object.<anonymous> (/usr/lib/node_modules/frontail/bin/frontail:2:1)
Sep 14 11:53:27 openhabian frontail[22030]:     at Module._compile (node:internal/modules/cjs/loader:1198:14)
Sep 14 11:53:27 openhabian frontail[22030]:     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)

And when using openhabian-config tool β†’ menu 20 i can see this in the shell:

2023-09-14_12:43:32_CEST [openHABian] Updating Linux package information... OK
2023-09-14_12:43:42_CEST [openHABian] Installing Frontail prerequsites (NodeJS)... OK
npm WARN cli npm v10.1.0 does not support Node.js v16.20.2. This version of npm supports the following node versions: `^18.17.0 || >=20.5.0`. You can find the latest version at https://nodejs.org/.
2023-09-14_12:44:14_CEST [openHABian] Installing openHAB Log Viewer (frontail)... OK
2023-09-14_12:44:43_CEST [openHABian] Setting up openHAB Log Viewer (frontail) service... OK
2023-09-14_12:44:46_CEST [openHABian] Adding an openHAB dashboard tile for 'frontail'... Replacing... OK
fatal: detected dubious ownership in repository at '/opt/openhabian'
To add an exception for this directory, call:

        git config --global --add safe.directory /opt/openhabian
fatal: detected dubious ownership in repository at '/opt/openhabian'
To add an exception for this directory, call:

        git config --global --add safe.directory /opt/openhabian
fatal: detected dubious ownership in repository at '/opt/openhabian'
To add an exception for this directory, call:

        git config --global --add safe.directory /opt/openhabian

This

sounds like npm vs node are not compatible.

See e.g. How To Fix "npm version is not compatible with node.js version" Error | DeviceTests
I have no experience with the described steps. So I can’t say something about if it will solve the problem or make it worse.

What does update in this case mean ? Really only an update from OH3 to OH4 using apt or was this even an upgrade from an earlier OS version to bullseye ?

Hi.
It was a regular update via apt from OH 3 to OH 4. OS was already Bullseye.
Regardding npm and node.js. System is running currently under Node JS 20 and npm 10.1. Still no frontail.
However downgrading to Node JS 16, which automatically changes npm version to 9.8.1 also doesnt work.

I wonder if a clean install of OHian andimprting the backup would help!?