bartbutenaers / node-red-contrib-onvif-nodes

Node Red nodes for communicating with OnVif compliant IP devices
Apache License 2.0
65 stars 25 forks source link

The module sometimes delete it self #25

Open noenic opened 2 years ago

noenic commented 2 years ago

I don't know why but when i tinker to much with the flow i get strange errors, like pullpoint errors (more like firmware from my camera) but sometimes i restart node-red and the module is missing i need to clone it from git again strange thing...

Aug 23:27:25 - [info] Stopping flows 5 Aug 23:27:25 - [info] Stopped flows 5 Aug 23:27:25 - [info] Starting flows 5 Aug 23:27:25 - [info] Started flows 5 Aug 23:27:28 - [red] Uncaught Exception: 5 Aug 23:27:28 - Error: You should create pull-point subscription first! at Cam.pullMessages (/home/noenic/.node-red/node_modules/node-red-contrib-onvif-nodes/node_modules/onvif/lib/events.js:188:10) at Cam._eventPull (/home/noenic/.node-red/node_modules/node-red-contrib-onvif-nodes/node_modules/onvif/lib/events.js:309:9) at Cam. (/home/noenic/.node-red/node_modules/node-red-contrib-onvif-nodes/node_modules/onvif/lib/events.js:100:13) at ClientRequest. (/home/noenic/.node-red/node_modules/node-red-contrib-onvif-nodes/node_modules/onvif/lib/cam.js:296:4) at ClientRequest.emit (node:events:394:28) at Socket.socketErrorListener (node:_http_client:447:9) at Socket.emit (node:events:394:28) at emitErrorNT (node:internal/streams/destroy:157:8) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at processTicksAndRejections (node:internal/process/task_queues:83:21)

[restart node-red]

(node:3133) [DEP0128] DeprecationWarning: Invalid 'main' field in '/usr/local/lib/node_modules/node-red/node_modules/@node-red/editor-client/package.json' of './lib/index.js'. Please either fix that or report it to the module author (Use node --trace-deprecation ... to show where the warning was created) 5 Aug 23:27:48 - [info]

Welcome to Node-RED

5 Aug 23:27:48 - [info] Node-RED version: v2.0.5 5 Aug 23:27:48 - [info] Node.js version: v16.6.1 5 Aug 23:27:48 - [info] Linux 4.19.0-6-amd64 x64 LE 5 Aug 23:27:48 - [info] Loading palette nodes 5 Aug 23:27:49 - [info] Dashboard version 2.30.0 started at /ui 5 Aug 23:27:49 - [warn] Missing node modules: 5 Aug 23:27:49 - [warn] - node-red-contrib-onvif-nodes (0.0.1-beta.14): onvif-config, onvif-device, onvif-discovery, onvif-imaging, onvif-media, onvif-ptz, onvif-recording, onvif-events 5 Aug 23:27:49 - [info] Removing modules from config 5 Aug 23:27:49 - [info] Settings file : /home/noenic/.node-red/settings.js 5 Aug 23:27:49 - [info] Context store : 'default' [module=memory] 5 Aug 23:27:49 - [info] User directory : /home/noenic/.node-red 5 Aug 23:27:49 - [warn] Projects disabled : editorTheme.projects.enabled=false 5 Aug 23:27:49 - [info] Flows file : /home/noenic/.node-red/flows.json 5 Aug 23:27:49 - [info] Server now running at http://127.0.0.1:1880/ 5 Aug 23:27:49 - [warn]

5 Aug 23:27:49 - [info] Waiting for missing types to be registered: 5 Aug 23:27:49 - [info] - onvif-config 5 Aug 23:27:49 - [info] - onvif-ptz 5 Aug 23:27:49 - [info] - onvif-events

bartbutenaers commented 2 years ago

Hi @noenic,

To be honest I have no idea why this package could have been removed. No idea at all... Can you please ask this question on the Node-RED Discourse forum, and add a link to your discussion here afterwards. I'm very curious if someone else knows what could cause this...

Bart

Nikotine1 commented 2 years ago

I'm having the same issue. After a reboot, I always need to reinstall the palette:

> node-red-docker@2.1.1 start /usr/src/node-red
> node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS "--userDir" "/data"
26 Oct 22:04:58 - [info] 
Welcome to Node-RED
===================

