hassio-addons/addon-node-red











The issue has been closed
Problems loading config #488
azafred posted onGitHub
Problem/Motivation
Post upgrade to 6.1.0 node-red is refusing to start with the following message:
[11:51:33] INFO: Starting Node-RED...
> addon-node-red@ start /opt
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
Error loading settings file: /etc/node-red/config.js
[11:51:34] INFO: Starting Node-RED...
> addon-node-red@ start /opt
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
Error loading settings file: /etc/node-red/config.js
I have been trying to start it by hand from the docker container, but alas, I can't seem to get any more information. I have checked that /etc/node-red/config.js and the reference file (/config/node-red/settings.js) are there and look good to me. However, js is not my forte ;p
Expected behavior
Node-red should start!
Actual behavior
Node-red doesn't start... The container starts, but not node-red itself:
Error loading settings file: /etc/node-red/config.js
Config file looks like:
const config = require('/config/node-red/settings.js');
const fs = require('fs');
const options = JSON.parse(fs.readFileSync('/data/options.json', 'utf8'));
const bcrypt = require('bcryptjs');
// Set dark theme if enabled
if (options.dark_mode) {
config.editorTheme.page = {
css: '/opt/node_modules/node-red-contrib-theme-midnight-red/midnight.css',
};
}
// Sane and required defaults for the add-on
config.debugUseColors = false;
config.flowFile = 'flows.json';
config.nodesDir = '/config/node-red/nodes';
config.uiHost = '127.0.0.1';
config.uiPort = 46836;
config.userDir = '/config/node-red/';
//Set path for HTTP_Nodes to be served from avoiding lua auth
config.httpNodeRoot = '/endpoint';
// Disable authentication, let HA handle that
config.adminAuth = null;
// Disable SSL, since the add-on handles that
config.https = null;
// Several settings
config.credentialSecret = options.credential_secret;
// Secure HTTP node
if (options.http_node.username) {
config.httpNodeAuth = {
user: options.http_node.username,
pass: bcrypt.hashSync(options.http_node.password),
};
}
// Secure static HTTP
if (options.http_static.username) {
config.httpStaticAuth = {
user: options.http_static.username,
pass: bcrypt.hashSync(options.http_static.password),
}
}
// Set debug level
if (options.log_level) {
config.logging.console.level = options.log_level.toLowerCase();
if (config.logging.console.level === 'warning') {
config.logging.console.level = 'warn';
}
}
module.exports = config;
Steps to reproduce
Upgrade node-red from Hassio (home-assitant)