OH 3.3.0 Frontail not Starting after fresh installation

Hey,

I recently had a few problems with my openhab installation. So i decided to do a fresh installation and use everything i learned in the last years to make an even better smarthome.

I downloaded the latest openhab version (openHABian v1.7.4b) for raspberry pi, used balena etcher to burn the image on a sd-card and let the raspberry alone with the card and network connected.

after the installation process openhab started on openhabian:8080 but nothing to see on openhabian:9001.

I tried this whole process, download, burn, install with 3 different sd-cards and 3 different raspberry pi in two different network enviroments but always with the same result.

one thing i noticed during the installation process was:

npm WARN config global –global, –localare deprecated. Use–location=global instead

i tried to change the files npm and npm.cmd from “-g” to “–location=global” but it didn´t work.

i also tried to install frontail manualy in openhabian-config.

I also tried hints from the same issue from 2019…

but it didn´t help.

i think i saw that there has been an update to nodejs, maybe this causes the issue?

Can anyone confirm that frontail is broken in openHABian v1.7.4b or what can i do to get this to work?

Here I have:


dpkg -l |grep -i nodejs
ii  nodejs                               14.20.0-deb-1nodesource1            armhf        Node.js event-based server-side javascript engine

my result for
dpkg -l |grep -i nodejs
is
ii nodejs 16.17.0-deb-1nodesource1 armhf Node.js event-based server-side javascript engine

does this say anything?

We recently bumped nodejs from v14 to v16 so you more likely have hit some new issue.
Use debugmode=maximum during installation to get a log to figure out what goes wrong alongside the installation process.

sorry, my linux skills are very poor.

i make a new sd-card, log in via ssh when ready and type debug-maximum and then ich watch the installation window under my ip adress for errors?

have a look into

the document describe the require steps to set the debugmode to maximum.

Thanks, it worked.

The installation worked well and i get my first login screen on port 8080.
Port 9001 shows:

# Die Website ist nicht erreichbar

**192.168.178.21** hat die Verbindung abgelehnt.

Versuche Folgendes:

