hassio-addons / addon-node-red

Node-RED - Home Assistant Community Add-ons
https://addons.community
MIT License
513 stars 117 forks source link

Node Red crashes when selecting a different theme than 'default' #1832

Closed notownblues closed 3 months ago

notownblues commented 4 months ago

Problem/Motivation

I wanted to set the theme to 'midnight-red' but selecting any other theme than 'default' crashes Node Red on start

Expected behavior

Node Red starts with the new theme selected in the configuration

Actual behavior

Node Red crashes on start

Steps to reproduce

Set theme to anything else than 'default', e.g. 'midnight-red', press 'save' and restart add-on.

Addon doesn't start and shows the following logs:

[21:26:59] INFO: Starting Node-RED...
s6-rc: info: service legacy-services successfully started

> start
> node $NODE_OPTIONS node_modules/node-red/red.js --settings /etc/node-red/config.js

Error loading settings file: /etc/node-red/config.js
TypeError: Cannot set properties of undefined (setting 'theme')
    at Object.<anonymous> (/etc/node-red/config.js:8:30)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Module._load (node:internal/modules/cjs/loader:1013:12)
    at Module.require (node:internal/modules/cjs/loader:1225:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (/opt/node_modules/node-red/red.js:140:20)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
sinclairpaul commented 4 months ago

Cannot duplicate it, can you please post the full addon startup log.

notownblues commented 4 months ago

Thanks for your reply @sinclairpaul.

Here's the full logs. The add-on keeps trying to start but it can't until I revert to the default theme:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting

-----------------------------------------------------------
 Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 17.0.7
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.5  (amd64 / qemux86-64)
 Home Assistant Core: 2024.2.1
 Home Assistant Supervisor: 2024.01.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-nginx: starting
s6-rc: info: service init-customizations: starting
[22:42:39] INFO: Starting installation of custom NPM/Node-RED packages...
s6-rc: info: service init-nginx successfully started
npm WARN config optional Use `--omit=optional` to exclude optional dependencies, or
npm WARN config `--include=optional` to include them.
npm WARN config 
npm WARN config     Default value does install optional deps unless otherwise omitted.
npm WARN config only Use `--omit=dev` to omit dev dependencies from the install.

added 1 package, and audited 585 packages in 8s

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

21 vulnerabilities (13 moderate, 6 high, 2 critical)

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

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm notice 
npm notice New minor version of npm available! 10.2.3 -> 10.4.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.4.0>
npm notice Run `npm install -g npm@10.4.0` to update!
npm notice 
s6-rc: info: service init-customizations successfully started
s6-rc: info: service init-nodered: starting

up to date, audited 391 packages in 13s

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

48 vulnerabilities (15 moderate, 26 high, 7 critical)

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

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

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
s6-rc: info: service init-nodered successfully started
s6-rc: info: service nodered: starting
s6-rc: info: service nodered successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
[22:43:01] INFO: Starting Node-RED...
s6-rc: info: service legacy-services successfully started

> start
> node $NODE_OPTIONS node_modules/node-red/red.js --settings /etc/node-red/config.js

Error loading settings file: /etc/node-red/config.js
TypeError: Cannot set properties of undefined (setting 'theme')
    at Object.<anonymous> (/etc/node-red/config.js:8:30)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Module._load (node:internal/modules/cjs/loader:1013:12)
    at Module.require (node:internal/modules/cjs/loader:1225:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (/opt/node_modules/node-red/red.js:140:20)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
[22:43:03] INFO: Service Node-RED exited with code 1 (by signal 0)
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service nginx: stopping
[22:43:03] INFO: Service NGINX exited with code 256 (by signal 15)
s6-rc: info: service nginx successfully stopped
s6-rc: info: service init-nginx: stopping
s6-rc: info: service nodered: stopping
s6-rc: info: service init-nginx successfully stopped
s6-rc: info: service nodered successfully stopped
s6-rc: info: service init-nodered: stopping
s6-rc: info: service init-nodered successfully stopped
s6-rc: info: service init-customizations: stopping
s6-rc: info: service init-customizations successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
sinclairpaul commented 4 months ago

Can you remove anything in your npm_packages value and retry, also if you can post your config so we can try to replicate it would be good.

notownblues commented 4 months ago

Here's my config @sinclairpaul.

Note that I only tried to add the npm_package last night to see if it would fix the issue. It generates the same error log with or without. I also tried with dark_mode on or off. It still crashes if the theme is anything else than 'default'.

theme: midnight-red
http_node:
  username: ""
  password: ""
http_static:
  username: ""
  password: ""
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
system_packages: []
npm_packages:
  - node-red-contrib-themes/midnight-red
init_commands: []
credential_secret: *******
dark_mode: true
require_ssl: true
sinclairpaul commented 4 months ago

I still can't duplicate this, the piece that is failing appears to be at https://github.com/hassio-addons/addon-node-red/blob/4ca9f424119b45f39e722a616e9d575d41b5e011/node-red/rootfs/etc/node-red/config.js#L6

Within that file there is an include to the customisable /config/settings.js file, which is exposed in the addon data folder, have you manually added anything there?

notownblues commented 4 months ago

That's super weird. I've never edited that file @sinclairpaul. The only thing I did was to change the theme from 'default' to 'midnight-red' in the add-on configuration.

Screenshot 2024-02-14 at 14 48 51

sinclairpaul commented 4 months ago

Can you please post the log when it does start then?

notownblues commented 4 months ago

Yep sure, here are the logs with 'default' theme when it starts fine:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting

-----------------------------------------------------------
 Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 17.0.7
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.5  (amd64 / qemux86-64)
 Home Assistant Core: 2024.2.1
 Home Assistant Supervisor: 2024.01.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-nginx: starting
s6-rc: info: service init-customizations: starting
[16:50:17] INFO: Starting installation of custom NPM/Node-RED packages...
s6-rc: info: service init-nginx successfully started
npm WARN config optional Use `--omit=optional` to exclude optional dependencies, or
npm WARN config `--include=optional` to include them.
npm WARN config 
npm WARN config     Default value does install optional deps unless otherwise omitted.
npm WARN config only Use `--omit=dev` to omit dev dependencies from the install.

added 1 package, and audited 585 packages in 8s

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

21 vulnerabilities (13 moderate, 6 high, 2 critical)

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

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm notice 
npm notice New minor version of npm available! 10.2.3 -> 10.4.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.4.0>
npm notice Run `npm install -g npm@10.4.0` to update!
npm notice 
s6-rc: info: service init-customizations successfully started
s6-rc: info: service init-nodered: starting

up to date, audited 391 packages in 16s

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

48 vulnerabilities (15 moderate, 26 high, 7 critical)

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

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

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
s6-rc: info: service init-nodered successfully started
s6-rc: info: service nodered: starting
s6-rc: info: service nodered successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
[16:50:43] INFO: Starting Node-RED...
s6-rc: info: service legacy-services successfully started

> start
> node $NODE_OPTIONS node_modules/node-red/red.js --settings /etc/node-red/config.js

14 Feb 16:50:44 - [info] 

Welcome to Node-RED
===================

14 Feb 16:50:44 - [info] Node-RED version: v3.1.5
14 Feb 16:50:44 - [info] Node.js  version: v18.19.0
14 Feb 16:50:44 - [info] Linux 6.1.74-haos x64 LE
14 Feb 16:50:45 - [info] Loading palette nodes
14 Feb 16:50:47 - [info] Dashboard version 3.6.2 started at /endpoint/ui
14 Feb 16:50:48 - [info] Settings file  : /etc/node-red/config.js
14 Feb 16:50:48 - [info] Context store  : 'default' [module=memory]
14 Feb 16:50:48 - [info] User directory : /config/
14 Feb 16:50:48 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
14 Feb 16:50:48 - [info] Flows file     : /config/flows.json
14 Feb 16:50:48 - [info] Server now running at http://127.0.0.1:46836/
[16:50:48] INFO: Starting NGinx...
14 Feb 16:50:50 - [info] Starting flows
14 Feb 16:50:52 - [info] Started flows
14 Feb 16:50:52 - [info] [server:Home Assistant] Connecting to http://supervisor/core
14 Feb 16:50:52 - [info] [alexa-remote-account:Alexa Account] intialising "Alexa Account" with the PROXY method and saved data...
14 Feb 16:50:52 - [info] [server:Home Assistant] Connected to http://supervisor/core
14 Feb 16:50:52 - [info] [mqtt-broker:HA MQTT] Connected to broker: mqtt://192.168.0.244:1883
(node:390) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ws-device-activity listeners added to [AlexaRemoteExt]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
sinclairpaul commented 4 months ago

Looking at the startup log, you should have an entry such as:

[info] Node-RED Contrib Theme Collection version: v3.1.9

This is installed by default in the addon at https://github.com/hassio-addons/addon-node-red/blob/4ca9f424119b45f39e722a616e9d575d41b5e011/node-red/package.json#L37

It seems like you have somehow removed this, possibly by manually installing it via the palette manager. My suggestion would be to check what has been manually installed in that way, and remove them until you find the issue.

You can also look at the package.json in the addon's config folder to verify what has been installed.

To add the recommended way of adding additional nodes is via the npm_packages config.

notownblues commented 4 months ago

That's a good point actually @sinclairpaul, I did try to install the theme-collection via the palette but somehow it never installed, see below screenshot.

Do you know how I could remove it manually? I'll check if theme issue persists after that?

image

notownblues commented 4 months ago

Looks like I'm getting the same error even after removing "@node-red-contrib-themes/theme-collection": "3.1.9" from the packages.json file.

package.json: image

Start logs with 'midnight-red' theme and node-red-contrib-themes/midnight-red set as an npm_package in the adding config:

s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-nginx: starting
s6-rc: info: service init-customizations: starting
[20:28:39] INFO: Starting installation of custom NPM/Node-RED packages...
s6-rc: info: service init-nginx successfully started
npm WARN config optional Use `--omit=optional` to exclude optional dependencies, or
npm WARN config `--include=optional` to include them.
npm WARN config 
npm WARN config     Default value does install optional deps unless otherwise omitted.
npm WARN config only Use `--omit=dev` to omit dev dependencies from the install.

added 1 package, and audited 585 packages in 9s

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

21 vulnerabilities (13 moderate, 6 high, 2 critical)

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

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm notice 
npm notice New minor version of npm available! 10.2.3 -> 10.4.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.4.0>
npm notice Run `npm install -g npm@10.4.0` to update!
npm notice 
s6-rc: info: service init-customizations successfully started
s6-rc: info: service init-nodered: starting

up to date, audited 390 packages in 14s

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

48 vulnerabilities (15 moderate, 26 high, 7 critical)

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

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

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
s6-rc: info: service init-nodered successfully started
s6-rc: info: service nodered: starting
s6-rc: info: service nodered successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
[20:29:02] INFO: Starting Node-RED...
s6-rc: info: service legacy-services successfully started

> start
> node $NODE_OPTIONS node_modules/node-red/red.js --settings /etc/node-red/config.js

Error loading settings file: /etc/node-red/config.js
TypeError: Cannot set properties of undefined (setting 'theme')
    at Object.<anonymous> (/etc/node-red/config.js:8:30)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Module._load (node:internal/modules/cjs/loader:1013:12)
    at Module.require (node:internal/modules/cjs/loader:1225:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (/opt/node_modules/node-red/red.js:140:20)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
[20:29:03] INFO: Service Node-RED exited with code 1 (by signal 0)
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service nginx: stopping
[20:29:04] INFO: Service NGINX exited with code 256 (by signal 15)
s6-rc: info: service nginx successfully stopped
s6-rc: info: service init-nginx: stopping
s6-rc: info: service nodered: stopping
s6-rc: info: service init-nginx successfully stopped
s6-rc: info: service nodered successfully stopped
s6-rc: info: service init-nodered: stopping
s6-rc: info: service init-nodered successfully stopped
s6-rc: info: service init-customizations: stopping
s6-rc: info: service init-customizations successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Logs with 'default' theme set:

 Home Assistant Core: 2024.2.1
 Home Assistant Supervisor: 2024.01.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-nginx: starting
s6-rc: info: service init-customizations: starting
[20:33:39] INFO: Starting installation of custom NPM/Node-RED packages...
s6-rc: info: service init-nginx successfully started
npm WARN config optional Use `--omit=optional` to exclude optional dependencies, or
npm WARN config `--include=optional` to include them.
npm WARN config 
npm WARN config     Default value does install optional deps unless otherwise omitted.
npm WARN config only Use `--omit=dev` to omit dev dependencies from the install.

added 1 package, and audited 585 packages in 8s

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

21 vulnerabilities (13 moderate, 6 high, 2 critical)

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

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm notice 
npm notice New minor version of npm available! 10.2.3 -> 10.4.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.4.0>
npm notice Run `npm install -g npm@10.4.0` to update!
npm notice 
s6-rc: info: service init-customizations successfully started
s6-rc: info: service init-nodered: starting

up to date, audited 390 packages in 17s

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

48 vulnerabilities (15 moderate, 26 high, 7 critical)

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

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

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
s6-rc: info: service init-nodered successfully started
s6-rc: info: service nodered: starting
s6-rc: info: service nodered successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
[20:34:05] INFO: Starting Node-RED...
s6-rc: info: service legacy-services successfully started

> start
> node $NODE_OPTIONS node_modules/node-red/red.js --settings /etc/node-red/config.js

14 Feb 20:34:06 - [info] 

Welcome to Node-RED
===================

14 Feb 20:34:06 - [info] Node-RED version: v3.1.5
14 Feb 20:34:06 - [info] Node.js  version: v18.19.0
14 Feb 20:34:06 - [info] Linux 6.1.74-haos x64 LE
14 Feb 20:34:07 - [info] Loading palette nodes
14 Feb 20:34:07 - [info] Node-RED Contrib Theme Collection version: v3.1.9
14 Feb 20:34:09 - [info] Dashboard version 3.6.2 started at /endpoint/ui
14 Feb 20:34:10 - [info] Settings file  : /etc/node-red/config.js
14 Feb 20:34:10 - [info] Context store  : 'default' [module=memory]
14 Feb 20:34:10 - [info] User directory : /config/
14 Feb 20:34:10 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
14 Feb 20:34:10 - [info] Flows file     : /config/flows.json
14 Feb 20:34:10 - [info] Server now running at http://127.0.0.1:46836/
[20:34:10] INFO: Starting NGinx...
14 Feb 20:34:11 - [info] Starting flows
14 Feb 20:34:13 - [info] Started flows
14 Feb 20:34:13 - [info] [server:Home Assistant] Connecting to http://supervisor/core
14 Feb 20:34:13 - [info] [alexa-remote-account:Alexa Account] intialising "Alexa Account" with the PROXY method and saved data...
14 Feb 20:34:13 - [info] [server:Home Assistant] Connected to http://supervisor/core
14 Feb 20:34:13 - [info] [mqtt-broker:HA MQTT] Connected to broker: mqtt://192.168.0.244:1883
(node:389) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ws-device-activity listeners added to [AlexaRemoteExt]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
sinclairpaul commented 4 months ago

You don't need to install the package, it is pre-installed, it may not be that package that causes the issue, but another one. Unfortunately it means manually trying to see which it is.

You could also look at the contents of the settings.js file to see if it is correctly formatted.

There really isn't much more we can do here, as it is not an issue with the addon itself (as the functionality does work), but configuration on your install.

notownblues commented 4 months ago

@sinclairpaul I tried to remove all packages and I still get the error when trying to start the add-on under any other theme than 'default':

packages.json:

{
    "name": "node-red-project",
    "description": "A Node-RED Project",
    "version": "0.0.1",
    "private": true
}

Error log:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting

-----------------------------------------------------------
 Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 17.0.7
 You are running the latest version of this add-on.
 System: Home Assistant OS 11.5  (amd64 / qemux86-64)
 Home Assistant Core: 2024.2.1
 Home Assistant Supervisor: 2024.01.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-nginx: starting
s6-rc: info: service init-customizations: starting
s6-rc: info: service init-customizations successfully started
s6-rc: info: service init-nodered: starting
s6-rc: info: service init-nginx successfully started

up to date, audited 1 package in 474ms

found 0 vulnerabilities
s6-rc: info: service init-nodered successfully started
s6-rc: info: service nodered: starting
s6-rc: info: service nodered successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
[12:23:02] INFO: Starting Node-RED...
s6-rc: info: service legacy-services successfully started

> start
> node $NODE_OPTIONS node_modules/node-red/red.js --settings /etc/node-red/config.js

Error loading settings file: /etc/node-red/config.js
TypeError: Cannot set properties of undefined (setting 'theme')
    at Object.<anonymous> (/etc/node-red/config.js:8:30)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Module._load (node:internal/modules/cjs/loader:1013:12)
    at Module.require (node:internal/modules/cjs/loader:1225:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (/opt/node_modules/node-red/red.js:140:20)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
npm notice 
npm notice New minor version of npm available! 10.2.3 -> 10.4.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.4.0>
npm notice Run `npm install -g npm@10.4.0` to update!
npm notice 
[12:23:03] INFO: Service Node-RED exited with code 1 (by signal 0)
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service nginx: stopping
[12:23:04] INFO: Service NGINX exited with code 256 (by signal 15)
s6-rc: info: service nginx successfully stopped
s6-rc: info: service init-nginx: stopping
s6-rc: info: service nodered: stopping
s6-rc: info: service nodered successfully stopped
s6-rc: info: service init-nodered: stopping
s6-rc: info: service init-nginx successfully stopped
s6-rc: info: service init-nodered successfully stopped
s6-rc: info: service init-customizations: stopping
s6-rc: info: service init-customizations successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

I didn't see anything unusual in settings.js:

/**
 * Copyright JS Foundation and other contributors, http://js.foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **/

/**
 * PLEASE NOTE! IMPORTANT! READ!
 *
 * This is a modified version of the settings file. Some parts of the
 * settings are actually controlled by the Home Assistant add-on.
 *
 * Parts that are handled by it, are removed from this settings template.
 * The following configuration keys are controlled by the add-on and removed.
 *
 * - uiPort (port setting in the add-on log)
 * - uiHost (no need to manually configure this in the add-on)
 * - debugUseColors (disabled, won't work in the add-on)
 * - flowFile (fixed to flows.json)
 * - credentialSecret (credentials_secret in the add-on configuration)
 * - userDir (is set fixed to `/config/node-red`)
 * - nodesDir (is set fixed to `/config/node-red/nodes`)
 * - adminAuth (known as users in the add-on configuration)
 * - https (ssl settings in the add-on configuration)
 * - logging.console.level (log_level in the add-on configuration)
 * - httpNodeAuth (http_node settings in the add-on configuration)
 * - httpStaticAuth (http_static settings in the add-on configuration)
 * - requireHttps (require_ssl setting in the add-on configuration)
 * - httpNodeRoot (set fixed to `/endpoint` )
 *
 * If you like to change those settings, some are available via the add-on
 * settings/option in the Supervisor panel in Home Assistant.
 */
module.exports = {
  // Retry time in milliseconds for MQTT connections
  mqttReconnectTime: 15000,

  // Retry time in milliseconds for Serial port connections
  serialReconnectTime: 15000,

  // Retry time in milliseconds for TCP socket connections
  //socketReconnectTime: 10000,

  // Timeout in milliseconds for TCP server socket connections
  //  defaults to no timeout
  //socketTimeout: 120000,

  // Timeout in milliseconds for HTTP request connections
  //  defaults to 120 seconds
  //httpRequestTimeout: 120000,

  // The maximum length, in characters, of any message sent to the debug sidebar tab
  debugMaxLength: 1000,

  // The maximum number of messages nodes will buffer internally as part of their
  // operation. This applies across a range of nodes that operate on message sequences.
  //  defaults to no limit. A value of 0 also means no limit is applied.
  //nodeMaxMessageBufferLength: 0,

  // To disable the option for using local files for storing keys and certificates in the TLS configuration
  //  node, set this to true
  //tlsConfigDisableLocalFiles: true,

  // By default, the Node-RED UI is available at http://localhost:1880/
  // The following property can be used to specify a different root path.
  // If set to false, this is disabled.
  //httpAdminRoot: '/admin',

  // The following property can be used in place of 'httpAdminRoot' and 'httpNodeRoot',
  // to apply the same root to both parts.
  //httpRoot: '/red',

  // When httpAdminRoot is used to move the UI to a different root path, the
  // following property can be used to identify a directory of static content
  // that should be served at http://localhost:1880/.
  //httpStatic: '/home/nol/node-red-static/',

  // The maximum size of HTTP request that will be accepted by the runtime api.
  // Default: 5mb
  //apiMaxLength: '5mb',

  // If you installed the optional node-red-dashboard you can set it's path
  // relative to httpRoot
  //ui: { path: "ui" },

  // The following property can be used to disable the editor. The admin API
  // is not affected by this option. To disable both the editor and the admin
  // API, use either the httpRoot or httpAdminRoot properties
  //disableEditor: false,

  // The following property can be used to configure cross-origin resource sharing
  // in the HTTP nodes.
  // See https://github.com/troygoode/node-cors#configuration-options for
  // details on its contents. The following is a basic permissive set of options:
  //httpNodeCors: {
  //    origin: "*",
  //    methods: "GET,PUT,POST,DELETE"
  //},

  // If you need to set an http proxy please set an environment variable
  // called http_proxy (or HTTP_PROXY) outside of Node-RED in the operating system.
  // For example - http_proxy=http://myproxy.com:8080
  // (Setting it here will have no effect)
  // You may also specify no_proxy (or NO_PROXY) to supply a comma separated
  // list of domains to not proxy, eg - no_proxy=.acme.co,.acme.co.uk

  // The following property can be used to add a custom middleware function
  // in front of all http in nodes. This allows custom authentication to be
  // applied to all http in nodes, or any other sort of common request processing.
  //httpNodeMiddleware: function(req,res,next) {
  //    // Handle/reject the request, or pass it on to the http in node by calling next();
  //    // Optionally skip our rawBodyParser by setting this to true;
  //    //req.skipRawBodyParser = true;
  //    next();
  //},

  // The following property can be used to verify websocket connection attempts.
  // This allows, for example, the HTTP request headers to be checked to ensure
  // they include valid authentication information.
  //webSocketNodeVerifyClient: function(info) {
  //    // 'info' has three properties:
  //    //   - origin : the value in the Origin header
  //    //   - req : the HTTP request
  //    //   - secure : true if req.connection.authorized or req.connection.encrypted is set
  //    //
  //    // The function should return true if the connection should be accepted, false otherwise.
  //    //
  //    // Alternatively, if this function is defined to accept a second argument, callback,
  //    // it can be used to verify the client asynchronously.
  //    // The callback takes three arguments:
  //    //   - result : boolean, whether to accept the connection or not
  //    //   - code : if result is false, the HTTP error status to return
  //    //   - reason: if result is false, the HTTP reason string to return
  //},

  // Anything in this hash is globally available to all functions.
  // It is accessed as context.global.
  // eg:
  //    functionGlobalContext: { os:require('os') }
  // can be accessed in a function block as:
  //    context.global.os

  functionGlobalContext: {
    // os:require('os'),
    // jfive:require("johnny-five"),
    // j5board:require("johnny-five").Board({repl:false})
  },

  // The following property can be used to order the categories in the editor
  // palette. If a node's category is not in the list, the category will get
  // added to the end of the palette.
  // If not set, the following default order is used:
  paletteCategories: [
    "home_assistant",
    "subflows",
    "common",
    "function",
    "network",
    "sequence",
    "parser",
    "storage"
  ],

  // Configure the logging output
  logging: {
    // Only console logging is currently supported
    console: {
      // Whether or not to include metric events in the log output
      metrics: false,
      // Whether or not to include audit events in the log output
      audit: false
    }
  },
};
github-actions[bot] commented 3 months ago

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!