codmpm / node-red-contrib-loxone

Connect the Loxone Miniserver to node-red via the Websocket API
MIT License
74 stars 24 forks source link

error premature close on update on LoxBerry #46

Closed alexdpunkt closed 4 years ago

alexdpunkt commented 4 years ago

the update of node-red-contrib-loxone from v0.10.4 to v0.10.5 fails with the following log:

37 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:83:21)
38 verbose cwd /opt/loxberry/.node-red
39 verbose Linux 4.19.69-v7+
40 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "--no-audit" "--no-update-notifier" "--save" "--save-prefix=\"~\"" "--production" "node-red-contrib-loxone@0.10.5"
41 verbose node v12.16.2
42 verbose npm  v6.14.4
43 error premature close
44 verbose exit [ 1, true ]

node-red v1.0.3

codmpm commented 4 years ago

Hey. I don't know the internals of the loxberry. But IIRC there was a discussion about that over at the loxforum. I think git was missing, as this is needed now.

Could you check for that?

//edit: Hmm, ok. I was wrong. Git is needed since 0.10.4. Nevertheless I think this has something to do with the installation on LoxBerry.

alexdpunkt commented 4 years ago

Yeah I noticed that before while I was googling, and checked for that. git is installed on the system and up to date.

codmpm commented 4 years ago

Could this be some rights issue? Is it possible to install other nodes?

alexdpunkt commented 4 years ago

I updated multiple other nodes/packages today, all worked, only this one fails 🤷‍♂️

codmpm commented 4 years ago

Hmm. Ok. I have no Loxberry to reproduce. Could you check with the guys from loxforum?

codmpm commented 4 years ago

Please check with 0.10.6, should be fixed.

alexdpunkt commented 4 years ago

still the same error

2020-06-02T16:04:41.652Z installieren : node-red-contrib-loxone 0.10.6

2020-06-02T16:04:44.862Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-loxone@0.10.6 2020-06-02T16:04:58.451Z [err] npm 2020-06-02T16:04:58.451Z [err] ERR! premature close 2020-06-02T16:04:58.494Z [err] 2020-06-02T16:04:58.494Z [err] npm ERR! A complete log of this run can be found in: 2020-06-02T16:04:58.494Z [err] npm ERR! /opt/loxberry/.npm/_logs/2020-06-02T16_04_58_455Z-debug.log 2020-06-02T16:04:58.515Z rc=1

codmpm commented 4 years ago

Ok... then we'll have to set up a loxberry installation to track this down...

Could you post the error from /opt/loxberry/.npm/_logs?

codmdu commented 4 years ago

@alexdpunkt Hey. Could you please explain us how do you installed node-red on the loxberry ?

alexdpunkt commented 4 years ago

@codmdu sorry for the late reply. If I remember correctly I installed it like shown here: https://www.loxwiki.eu/pages/viewpage.action?pageId=18219468

so basically via bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)

codmpm commented 4 years ago

Ok, here is the current version of that howto https://github.com/codmpm/node-red-contrib-loxone/wiki/Anf%C3%A4nger%3A-Installation-RPi%2C-node-red%2C-nodes But there is not much difference to the loxwiki version.

Maybe the nodeJS and node-red versions are too old. In that cas simply run bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered) again to update. Your flows should be untouched by this process but make a backup beforehand.

alexdpunkt commented 4 years ago

I updated it with this command, but still no luck.

18 Jun 18:43:46 - [info] Upgrading module: node-red-contrib-loxone to version: 0.10.8
18 Jun 18:43:55 - [warn] Installation of module node-red-contrib-loxone failed:
18 Jun 18:43:55 - [warn] ------------------------------------------
18 Jun 18:43:55 - [warn] npm ERR! premature close
npm ERR! A complete log of this run can be found in:
npm ERR!     /opt/loxberry/.npm/_logs/2020-06-18T16_43_55_096Z-debug.log
18 Jun 18:43:55 - [warn] ------------------------------------------

Versions:

Node-RED v1.0.6 Node.js v12.16.2 npm 6.14.4

detailed log:

36 silly saveTree ├── node-red-node-smooth@0.1.2
36 silly saveTree └─┬ node-red-node-tail@0.1.1
36 silly saveTree   └── tail@2.0.3
37 verbose stack Error: premature close
37 verbose stack     at PassThrough.onclose (/usr/lib/node_modules/npm/node_modules/end-of-stream/index.js:47:67)
37 verbose stack     at PassThrough.emit (events.js:322:22)
37 verbose stack     at emitCloseNT (internal/streams/destroy.js:69:8)
37 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:83:21)
38 verbose cwd /opt/loxberry/.node-red
39 verbose Linux 4.19.69-v7+
40 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "--no-audit" "--no-update-notifier" "--save" "--save-prefix=\"~\"" "--production" "node-red-contrib-loxone@0.10.8"
41 verbose node v12.16.2
42 verbose npm  v6.14.4
43 error premature close
44 verbose exit [ 1, true ]

I then tried running the command in verbose mode, which brings the following:

npm verb config Skipping project config: /opt/loxberry/.npmrc. (matches userconfig)
npm verb npm-session 5ce9d555e5ca54c7
npm http fetch GET 304 https://registry.npmjs.org/node-red-contrib-loxone 411ms (from cache)
npm timing stage:loadCurrentTree Completed in 621ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 2ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 33ms
npm timing stage:rollbackFailedOptional Completed in 3ms
npm timing stage:runTopLevelLifecycles Completed in 2121ms
npm verb stack Error: premature close
codmpm commented 4 years ago

That's odd... the only thing I can think of is that loxberry won't play with node-red that way.

The howto you've mentioned is no loxberry specific - it's just Raspbian with node-red. So what did you do in the first place to install the pi? We need to reproduce this, so detailed steps for the installation are needed.

As an alternative please install a vanilla raspbian on a new sd-card for testing and let us know if this works. You could follow my guide on this - without loxberry.

alexdpunkt commented 4 years ago

I finally figured it out ... the problem was insufficient permissions on the /tmp directory, because of that the package managers didn't work anymore. Additionally I had PGP-Errors with some apt repositories... Can be closed 👍