Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-red-node-serialport node makes the Docker container infinite boot cycle #1027

Open
patrickelectric opened this issue Aug 30, 2023 · 20 comments
Labels

Comments

@patrickelectric
Copy link

          I'm having the same problem with 1.0.4.

Install log:

901e3f2035fd:/usr/src/node-red# npm i node-red-node-serialport --loglevel verbose
npm info it worked if it ends with ok
npm verb cli [
npm verb cli   '/usr/local/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'i',
npm verb cli   'node-red-node-serialport',
npm verb cli   '--loglevel',
npm verb cli   'verbose'
npm verb cli ]
npm info using [email protected]
npm info using [email protected]
npm verb npm-session 1a2b8f09188d40b6
npm http fetch GET 200 https://registry.npmjs.org/node-red-node-serialport 125ms (from cache)
npm timing stage:loadCurrentTree Completed in 2109ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 10ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 1191ms
npm http fetch GET 200 https://registry.npmjs.org/serialport 17ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/@serialport%2fparser-cctalk 69ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/@serialport%2fbindings-cpp 76ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/@serialport%2fparser-byte-length 79ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/@serialport%2fparser-inter-byte-timeout 77ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/@serialport%2fparser-delimiter 86ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/@serialport%2fparser-packet-length 89ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/@serialport%2fbinding-mock 103ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/@serialport%2fparser-readline 95ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/@serialport%2fparser-ready 109ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/@serialport%2fparser-regex 110ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/@serialport%2fparser-slip-encoder 24ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/@serialport%2fparser-spacepacket 28ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/@serialport%2fstream 29ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/@serialport%2fbindings-interface 6ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/node-addon-api 24ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/node-gyp-build 29ms (from cache)
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 1732ms
npm timing stage:loadIdealTree Completed in 3287ms
npm timing stage:generateActionsToTake Completed in 130ms
npm verb correctMkdir /data/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /data/.npm/_locks/staging-4c3c7748ae1d116d.lock for /usr/src/node-red/node_modules/.staging
npm timing action:extract Completed in 551ms
npm timing action:finalize Completed in 92ms
npm timing action:refresh-package-json Completed in 200ms
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle @serialport/[email protected]~preinstall: @serialport/[email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm timing action:preinstall Completed in 33ms
npm info linkStuff @serialport/[email protected]
npm info linkStuff @serialport/[email protected]
npm info linkStuff [email protected]
npm info linkStuff @serialport/[email protected]
npm info linkStuff @serialport/[email protected]
npm info linkStuff @serialport/[email protected]
npm info linkStuff @serialport/[email protected]
npm info linkStuff @serialport/[email protected]
npm info linkStuff @serialport/[email protected]
npm info linkStuff @serialport/[email protected]
npm info linkStuff @serialport/[email protected]
npm info linkStuff @serialport/[email protected]
npm info linkStuff @serialport/[email protected]
npm info linkStuff @serialport/[email protected]
npm info linkStuff @serialport/[email protected]
npm info linkStuff @serialport/[email protected]
npm info linkStuff [email protected]
npm verb linkBins [
npm verb linkBins   {
npm verb linkBins     'node-gyp-build': 'bin.js',
npm verb linkBins     'node-gyp-build-optional': 'optional.js',
npm verb linkBins     'node-gyp-build-test': 'build-test.js'
npm verb linkBins   },
npm verb linkBins   '/usr/src/node-red/node_modules/.bin',
npm verb linkBins   false
npm verb linkBins ]
npm timing audit submit Completed in 1097ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 1098ms
npm timing audit body Completed in 5ms
npm info linkStuff @serialport/[email protected]
npm info linkStuff [email protected]
npm info linkStuff [email protected]
npm timing action:build Completed in 96ms
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle @serialport/[email protected]~install: @serialport/[email protected]

> @serialport/[email protected] install /usr/src/node-red/node_modules/@serialport/bindings-cpp
> node-gyp-build

npm verb lifecycle @serialport/[email protected]~install: unsafe-perm in lifecycle false
npm verb lifecycle @serialport/[email protected]~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/src/node-red/node_modules/@serialport/bindings-cpp/node_modules/.bin:/usr/src/node-red/node_modules/.bin:/usr/src/node-red/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
npm verb lifecycle @serialport/[email protected]~install: CWD: /usr/src/node-red/node_modules/@serialport/bindings-cpp
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~install: [email protected]
npm timing action:install Completed in 507ms
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle @serialport/[email protected]~postinstall: @serialport/[email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm timing action:postinstall Completed in 43ms
npm verb unlock done using /data/.npm/_locks/staging-4c3c7748ae1d116d.lock for /usr/src/node-red/node_modules/.staging
npm timing stage:executeActions Completed in 1705ms
npm timing stage:rollbackFailedOptional Completed in 2ms
npm timing stage:runTopLevelLifecycles Completed in 7543ms
npm verb saving [
npm verb saving   {
npm verb saving     name: 'node-red-node-serialport',
npm verb saving     spec: '^1.0.4',
npm verb saving     save: 'dependencies'
npm verb saving   }
npm verb saving ]
npm info lifecycle [email protected]~preshrinkwrap: [email protected]
npm info lifecycle [email protected]~shrinkwrap: [email protected]
npm info lifecycle [email protected]~postshrinkwrap: [email protected]
+ [email protected]
added 20 packages from 100 contributors and audited 310 packages in 8.192s

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

found 13 vulnerabilities (3 low, 10 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details

node-red:

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

30 Aug 20:13:15 - [info] Node-RED version: v3.0.2
30 Aug 20:13:15 - [info] Node.js  version: v14.21.3
30 Aug 20:13:15 - [info] Linux 5.10.92-v7l+ arm LE
30 Aug 20:13:16 - [info] Loading palette nodes
30 Aug 20:13:18 - [info] Worldmap version 2.42.2
30 Aug 20:13:18 - [info] Dashboard version 3.5.0 started at /ui
30 Aug 20:13:18 - [info] Settings file  : /data/settings.js
30 Aug 20:13:18 - [info] Context store  : 'default' [module=memory]
30 Aug 20:13:18 - [info] User directory : /data
30 Aug 20:13:18 - [warn] Projects disabled : editorTheme.projects.enabled=false
30 Aug 20:13:18 - [info] Flows file     : /data/flows.json
30 Aug 20:13:18 - [warn] 

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

30 Aug 20:13:18 - [warn] Encrypted credentials not found
30 Aug 20:13:18 - [info] Server now running at http://127.0.0.1:1880/
30 Aug 20:13:18 - [info] Starting flows
./entrypoint.sh: line 14:     9 Segmentation fault      (core dumped) /usr/local/bin/node $NODE_OPTIONS node_modules/node-red/red.js --userDir /data $FLOWS "${@}"

Flow:

cat /usr/blueos/userdata/node-red/flows.json 
[
    {
        "id": "a645a811594eb0f0",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "e1649fb4f7544b2b",
        "type": "serial-port",
        "serialport": "/dev/ttyACM2",
        "serialbaud": "115200",
        "databits": "8",
        "parity": "none",
        "stopbits": "1",
        "waitfor": "",
        "dtr": "none",
        "rts": "none",
        "cts": "none",
        "dsr": "none",
        "newline": "\\n",
        "bin": "false",
        "out": "char",
        "addchar": "",
        "responsetimeout": "10000"
    },
    {
        "id": "d64a0f61d894d39e",
        "type": "serial in",
        "z": "a645a811594eb0f0",
        "name": "",
        "serial": "e1649fb4f7544b2b",
        "x": 530,
        "y": 740,
        "wires": [
            [
                "12d22d769a98c1b1"
            ]
        ]
    },
    {
        "id": "12d22d769a98c1b1",
        "type": "debug",
        "z": "a645a811594eb0f0",
        "name": "debug 1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 700,
        "y": 720,
        "wires": []
    }
]

Originally posted by @patrickelectric in #894 (comment)

@patrickelectric
Copy link
Author

#894 (comment)

@hardillb
Copy link
Member

hardillb commented Aug 30, 2023

yes, but why did you pick nodered/node-red:3.0.2-14 rather than latest or 3.0.2 you appeared to make a specific choice to use NodeJS 14 which went totally out of support in April this year. https://endoflife.date/nodejs

You will need to run npm rebuild in the /data directory to have the rebuild be picked up and persisted across a restart (changes made in the /usr/local/src will not be persisted across restarts of the container.)

@hardillb
Copy link
Member

Also share the docker run command you are using to start this container.

@patrickelectric
Copy link
Author

3.0.2-14 looks to be the newer version on the hub.docker, is 3.0.2 newer that 3.0.2-14 ?
latest is problematic since I'll not have control over the node-red version.

Here is the output from /data:

f73ecd7542c2:/data# npm rebuild 

> @serialport/[email protected] install /data/node_modules/@serialport/bindings-cpp
> node-gyp-build

[email protected] /data/node_modules/node-red-contrib-web-worldmap
@turf/[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/@turf/bezier-spline
@turf/[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/@turf/helpers
@turf/[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/@turf/invariant
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/cgi
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/debug
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/ms
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/extend
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/header-stack
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/bufferjs
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/bufferlist
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/stream-stack
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/compression
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/accepts
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/mime-types
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/mime-db
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/negotiator
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/compression/node_modules/bytes
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/compressible
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/on-headers
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/safe-buffer
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/vary
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/express
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/array-flatten
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/body-parser
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/body-parser/node_modules/bytes
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/content-type
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/depd
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/destroy
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/http-errors
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/inherits
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/setprototypeof
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/statuses
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/toidentifier
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/iconv-lite
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/safer-buffer
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/on-finished
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/ee-first
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/qs
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/side-channel
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/call-bind
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/function-bind
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/get-intrinsic
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/has
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/has-symbols
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/object-inspect
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/raw-body
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/raw-body/node_modules/bytes
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/unpipe
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/type-is
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/media-typer
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/content-disposition
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/content-disposition/node_modules/safe-buffer
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/cookie
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/cookie-signature
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/encodeurl
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/escape-html
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/etag
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/finalhandler
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/parseurl
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/fresh
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/merge-descriptors
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/methods
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/path-to-regexp
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/proxy-addr
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/forwarded
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/ipaddr.js
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/range-parser
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/express/node_modules/safe-buffer
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/send
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/mime
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/send/node_modules/ms
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/serve-static
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/utils-merge
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/sockjs
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/faye-websocket
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/websocket-driver
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/websocket-driver/node_modules/http-parser-js
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/websocket-extensions
[email protected] /data/node_modules/node-red-contrib-web-worldmap/node_modules/uuid
[email protected] /data/node_modules/node-red-dashboard
[email protected] /data/node_modules/compression
[email protected] /data/node_modules/accepts
[email protected] /data/node_modules/mime-types
[email protected] /data/node_modules/mime-db
[email protected] /data/node_modules/negotiator
[email protected] /data/node_modules/bytes
[email protected] /data/node_modules/compressible
[email protected] /data/node_modules/debug
[email protected] /data/node_modules/ms
[email protected] /data/node_modules/on-headers
[email protected] /data/node_modules/safe-buffer
[email protected] /data/node_modules/vary
[email protected] /data/node_modules/gridstack
[email protected] /data/node_modules/jquery
[email protected] /data/node_modules/serve-static
[email protected] /data/node_modules/encodeurl
[email protected] /data/node_modules/escape-html
[email protected] /data/node_modules/parseurl
[email protected] /data/node_modules/send
[email protected] /data/node_modules/depd
[email protected] /data/node_modules/destroy
[email protected] /data/node_modules/etag
[email protected] /data/node_modules/fresh
[email protected] /data/node_modules/http-errors
[email protected] /data/node_modules/inherits
[email protected] /data/node_modules/setprototypeof
[email protected] /data/node_modules/statuses
[email protected] /data/node_modules/toidentifier
[email protected] /data/node_modules/mime
[email protected] /data/node_modules/send/node_modules/ms
[email protected] /data/node_modules/on-finished
[email protected] /data/node_modules/ee-first
[email protected] /data/node_modules/range-parser
[email protected] /data/node_modules/socket.io
[email protected] /data/node_modules/base64id
[email protected] /data/node_modules/cors
[email protected] /data/node_modules/object-assign
[email protected] /data/node_modules/socket.io/node_modules/debug
[email protected] /data/node_modules/socket.io/node_modules/ms
[email protected] /data/node_modules/engine.io
@types/[email protected] /data/node_modules/@types/cookie
@types/[email protected] /data/node_modules/@types/cors
@types/[email protected] /data/node_modules/@types/node
[email protected] /data/node_modules/cookie
[email protected] /data/node_modules/engine.io/node_modules/debug
[email protected] /data/node_modules/engine.io/node_modules/ms
[email protected] /data/node_modules/engine.io-parser
[email protected] /data/node_modules/ws
[email protected] /data/node_modules/socket.io-adapter
[email protected] /data/node_modules/socket.io-parser
@socket.io/[email protected] /data/node_modules/@socket.io/component-emitter
[email protected] /data/node_modules/socket.io-parser/node_modules/debug
[email protected] /data/node_modules/socket.io-parser/node_modules/ms
[email protected] /data/node_modules/node-red-node-serialport
[email protected] /data/node_modules/serialport
@serialport/[email protected] /data/node_modules/@serialport/binding-mock
@serialport/[email protected] /data/node_modules/@serialport/bindings-interface
[email protected] /data/node_modules/@serialport/binding-mock/node_modules/debug
[email protected] /data/node_modules/@serialport/binding-mock/node_modules/ms
@serialport/[email protected] /data/node_modules/@serialport/bindings-cpp
@serialport/[email protected] /data/node_modules/@serialport/bindings-cpp/node_modules/@serialport/parser-readline
@serialport/[email protected] /data/node_modules/@serialport/bindings-cpp/node_modules/@serialport/parser-delimiter
[email protected] /data/node_modules/@serialport/bindings-cpp/node_modules/debug
[email protected] /data/node_modules/@serialport/bindings-cpp/node_modules/ms
[email protected] /data/node_modules/node-addon-api
[email protected] /data/node_modules/node-gyp-build
@serialport/[email protected] /data/node_modules/@serialport/parser-byte-length
@serialport/[email protected] /data/node_modules/@serialport/parser-cctalk
@serialport/[email protected] /data/node_modules/@serialport/parser-delimiter
@serialport/[email protected] /data/node_modules/@serialport/parser-inter-byte-timeout
@serialport/[email protected] /data/node_modules/@serialport/parser-packet-length
@serialport/[email protected] /data/node_modules/@serialport/parser-readline
@serialport/[email protected] /data/node_modules/@serialport/parser-ready
@serialport/[email protected] /data/node_modules/@serialport/parser-regex
@serialport/[email protected] /data/node_modules/@serialport/parser-slip-encoder
@serialport/[email protected] /data/node_modules/@serialport/parser-spacepacket
@serialport/[email protected] /data/node_modules/@serialport/stream
[email protected] /data/node_modules/@serialport/stream/node_modules/debug
[email protected] /data/node_modules/@serialport/stream/node_modules/ms
[email protected] /data/node_modules/serialport/node_modules/debug
[email protected] /data/node_modules/serialport/node_modules/ms

I'm just performing this binds:

"Binds": [
    "/usr/blueos/userdata/node-red:/data:rw",
    "/etc/hostname:/etc/hostname:ro",
    "/dev:/dev:rw",
    "/:/home/workspace/host:rw"
  ]

@hardillb
Copy link
Member

All the 3.0.2 builds were done at the same time, latest is just the current alias for 3.0.2 which is also 3.0.2-16 you should NOT be doing anything "new" with anything NodeJS 14 based.

Does the container run after doing the npm rebuild?

@patrickelectric
Copy link
Author

Same problem..
I'll change the docker image to see if 3.0.2 has the same issue.

@hardillb
Copy link
Member

Make sure you empty the volume mounted on /data when you change the container version before starting it.

@patrickelectric
Copy link
Author

patrickelectric commented Aug 30, 2023

I did delete everything in /data.
Started the docker, installed the extension and got the same problem.

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

30 Aug 21:28:53 - [info] Node-RED version: v3.0.2
30 Aug 21:28:53 - [info] Node.js  version: v16.20.1
30 Aug 21:28:53 - [info] Linux 5.10.92-v7l+ arm LE
30 Aug 21:28:55 - [info] Loading palette nodes
30 Aug 21:28:57 - [info] Settings file  : /data/settings.js
30 Aug 21:28:57 - [info] Context store  : 'default' [module=memory]
30 Aug 21:28:57 - [info] User directory : /data
30 Aug 21:28:57 - [warn] Projects disabled : editorTheme.projects.enabled=false
30 Aug 21:28:57 - [info] Flows file     : /data/flows.json
30 Aug 21:28:57 - [info] Server now running at http://127.0.0.1:1880/
30 Aug 21:28:57 - [warn] 

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

30 Aug 21:28:57 - [info] Starting flows
./entrypoint.sh: line 14:     9 Segmentation fault      (core dumped) /usr/local/bin/node $NODE_OPTIONS node_modules/node-red/red.js --userDir /data $FLOWS "${@}"

@hardillb
Copy link
Member

hardillb commented Aug 30, 2023

Just to be extra clear here, this is still after you installed the serial port node, because I don't see the Node-RED log entries for installing the node in what you've posted.

  • How did you do the install?
  • Did you restart after doing the install to get that log output?
  • And have you tried running npm rebuild in /data again?

Also what is the host OS here? I see it's ARMv7 so is it a Raspberry Pi, if so what version of the OS are you using?

@patrickelectric
Copy link
Author

How did you do the install?

I installed the extension via the web interface.

Did you restart after doing the install to get that log output?

The docker just rebooted once it crashed and I lost the initial log of the installation.
I started again to get the output.

And have you tried running npm rebuild in /data again?

1726e7155647:/data# npm rebuild
rebuilt dependencies successfully

Crashed again.

Also what is the host OS here? I see it's ARMv7 so is it a Raspberry Pi, if so what version of the OS are you using?

Yes, I'm running in a Raspberry Pi, using Raspbian buster.

@hardillb
Copy link
Member

Workaround for now, while we raise this with the upstream project.

In /data/node_modules/@serialport/bindings-cpp run npm run rebuild

@patrickelectric
Copy link
Author

/data/node_modules/@serialport/bindings-cpp

Thanks, that did work!

@dceejay
Copy link
Member

dceejay commented Dec 6, 2023

serailport node now bumped to v2.0.0 using latest underlying serialport v12 library.

@patrickelectric
Copy link
Author

btw this issue is still happening when installing from scratch using node-red 3.1.9 and node-red with node-red-node-serialport 2.0.2

@patrickelectric
Copy link
Author

patrickelectric commented Apr 16, 2024

Workaround for now, while we raise this with the upstream project.

In /data/node_modules/@serialport/bindings-cpp run npm run rebuild

This is not working anymore

@hardillb
Copy link
Member

We probably need to see the output of the rebuild command, but you really should add these comments to the node-serial issue linked above, as it's the only easy they are going to get the message that it's broken

@patrickelectric
Copy link
Author

Hi @hardillb, I just run npm run rebuild and it fixed the problem!
Do you know why is this still necessary ?

6e27a50136db:/usr/src/node-red# cd /data/node_modules/@serialport/bindings-cpp
6e27a50136db:/data/node_modules/@serialport/bindings-cpp# npm run rebuild

> @serialport/[email protected] rebuild
> node-gyp rebuild

gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | arm
gyp info find Python using Python version 3.11.8 found at "/usr/bin/python3"
gyp http GET https://nodejs.org/download/release/v16.20.2/node-v16.20.2-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v16.20.2/node-v16.20.2-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v16.20.2/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v16.20.2/SHASUMS256.txt
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/data/node_modules/@serialport/bindings-cpp/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.cache/node-gyp/16.20.2/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/16.20.2',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/16.20.2/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/data/node_modules/@serialport/bindings-cpp',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/data/node_modules/@serialport/bindings-cpp/build'
  CXX(target) Release/obj.target/bindings/src/serialport.o
  CXX(target) Release/obj.target/bindings/src/serialport_unix.o
  CXX(target) Release/obj.target/bindings/src/poller.o
  CXX(target) Release/obj.target/bindings/src/serialport_linux.o
  SOLINK_MODULE(target) Release/obj.target/bindings.node
  COPY Release/bindings.node
make: Leaving directory '/data/node_modules/@serialport/bindings-cpp/build'
gyp info ok 
6e27a50136db:/data/node_modules/@serialport/bindings-cpp# 

patrickelectric added a commit to patrickelectric/blueos-node-red that referenced this issue Apr 16, 2024
Based on the following issue: node-red/node-red-nodes#1027

Signed-off-by: Patrick José Pereira <[email protected]>
patrickelectric added a commit to patrickelectric/blueos-node-red that referenced this issue Apr 16, 2024
Based on the following issue: node-red/node-red-nodes#1027

Signed-off-by: Patrick José Pereira <[email protected]>
patrickelectric added a commit to BlueOS-community/blueos-node-red that referenced this issue Apr 16, 2024
Based on the following issue: node-red/node-red-nodes#1027

Signed-off-by: Patrick José Pereira <[email protected]>
@hardillb
Copy link
Member

@patrickelectric the problem is that the default pre-built binaries for node-serial don't support the musl libc library that is used instead of glibc in the Alpine based containers.

I have asked the node-serial maintainers to build Alpine based binaries, but they have not provided them yet.

The rebuild command builds the binary against musl library so it then works properly.

@patrickelectric
Copy link
Author

patrickelectric commented Apr 17, 2024 via email

@hardillb
Copy link
Member

It's in the scrollback just about DCJ's December 6th comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants