hassio-addons/addon-node-red

Node-Red Auto Terminate #315

houtknots posted onGitHub

Problem/Motivation

Every time I try to start the Node-Red Addon it will automaticly shut off again. Sometimes I happens over 30 second and sometimes it take 1 or 2 hours.

I do not see a good reason why this happens

Expected behavior

Every time I start the Addon it will automatically terminate itself again.

Actual behavior

Node-Red Log

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 
-----------------------------------------------------------
 Hass.io Add-on: Node-RED
 Flow-based programming for the Internet of Things
-----------------------------------------------------------
 Add-on version: 4.2.1
 You are running the latest version of this add-on.
 System: null  (armv7 / raspberrypi3)
 Home Assistant version: 0.99.2
 Supervisor version: 189
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
Log level is set to ERROR
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] node-red.sh: executing... 
patching file nodes/ui_base.html
Hunk #1 succeeded at 1243 (offset 712 lines).
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.
audited 414 packages in 37.47s
found 14 vulnerabilities (13 moderate, 1 high)
  run `npm audit fix` to fix them, or `npm audit` for details
[cont-init.d] node-red.sh: exited 0.
[cont-init.d] user.sh: executing... 
[cont-init.d] user.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
 hassio-addon-node-red@ start /opt
 node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
Terminated
[cont-finish.d] executing container finish scripts...
[cont-finish.d] 99-message.sh: executing... 
[cont-finish.d] 99-message.sh: exited 0.
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

Hassio System Log

9-09-27 22:16:14 INFO (SyncWorker_11) [hassio.docker.addon] Start Docker add-on hassioaddons/node-red-armv7 with version 4.2.1
19-09-27 22:16:43 INFO (MainThread) [hassio.api.security] /host/info access from a0d7b954_nodered
19-09-27 22:16:52 INFO (MainThread) [hassio.api.security] /dns/info access from a0d7b954_nodered
19-09-27 22:24:19 INFO (MainThread) [hassio.updater] Fetch update data from https://version.home-assistant.io/stable.json
19-09-27 22:29:49 INFO (SyncWorker_13) [hassio.docker.interface] Clean addon_a0d7b954_nodered application

Steps to reproduce

Proposed changes


:wave: Thanks for opening your first issue here! If you're reporting a :bug: bug, please make sure you include steps to reproduce it. Also, logs, error messages and information about your hardware might be usefull.

posted by addons-assistant[bot] over 5 years ago

/etc/node-red/config.js has an include to /config/node-red/settings.js which is in your config folder. Could you backup the config/node-red folder and remove it, uninstall and reinstall the addon and see if the problem persists. You can then look to copy the config back after that.

posted by sinclairpaul over 5 years ago

@sinclairpaul I will try that in the morning. I will update the status.

posted by houtknots over 5 years ago

@sinclairpaul After reinstalling the Node-Red addon the problem still exists. Also when I empty the node-red folder it does not work.

posted by houtknots over 5 years ago

Not sure what you mean by emptying the folder does not work (you need to remove the folder). Can you please post the addon log from a fresh install? Also if possible please post the contents of your settings.js.

posted by sinclairpaul over 5 years ago

Could you also share your addon config.

posted by sinclairpaul over 5 years ago

I have not changed Anything but it works now, below I added my Config and the Settings.js.

Node-Red Config

{
  "credential_secret": "<thisissecret>",
  "dark_mode": false,
  "http_node": {
    "username": "admin",
    "password": "<password>"
  },
  "http_static": {
    "username": "admin",
    "password": "<password>"
  },
  "ssl": true,
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem",
  "require_ssl": true,
  "system_packages": [],
  "npm_packages": [],
  "init_commands": []
}

settings.js

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',

    // Some nodes, such as HTTP In, can be used to listen for incoming http requests.
    // By default, these are served relative to '/'. The following property
    // can be used to specifiy a different root path. If set to false, this is
    // disabled.
    //httpNodeRoot: '/red-nodes',

    // 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',
        'input',
        'output',
        'function',
        'social',
        'mobile',
        'storage',
        'analysis',
        'advanced'
    ],

    // 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
        }
    },

    // Customising the editor
    editorTheme: {
        projects: {
            // To disable the Projects feature, set this value to false
            enabled: true
        }
    }
}
posted by houtknots over 5 years ago

If it is now working I am closing the issue, if you want to discuss any further please use discord/forums.

posted by sinclairpaul over 5 years ago

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

posted by addons-assistant[bot] over 5 years ago

Fund this Issue

$0.00
Funded

Pull requests