26 Oct 22:04:58 - [info] Node-RED version: v2.1.1
26 Oct 22:04:58 - [info] Node.js  version: v14.18.1
26 Oct 22:04:58 - [info] Linux 5.10.63-v8+ arm64 LE
26 Oct 22:04:59 - [info] Loading palette nodes
26 Oct 22:05:01 - [info] Dashboard version 3.0.4 started at /ui
26 Oct 22:05:01 - [warn] Missing node modules:
26 Oct 22:05:01 - [warn]  - node-red-contrib-onvif-nodes (0.0.1-beta.15): onvif-config, onvif-device, onvif-discovery, onvif-imaging, onvif-media, onvif-ptz, onvif-recording, onvif-events
26 Oct 22:05:01 - [info] Removing modules from config
26 Oct 22:05:01 - [info] Settings file  : /data/settings.js
26 Oct 22:05:01 - [info] Context store  : 'default' [module=memory]
26 Oct 22:05:01 - [info] User directory : /data
26 Oct 22:05:01 - [warn] Projects disabled : editorTheme.projects.enabled=false
26 Oct 22:05:01 - [info] Flows file     : /data/flows.json
26 Oct 22:05:01 - [info] Server now running at http://127.0.0.1:1880/
26 Oct 22:05:01 - [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.
---------------------------------------------------------------------

26 Oct 22:05:01 - [info] Waiting for missing types to be registered:
26 Oct 22:05:01 - [info]  - onvif-config
26 Oct 22:05:01 - [info]  - onvif-events
26 Oct 22:05:01 - [info]  - onvif-device
26 Oct 22:06:15 - [info] Stopping flows
26 Oct 22:06:15 - [info] Stopped flows
26 Oct 22:06:15 - [info] Waiting for missing types to be registered:
26 Oct 22:06:15 - [info]  - onvif-config
26 Oct 22:06:15 - [info]  - onvif-events
26 Oct 22:06:15 - [info]  - onvif-device
26 Oct 22:06:35 - [info] Stopping flows
26 Oct 22:06:35 - [info] Stopped flows
26 Oct 22:06:35 - [info] Waiting for missing types to be registered:
26 Oct 22:06:35 - [info]  - onvif-config
26 Oct 22:06:35 - [info]  - onvif-events
26 Oct 22:06:35 - [info]  - onvif-device
26 Oct 22:09:23 - [info] Stopping flows
26 Oct 22:09:23 - [info] Stopped flows
26 Oct 22:09:23 - [info] Waiting for missing types to be registered:
26 Oct 22:09:23 - [info]  - onvif-config
26 Oct 22:09:23 - [info]  - onvif-events
26 Oct 22:09:23 - [info]  - onvif-device

I have many other palettes installed, this is the only one that does this.

The /data folder of node-red is mounted as a volume.

Installation of this palette throws some errors though:

pi@rpi4-servemepi:~/node-red $ docker exec -it node-red /bin/bash
bash-5.0$ npm install node-red-contrib-onvif-nodes@0.0.1-beta.15
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm notice created a lockfile as package-lock.json. You should commit this file.
+ node-red-contrib-onvif-nodes@0.0.1-beta.15
added 38 packages from 55 contributors and audited 328 packages in 11.442s

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

found 4 moderate severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
bash-5.0$

EDIT: I have now manually added this palette to package.json. https://docs.npmjs.com/specifying-dependencies-and-devdependencies-in-a-package-json-file After a reboot it's still there, fingers crossed.

{
    "name": "node-red-project",
    "description": "A Node-RED Project",
    "version": "0.0.1",
    "private": true,
    "dependencies": {
        "node-red-contrib-home-assistant-websocket": "~0.36.1",
        "node-red-dashboard": "~3.0.4",
        "node-red-contrib-onvif-nodes": "~0.0.1-beta.15"
    }
}
bartbutenaers commented 2 years ago

Hi @Nikotine1, That is indeed very inconvenient. But I can only give the same advice as above: please discuss this on discourse.nodered.org, because there are folks hanging out that have much more NPM knowledge... Bart

Nikotine1 commented 2 years ago

Hi Bart, Adding the line to package.json seems to have worked. It has survived several reboots now.

Groeten van een mede-Belg ;-)

zinen commented 1 year ago

If you run into this issue and you are running inside a docker container. Try to use the following strategi when installing manually via npm:

docker exec -it node-red /bin/bash
cd /data
npm install node-red-contrib-onvif-nodes@<current version from release page>

The important step here is the cd /data as this will get you to you'r node-red root install directory.