Help Needed module_not_found

Hi!

I don't know how I lost the worst possible module in node-red :cold_sweat: : node-red-contrib-home-assistant-websocket.

I'm running node-red on docker but I initially created it through the synology interface of docker and wanted to use a docker-compose instead of using the interface. I did a backup of the 'data' folder... so I thought, easy, just stop/delete the container from the interface and then re-create it with docker-compose (pointing to the same 'data' folder as before) but when I restarted it ONE (and only one?) module was not found anymore (the home-assistant-websocket... which I'm using for almost everything :sob: ).

I really hope someone can help me restore that because I would lose 2+ days of configuration :scream: .

When I start node-red, I can see the following message:

nodered     | 6 Jan 16:59:00 - [warn] ------------------------------------------------------
nodered     | 6 Jan 16:59:00 - [warn] [node-red-contrib-home-assistant-websocket/all] Error: Cannot find module './lib/websocket'
nodered     | Require stack:
nodered     | - /data/node_modules/ws/index.js
nodered     | - /data/node_modules/node-red-contrib-home-assistant-websocket/dist/homeAssistant/createSocket.js
nodered     | - /data/node_modules/node-red-contrib-home-assistant-websocket/dist/homeAssistant/Websocket.js
nodered     | - /data/node_modules/node-red-contrib-home-assistant-websocket/dist/homeAssistant/index.js
nodered     | - /data/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/config-server/controller.js
nodered     | - /data/node_modules/node-red-contrib-home-assistant-websocket/dist/nodes/config-server/index.js
nodered     | - /data/node_modules/node-red-contrib-home-assistant-websocket/dist/index.js
nodered     | - /usr/src/node-red/node_modules/@node-red/registry/lib/loader.js
nodered     | - /usr/src/node-red/node_modules/@node-red/registry/lib/index.js
nodered     | - /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/index.js
nodered     | - /usr/src/node-red/node_modules/@node-red/runtime/lib/index.js
nodered     | - /usr/src/node-red/node_modules/node-red/lib/red.js
nodered     | - /usr/src/node-red/node_modules/node-red/red.js
nodered     | 6 Jan 16:59:00 - [warn] ------------------------------------------------------
nodered     | 6 Jan 16:59:00 - [info] Settings file  : /data/settings.js
nodered     | 6 Jan 16:59:00 - [info] Context store  : 'default' [module=memory]
nodered     | 6 Jan 16:59:00 - [info] User directory : /data
nodered     | 6 Jan 16:59:00 - [warn] Projects disabled : editorTheme.projects.enabled=false
nodered     | 6 Jan 16:59:00 - [info] Flows file     : /data/flows.json
nodered     | 6 Jan 16:59:00 - [warn]
nodered     |
nodered     | ---------------------------------------------------------------------
nodered     | Your flow credentials file is encrypted using a system-generated key.
nodered     |
nodered     | If the system-generated key is lost for any reason, your credentials
nodered     | file will not be recoverable, you will have to delete it and re-enter
nodered     | your credentials.
nodered     |
nodered     | You should set your own key using the 'credentialSecret' option in
nodered     | your settings file. Node-RED will then re-encrypt your credentials
nodered     | file using your chosen key the next time you deploy a change.
nodered     | ---------------------------------------------------------------------
nodered     |
nodered     | 6 Jan 16:59:00 - [info] Waiting for missing types to be registered:
nodered     | 6 Jan 16:59:00 - [info]  - server
nodered     | 6 Jan 16:59:00 - [info]  - api-call-service
nodered     | 6 Jan 16:59:00 - [info]  - ha-zone
nodered     | 6 Jan 16:59:00 - [info]  - server-state-changed
nodered     | 6 Jan 16:59:00 - [info]  - ha-entity
nodered     | 6 Jan 16:59:00 - [info]  - api-current-state
nodered     | 6 Jan 16:59:00 - [info]  - server-events
nodered     | 6 Jan 16:59:00 - [info] Server now running at http://127.0.0.1:1880/

I checked in the backup folder but cannot see this 'websocket' folder??

Thanks for any help!

Holy crap, I was finally able to recover it... not sure what was missing but here is what I did:

  1. Created an empty node-red container
  2. Added the node-red-contrib-home-assistant-websocket module
  3. Created some basic flow/nodes which is using the module (not sure this is required)
  4. Deploy changes
  5. docker-compose down
  6. Copied all content of the node_modules folder to the nodes_modules folder of the container which was not working
  7. docker-compose up on my 'real' container
  8. Grab a beer and enjoy it :heart_eyes:

So happy right now :laughing:

1 Like