* Verbindung prĂĽfen
* [Proxy und Firewall prĂĽfen](chrome-error://chromewebdata/#buttons)

ERR_CONNECTION_REFUSED

when i check the status of frontail by using systemctl status frontail.service i get the following lines:

â—Ź frontail.service - Frontail openHAB instance, reachable at http://openhabian:9001
     Loaded: loaded (/etc/systemd/system/frontail.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2022-08-17 23:33:54 CEST; 19min ago
       Docs: https://github.com/mthenw/frontail
    Process: 1129 ExecStart=/usr/lib/node_modules/frontail/bin/frontail --disable-usage-stats --ui-highlight ->
   Main PID: 1129 (code=exited, status=1/FAILURE)
        CPU: 1.028s

Aug 17 23:33:54 openhabian systemd[1]: frontail.service: Scheduled restart job, restart counter is at 5.
Aug 17 23:33:54 openhabian systemd[1]: Stopped Frontail openHAB instance, reachable at http://openhabian:9001.
Aug 17 23:33:54 openhabian systemd[1]: frontail.service: Consumed 1.028s CPU time.
Aug 17 23:33:54 openhabian systemd[1]: frontail.service: Start request repeated too quickly.
Aug 17 23:33:54 openhabian systemd[1]: frontail.service: Failed with result 'exit-code'.
Aug 17 23:33:54 openhabian systemd[1]: Failed to start Frontail openHAB instance, reachable at http://openhabi>
lines 1-14/14 (END)

The logfile is to big to post it here so here is a link:

Could you check if the output of

sudo journalctl -u frontail

provides more information about the reason why the serivce failed ?

-- Journal begins at Wed 2022-08-17 23:30:02 CEST, ends at Thu 2022-08-18 07:50:40 CEST. --
Aug 17 23:30:02 openhabian frontail[16309]: node:internal/modules/cjs/loader:959
Aug 17 23:30:02 openhabian frontail[16309]:   throw err;
Aug 17 23:30:02 openhabian frontail[16309]:   ^
Aug 17 23:30:02 openhabian frontail[16309]: Error: Cannot find module 'cookie'
Aug 17 23:30:02 openhabian frontail[16309]: Require stack:
Aug 17 23:30:02 openhabian frontail[16309]: - /opt/frontail/index.js
Aug 17 23:30:02 openhabian frontail[16309]: - /opt/frontail/bin/frontail
Aug 17 23:30:02 openhabian frontail[16309]:     at Function.Module._resolveFilename (node:internal/modules/cjs>
Aug 17 23:30:02 openhabian frontail[16309]:     at Function.Module._load (node:internal/modules/cjs/loader:804>
Aug 17 23:30:02 openhabian frontail[16309]:     at Module.require (node:internal/modules/cjs/loader:1028:19)
Aug 17 23:30:02 openhabian frontail[16309]:     at require (node:internal/modules/cjs/helpers:102:18)
Aug 17 23:30:02 openhabian frontail[16309]:     at Object.<anonymous> (/opt/frontail/index.js:3:16)
Aug 17 23:30:02 openhabian frontail[16309]:     at Module._compile (node:internal/modules/cjs/loader:1126:14)
Aug 17 23:30:02 openhabian frontail[16309]:     at Object.Module._extensions..js (node:internal/modules/cjs/lo>
Aug 17 23:30:02 openhabian frontail[16309]:     at Module.load (node:internal/modules/cjs/loader:1004:32)
Aug 17 23:30:02 openhabian frontail[16309]:     at Function.Module._load (node:internal/modules/cjs/loader:839>
Aug 17 23:30:02 openhabian frontail[16309]:     at Module.require (node:internal/modules/cjs/loader:1028:19) {
Aug 17 23:30:02 openhabian frontail[16309]:   code: 'MODULE_NOT_FOUND',
Aug 17 23:30:02 openhabian frontail[16309]:   requireStack: [ '/opt/frontail/index.js', '/opt/frontail/bin/fro>
Aug 17 23:30:02 openhabian frontail[16309]: }

looks like the module node:internal/modules/cjs/loader:1028:19 is missing. is there a way to install it manualy?

same issue here

the cookie module is missing

In the version that I have in directory /opt/frontail there is a file package.json.
Is the cookie package listed in there ?

You should be able to add/install it with

sudo bash
cd /opt/frontail/
npm install cookie
exit

If it is already listed in the package.json file there is most probably a reason why it cannot be installed.

[sudo] password for openhabian:
[19:04:45] root@openhabian:/home/openhabian# cd /opt/frontail/
[19:04:55] root@openhabian:/opt/frontail# npm install cookie
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated request-promise-native@1.0.5: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated har-validator@5.1.0: this library is no longer supported
npm WARN deprecated formidable@1.2.1: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated superagent@3.8.3: Please upgrade to v7.0.2+ of superagent.  We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing.  See the releases tab for more information at <https://github.com/visionmedia/superagent/releases>.
npm WARN deprecated buster-core@0.6.4: No longer maintained

added 466 packages, and audited 467 packages in 2m

23 packages are looking for funding
  run `npm fund` for details

13 vulnerabilities (8 moderate, 2 high, 3 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

then i did teh npm audit

[19:06:57] root@openhabian:/opt/frontail# npm audit
# npm audit report

ajv  <6.12.3
Severity: moderate
Prototype Pollution in Ajv - https://github.com/advisories/GHSA-v88g-cgmw-v5xw
fix available via `npm audit fix`
node_modules/ajv
node_modules/request/node_modules/ajv
  har-validator  3.3.0 - 5.1.0
  Depends on vulnerable versions of ajv
  node_modules/request/node_modules/har-validator

ansi-regex  4.0.0 - 4.1.0 || 5.0.0
Severity: high
Inefficient Regular Expression Complexity in chalk/ansi-regex - https://github.com/advisories/GHSA-93q8-gq69-wqmw
Inefficient Regular Expression Complexity in chalk/ansi-regex - https://github.com/advisories/GHSA-93q8-gq69-wqmw
fix available via `npm audit fix`
node_modules/ansi-regex
node_modules/strip-ansi/node_modules/ansi-regex

engine.io  4.0.0 - 4.1.1
Severity: high
Uncaught Exception in engine.io - https://github.com/advisories/GHSA-273r-mgr4-v34f
fix available via `npm audit fix`
node_modules/engine.io

hosted-git-info  <2.8.9
Severity: moderate
Regular Expression Denial of Service in hosted-git-info - https://github.com/advisories/GHSA-43f8-2h32-f4cj
fix available via `npm audit fix`
node_modules/hosted-git-info

jsdom  <=16.4.0
Severity: moderate
Insufficient Granularity of Access Control in JSDom - https://github.com/advisories/GHSA-f4c9-cqv8-9v98
fix available via `npm audit fix --force`
Will install jsdom@20.0.0, which is a breaking change
node_modules/jsdom

json-schema  <0.4.0
Severity: critical
json-schema is vulnerable to Prototype Pollution - https://github.com/advisories/GHSA-896r-f27r-55mw
fix available via `npm audit fix`
node_modules/json-schema
  jsprim  0.3.0 - 1.4.1 || 2.0.0 - 2.0.1
  Depends on vulnerable versions of json-schema
  node_modules/jsprim

minimist  <=1.2.5
Severity: critical
Prototype Pollution in minimist - https://github.com/advisories/GHSA-xvch-5gv4-984h
Prototype Pollution in minimist - https://github.com/advisories/GHSA-vh95-rmgr-6w4m
fix available via `npm audit fix --force`
Will install mocha@10.0.0, which is a breaking change
node_modules/minimist
node_modules/pkg-fetch/node_modules/minimist
node_modules/pkg/node_modules/minimist
  mkdirp  0.4.1 - 0.5.1
  Depends on vulnerable versions of minimist
  node_modules/mkdirp
    mocha  1.21.5 - 6.2.2 || 7.0.0-esm1 - 7.1.0
    Depends on vulnerable versions of mkdirp
    node_modules/mocha

path-parse  <1.0.7
Severity: moderate
Regular Expression Denial of Service in path-parse - https://github.com/advisories/GHSA-hj48-42vr-x3v9
fix available via `npm audit fix`
node_modules/path-parse
node_modules/resolve/node_modules/path-parse

ws  5.0.0 - 5.2.2 || 7.0.0 - 7.4.5
Severity: moderate
ReDoS in Sec-Websocket-Protocol header - https://github.com/advisories/GHSA-6fc8-4gx4-v693
ReDoS in Sec-Websocket-Protocol header - https://github.com/advisories/GHSA-6fc8-4gx4-v693
fix available via `npm audit fix`
node_modules/jsdom/node_modules/ws
node_modules/ws

13 vulnerabilities (8 moderate, 2 high, 3 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

i think i trie to delete package-lock.json and then install cookie again…

Okay …
I went to the folder opt/frontail, used sudo bash to become supersaiyajin and deleted the files package.json and package-lock.json by typing
rm package.json
rm package-lock.json.
then i ran npm install cookie again.
After a reboot the folders are there again but still no frontail.

after running sudo journalctl -u frontail again, i get the error

Aug 18 19:20:09 openhabian frontail[742]: Error: Cannot find module 'cookie-parser'

okay, again supersaiyajin sudo bash, go to folder cd opt/frontail and install the missing package npm install cookie-parser.

after a reboot and sudo journalctl -u frontail now i get

Aug 18 19:33:48 openhabian frontail[939]: Error: Cannot find module 'socket.io'

i will continue and tell you the result…

1 Like

… after socket.io there was untildify missing. after installing untildify and a reboot there was only this:

[21:01:51] root@openhabian:/opt/frontail# sudo journalctl -u frontail
-- Journal begins at Thu 2022-08-18 20:07:10 CEST, ends at Thu 2022-08-18 21:01:55 CEST. --
Aug 18 20:07:37 openhabian systemd[1]: Started Frontail openHAB instance, reachable at http://openhabian:9001.
Aug 18 20:07:42 openhabian systemd[1]: frontail.service: Main process exited, code=exited, status=1/FAILURE
Aug 18 20:07:42 openhabian systemd[1]: frontail.service: Failed with result 'exit-code'.
Aug 18 20:07:42 openhabian systemd[1]: frontail.service: Consumed 2.097s CPU time.
Aug 18 20:07:42 openhabian systemd[1]: frontail.service: Scheduled restart job, restart counter is at 1.
Aug 18 20:07:42 openhabian systemd[1]: Stopped Frontail openHAB instance, reachable at http://openhabian:9001.
Aug 18 20:07:42 openhabian systemd[1]: frontail.service: Consumed 2.097s CPU time.
Aug 18 20:07:42 openhabian systemd[1]: Started Frontail openHAB instance, reachable at http://openhabian:9001.
Aug 18 20:07:44 openhabian systemd[1]: frontail.service: Main process exited, code=exited, status=1/FAILURE
Aug 18 20:07:44 openhabian systemd[1]: frontail.service: Failed with result 'exit-code'.
Aug 18 20:07:44 openhabian systemd[1]: frontail.service: Consumed 1.807s CPU time.
Aug 18 20:07:44 openhabian systemd[1]: frontail.service: Scheduled restart job, restart counter is at 2.
Aug 18 20:07:44 openhabian systemd[1]: Stopped Frontail openHAB instance, reachable at http://openhabian:9001.
Aug 18 20:07:44 openhabian systemd[1]: frontail.service: Consumed 1.807s CPU time.
Aug 18 20:07:44 openhabian systemd[1]: Started Frontail openHAB instance, reachable at http://openhabian:9001.
Aug 18 20:07:46 openhabian systemd[1]: frontail.service: Main process exited, code=exited, status=1/FAILURE
Aug 18 20:07:46 openhabian systemd[1]: frontail.service: Failed with result 'exit-code'.
Aug 18 20:07:46 openhabian systemd[1]: frontail.service: Consumed 1.832s CPU time.
Aug 18 20:07:46 openhabian systemd[1]: frontail.service: Scheduled restart job, restart counter is at 3.
Aug 18 20:07:46 openhabian systemd[1]: Stopped Frontail openHAB instance, reachable at http://openhabian:9001.
Aug 18 20:07:46 openhabian systemd[1]: frontail.service: Consumed 1.832s CPU time.
Aug 18 20:07:46 openhabian systemd[1]: Started Frontail openHAB instance, reachable at http://openhabian:9001.
Aug 18 20:07:48 openhabian systemd[1]: frontail.service: Main process exited, code=exited, status=1/FAILURE
Aug 18 20:07:48 openhabian systemd[1]: frontail.service: Failed with result 'exit-code'.

and it continued for ever.

Can you try to start it manually at command line ( not in daemon mode but in foreground ) to check if there is additional output ?

do you mean sudo systemctl start frontail.service?

after this and sudo systemctl status frontail.service i get

â—Ź frontail.service - Frontail openHAB instance, reachable at http://openhabian:9001
     Loaded: loaded (/etc/systemd/system/frontail.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2022-08-18 21:27:16 CEST; 1s ago
       Docs: https://github.com/mthenw/frontail
   Main PID: 6066 (node)
      Tasks: 7 (limit: 2176)
        CPU: 1.768s
     CGroup: /system.slice/frontail.service
             └─6066 node /usr/lib/node_modules/frontail/bin/frontail --disable-usage-stats --ui-highlight --ui>

Aug 18 21:27:16 openhabian systemd[1]: Started Frontail openHAB instance, reachable at http://openhabian:9001.
lines 1-11/11 (END)

But frontail is still not reachable on myip:9001.

sudo journalctl -u frontail
shows the same result as before.

No. Have a look into the service file to get information about how the command is to be started.
Then execute it in a terminal ( must be something with node … )

okay, lets go on…
i found the service file in /etc/systemd/system/ like mentioned in the log of post no. 17.
i opened the file with nano frontail.service.
the file contains the following text:


[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/local/bin:/usr/bin/
Environment=NODE_ENV=production
WorkingDirectory=/usr/bin/

[Install]
WantedBy=multi-user.target

so i copied the line

/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

and entered it in the console. the result was:

node:internal/modules/cjs/loader:959
  throw err;
  ^

Error: Cannot find module 'fs-tail-stream'
Require stack:
- /opt/frontail/lib/tail.js
- /opt/frontail/index.js
- /opt/frontail/bin/frontail
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
    at Function.Module._load (node:internal/modules/cjs/loader:804:27)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/opt/frontail/lib/tail.js:7:20)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1028:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/opt/frontail/lib/tail.js',
    '/opt/frontail/index.js',
    '/opt/frontail/bin/frontail'
  ]
}

looks like “fs-tail-stream” is missing and i don´t know where i would have to install it.
i think i will wait for an update where this problem is solved.

Thanks to all who tried to help me and i hope what i tried so far will help someone with the same issue.

It’s many modules missing.
I’ve opened Frontail not starting on fresh install · Issue #1711 · openhab/openhabian · GitHub to track this but frankly I have no idea of frontail, it’s some annoying heritage I would not have chosen in the first place and gave up on debugging.
Anyone to read this with more nodejs experience please help.