ioBroker / ioBroker.node-red

Instantiate the server with node-red
Apache License 2.0
52 stars 29 forks source link

error message "empty object" on (re)start #411

Closed Marc-Berg closed 10 months ago

Marc-Berg commented 10 months ago

Each time the instance is started, the error message "empty object!" appears three times without any reference as to where the message could have come from. The errors also appear when all flows are deactivated. I have already done this:

Any tips on how I could get closer to the cause?

js-controller: 5.0.16 Node.js: 18.18.2 Buanet Docker Image 9.0.1 Adapter Version 5.0.0

2023-11-27 16:27:37.004  - info:  node-red.0 (140587) starting. Version 5.0.0 in  /opt/iobroker/node_modules/iobroker.node-red, node: v18.18.2,  js-controller: 5.0.16
2023-11-27 16:27:37.018  - debug: node-red.0 (140587) Found searched text "// THIS LINE WILL BE CHANGED FOR ADMIN" of /nodes/ioBroker.html in line 32
2023-11-27 16:27:37.027  - debug:  node-red.0 (140587) [syncPublic] Copied  /opt/iobroker/node_modules/iobroker.node-red/public/admin.css to  /opt/iobroker/node_modules/@node-red/editor-client/public/admin.css
2023-11-27 16:27:37.027  - debug:  node-red.0 (140587) [syncPublic] Copied  /opt/iobroker/node_modules/iobroker.node-red/public/img/info-big.png to  /opt/iobroker/node_modules/@node-red/editor-client/public/img/info-big.png
2023-11-27 16:27:37.027  - debug:  node-red.0 (140587) [syncPublic] Copied  /opt/iobroker/node_modules/iobroker.node-red/public/lib/css/fancytree/channel.png  to  /opt/iobroker/node_modules/@node-red/editor-client/public/lib/css/fancytree/channel.png
2023-11-27 16:27:37.027  - debug:  node-red.0 (140587) [syncPublic] Copied  /opt/iobroker/node_modules/iobroker.node-red/public/lib/css/fancytree/device.png  to  /opt/iobroker/node_modules/@node-red/editor-client/public/lib/css/fancytree/device.png
2023-11-27 16:27:37.028  - debug:  node-red.0 (140587) [syncPublic] Copied  /opt/iobroker/node_modules/iobroker.node-red/public/lib/css/fancytree/loading.gif  to  /opt/iobroker/node_modules/@node-red/editor-client/public/lib/css/fancytree/loading.gif
2023-11-27 16:27:37.028  - debug:  node-red.0 (140587) [syncPublic] Copied  /opt/iobroker/node_modules/iobroker.node-red/public/lib/css/fancytree/state.png  to  /opt/iobroker/node_modules/@node-red/editor-client/public/lib/css/fancytree/state.png
2023-11-27 16:27:37.028  - debug:  node-red.0 (140587) [syncPublic] Copied  /opt/iobroker/node_modules/iobroker.node-red/public/lib/css/fancytree/ui.fancytree.min-win7.css  to  /opt/iobroker/node_modules/@node-red/editor-client/public/lib/css/fancytree/ui.fancytree.min-win7.css
2023-11-27 16:27:37.028  - debug:  node-red.0 (140587) [syncPublic] Copied  /opt/iobroker/node_modules/iobroker.node-red/public/lib/css/fancytree/ui.fancytree.min.css  to  /opt/iobroker/node_modules/@node-red/editor-client/public/lib/css/fancytree/ui.fancytree.min.css
2023-11-27 16:27:37.028  - debug:  node-red.0 (140587) [syncPublic] Copied  /opt/iobroker/node_modules/iobroker.node-red/public/schedule/LICENSE.txt  to  /opt/iobroker/node_modules/@node-red/editor-client/public/schedule/LICENSE.txt
2023-11-27 16:27:37.028  - debug:  node-red.0 (140587) [syncPublic] Copied  /opt/iobroker/node_modules/iobroker.node-red/public/schedule/index.html  to  /opt/iobroker/node_modules/@node-red/editor-client/public/schedule/index.html
2023-11-27 16:27:37.028  - debug:  node-red.0 (140587) [syncPublic] Copied  /opt/iobroker/node_modules/iobroker.node-red/public/schedule/style.css  to  /opt/iobroker/node_modules/@node-red/editor-client/public/schedule/style.css
2023-11-27 16:27:37.029  - debug:  node-red.0 (140587) [syncPublic] Copied  /opt/iobroker/node_modules/iobroker.node-red/public/selectID.js to  /opt/iobroker/node_modules/@node-red/editor-client/public/selectID.js
2023-11-27 16:27:37.029  - debug:  node-red.0 (140587) [syncPublic] Copied  /opt/iobroker/node_modules/iobroker.node-red/public/vendor/icons.gif to  /opt/iobroker/node_modules/@node-red/editor-client/public/vendor/icons.gif
2023-11-27 16:27:37.030  - debug:  node-red.0 (140587) [syncPublic] Copied  /opt/iobroker/node_modules/iobroker.node-red/public/vendor/jquery.fancytree-all.min.js  to  /opt/iobroker/node_modules/@node-red/editor-client/public/vendor/jquery.fancytree-all.min.js
2023-11-27 16:27:37.030  - debug:  node-red.0 (140587) [syncPublic] Copied  /opt/iobroker/node_modules/iobroker.node-red/public/vendor/ui.fancytree.min.css  to  /opt/iobroker/node_modules/@node-red/editor-client/public/vendor/ui.fancytree.min.css
2023-11-27 16:27:37.037  - debug: node-red.0 (140587) Updated flow cred configuration of object data
2023-11-27 16:27:37.040  - debug: node-red.0 (140587) Updated flow configuration of object data
2023-11-27 16:27:37.042  - debug: node-red.0 (140587) Found system secret: b9ce0d15928660d58cfd119e9faf5a1a8fac2adb53c20f94**********
2023-11-27 16:27:37.043  - debug:  node-red.0 (140587) Writing extended authentication for authType:  "None": {"type":"credentials","users":[],"default":{"permissions":"*"}}
2023-11-27 16:27:37.043  - debug: node-red.0 (140587) [writeSettings] Additional npm packages (functionGlobalContext):
2023-11-27 16:27:37.046  - debug: node-red.0 (140587) [writeSettings] Updated settings file: /opt/iobroker/iobroker-data/node-red/settings.js
2023-11-27 16:27:37.066  - error: node-red.0 (140587) empty object!
2023-11-27 16:27:37.101  - error: node-red.0 (140587) empty object!
2023-11-27 16:27:37.132  - error: node-red.0 (140587) empty object!
2023-11-27 16:27:37.330  - info:  node-red.0 (140587) Starting node-red: --max-old-space-size=256  /opt/iobroker/node_modules/node-red/red.js -v --settings  /opt/iobroker/iobroker-data/node-red/settings.js
2023-11-27 16:27:37.678  - debug: node-red.0 (140587) Node-RED: 27 Nov 16:27:37 - [info] Willkommen bei Node-RED
2023-11-27 16:27:37.679  - debug: node-red.0 (140587) Node-RED: 27 Nov 16:27:37 - [info] Node-RED Version: v3.1.0
2023-11-27 16:27:37.679  - debug: node-red.0 (140587) Node-RED: 27 Nov 16:27:37 - [info] Node.js  Version: v18.18.2
27 Nov 16:27:37 - [info] Linux 5.15.0-89-generic x64 LE
2023-11-27 16:27:37.961  - debug: node-red.0 (140587) Node-RED: 27 Nov 16:27:37 - [info] Paletten-Nodes werden geladen
2023-11-27 16:27:38.663  - debug: node-red.0 (140587) Node-RED: 27 Nov 16:27:38 - [info] Dashboard version 3.6.0 started at /ui
2023-11-27 16:27:38.795  - debug: node-red.0 (140587) Node-RED: 27 Nov 16:27:38 - [info] Polymer started at /polymer
2023-11-27 16:27:39.003  - debug: node-red.0 (140602) Redis Objects: Use Redis connection: redis:6379
2023-11-27 16:27:39.013  - debug: node-red.0 (140602) Objects client ready ... initialize now
2023-11-27 16:27:39.017  - debug: node-red.0 (140602) Objects create System PubSub Client
2023-11-27 16:27:39.017  - debug: node-red.0 (140602) Objects create User PubSub Client
2023-11-27 16:27:39.141  - debug: node-red.0 (140587) Node-RED: 27 Nov 16:27:39 - [info] Einstellungsdatei: /opt/iobroker/iobroker-data/node-red/settings.js
2023-11-27 16:27:39.142  - debug: node-red.0 (140587) Node-RED: 27 Nov 16:27:39 - [info] Kontextspeicher: default [module=memory]
2023-11-27 16:27:39.143  - debug: node-red.0 (140587) Node-RED: 27 Nov 16:27:39 - [info] Benutzerverzeichnis: /opt/iobroker/iobroker-data/node-red/
2023-11-27 16:27:39.143  - warn: node-red.0 (140587) Node-RED: 27 Nov 16:27:39 - [warn] Projekte deaktiviert: editorTheme.projects.enabled=false
2023-11-27 16:27:39.143  - debug: node-red.0 (140587) Node-RED: 27 Nov 16:27:39 - [info] Flow-Datei: /opt/iobroker/iobroker-data/node-red/flows.json
2023-11-27 16:27:39.153  - debug: node-red.0 (140587) Node-RED: 27 Nov 16:27:39 - [info] Server wird jetzt auf http://127.0.0.1:1880/ ausgeführt
2023-11-27 16:27:39.177  - debug: node-red.0 (140587) Node-RED: 27 Nov 16:27:39 - [info] Flows werden gestartet
2023-11-27 16:27:39.303  - debug: node-red.0 (140587) Node-RED: 27 Nov 16:27:39 - [info] Flows sind gestartet
Marc-Berg commented 10 months ago

