Issue with Frontail path after upgrade to OH3

After upgrading to OH3 I cannot start frontail anymore. It looks like I have to adjust a path from /var/lib/openhab2 to /var/lib/openhab somewhere, but I have no idea where.
I have already corrected paths in frontail.service. Does someone have any idea?

Dec 22 21:58:23 NUC systemd[1]: Started Frontail.
Dec 22 21:58:25 NUC frontail[15601]: /usr/lib/node_modules/frontail/node_modules/configstore/index.js:65
Dec 22 21:58:25 NUC frontail[15601]: #011#011#011throw error;
Dec 22 21:58:25 NUC frontail[15601]: #011#011#011^
Dec 22 21:58:25 NUC frontail[15601]: Error: EACCES: permission denied, mkdir ‘/var/lib/openhab2’
Dec 22 21:58:25 NUC frontail[15601]: You don’t have access to this file.
Dec 22 21:58:25 NUC frontail[15601]: at Object.mkdirSync (fs.js:757:3)
Dec 22 21:58:25 NUC frontail[15601]: at make (/usr/lib/node_modules/frontail/node_modules/make-dir/index.js:61:12)
Dec 22 21:58:25 NUC frontail[15601]: at make (/usr/lib/node_modules/frontail/node_modules/make-dir/index.js:68:5)
Dec 22 21:58:25 NUC frontail[15601]: at make (/usr/lib/node_modules/frontail/node_modules/make-dir/index.js:68:5)
Dec 22 21:58:25 NUC frontail[15601]: at Function.module.exports.sync (/usr/lib/node_modules/frontail/node_modules/make-dir/index.js:84:9)
Dec 22 21:58:25 NUC frontail[15601]: at Configstore.set all [as all] (/usr/lib/node_modules/frontail/node_modules/configstore/index.js:56:12)
Dec 22 21:58:25 NUC frontail[15601]: at Configstore.set (/usr/lib/node_modules/frontail/node_modules/configstore/index.js:88:12)
Dec 22 21:58:25 NUC frontail[15601]: at new Stats (/usr/lib/node_modules/frontail/lib/stats.js:21:14)
Dec 22 21:58:25 NUC frontail[15601]: at module.exports (/usr/lib/node_modules/frontail/lib/stats.js:67:37)
Dec 22 21:58:25 NUC frontail[15601]: at Object. (/usr/lib/node_modules/frontail/index.js:29:15)
Dec 22 21:58:25 NUC systemd[1]: frontail.service: Main process exited, code=exited, status=1/FAILURE
Dec 22 21:58:25 NUC systemd[1]: frontail.service: Failed with result ‘exit-code’.
Dec 22 21:58:25 NUC systemd[1]: frontail.service: Scheduled restart job, restart counter is at 5.
Dec 22 21:58:25 NUC systemd[1]: Stopped Frontail.
Dec 22 21:58:25 NUC systemd[1]: frontail.service: Start request repeated too quickly.
Dec 22 21:58:25 NUC systemd[1]: frontail.service: Failed with result ‘exit-code’.
Dec 22 21:58:25 NUC systemd[1]: Failed to start Frontail.

https://community.openhab.org/t/openhab-3-0-release-discussion/110751/38?u=hafniumzinc

I am running on a standard Ubuntu - so do you have a hint for me how to correct it manually?

My fix got rejected but thanks @hafniumzinc

@fluxflax can you try a reinstallation of frontail with openhabain config but switch to openHAB 3 branch ebfore doing this?

Switch branch:

image

reinstall frontail from the optional components.

1 Like

Have a look here then:

https://community.openhab.org/t/openhab-3-0-release-discussion/110751/31?u=confectrician

@Confectrician, thank you for the description. I have tried these steps already several times, but it did not work. I still get the error message. Any other ideas, where this old path could be kept in the context of frontail/node-js?

Have you read the posted information:
You would have to change the path in /etc/systemd/system/frontail.service. In this file you replace two occurrences of “openhab2” with just “openhab”.
?

1 Like

I have to give up then, sorry.
I have no further experience with a standalone installation of frontail.

Here ist my frontail.service - the only change I did was from /openhab2/ to /openhab/

[Unit]
Description=Frontail
Documentation=https://github.com/mthenw/frontail
Documentation=https://github.com/openhab/openhabian/issues/28
After=openhab.service

[Service]
Type=simple
ExecStart=/usr/bin/frontail -t dark --ui-highlight --ui-highlight-preset /usr/lib/node_modules/frontail/preset/openhab.json -l 2000 /var/log/openhab/openhab.log /var/log/openhab/events.log
Restart=always
User=openhab
Group=openhab
Environment=PATH=/usr/bin/
Environment=NODE_ENV=production
WorkingDirectory=/usr/bin/

[Install]
WantedBy=multi-user.target
Alias=frontail.service

you may have to check the access rights too.

Should be ok.
I would suggest to search for files containing /var/lib/openhab2 then:

sudo find /etc /var/lib/ -type f -exec grep -l /var/lib/openhab2

this should print a list of files containing /var/lib/openhab2.
This could include binaries as well. So before editing the resulting files it is better to review which files are listed first.

A workaround could be to create a softlink /var/lib/openhab pointing to /var/lib/openhab2.
This may have other sideeffects so it’s better of course to find the root cause and solve that.

Thank you to all of you - finally it is working again. I followed your hints, and I have changed the path in /etc/passwd for user openhab (working dir??) and I confirmed access rights - I am not sure why, but it works …

1 Like

Thanks for the solution. It causes the problem because Frontail tries to write some kind of hidden token file into the (now missing) /var/lib/openhab2 directory.

You can see this if you look at the Frontail service status output:

journalctl -u frontail.service -b