In case it hasn't become clear yet: I still can't see any restrictions, only the error messages.

Marc-Berg commented 10 months ago

It seems that it also affects other adapters, which you can see IF you switch off the filter. This needs further investigation by me.

klein0r commented 10 months ago

I don't even know where the empty object! text is generated. The node-red adapter doesn't contain that text. Maybe that is raised by the js-controller? Let me know if you have further information.

klein0r commented 10 months ago

Maybe here: https://github.com/ioBroker/ioBroker.js-controller/blob/9cb8af819cc6ef0b8b7d1f3daefc50465c583e28/packages/db-objects-redis/src/lib/objects/objectsInRedisClient.ts#L3931-L3934

Apollon77 commented 10 months ago

if this happens then an object exists in the database but without any content ... this should never happen normally

klein0r commented 10 months ago

an object exists in the database but without any content

Empty means "completely empty"? Like {} ? Without any id or any other attributes? How is it even possible to store such an object

Apollon77 commented 10 months ago

as you see in your copied code it checks for falsy after JSON parse ... and JSON parse must have been successfull on the value in DB

Marc-Berg commented 10 months ago

I added some debug output (thanks @klein0r for the matching lines of code), but was not able to identify the problematic objects. So I converted my objects and states database from redis to jsonl and back, the errors are now gone. My assumption now is that after updating the Node-Red Adapter to version 5.0.0 the errors were caused by the initially missing credentials. Probably also due to a lack of error handling on my part in NodeRed. Thank you very much for looking into this.