Conflict between node-red-node-sqlite and node-red-contrib-sqlitedb

Hi there,
Yesterday I have updated node-red (in Home Assistant) and since that there is a conflict between node-red-node-sqlite and node-red-contrib-sqlitedb.

How can I resolve this issue? node-red-contrib-sqlitedb is required for another add-on, node-red-contrib-mysensors

image

You cannot have both of those modules installed at the same time - they both provide a node type with the same id.

You'll need to uninstall one of them.

1 Like

Thanks for your answer. The strange thing is that I've had these two installed together for at least a year but only after this recent update, I have this error. What is changed that causes this?

What can I do to make the mysensors node work based on the sqlite node?

Hi can you have a look again? I have re-installed the sqlite node and now I no longer have a conflict, but the sqlite node gives this error.
image

When I deploy, I get this error
image

Hi.

What version of Node.js do you have installed ?
You can check with node -v

I believe the current Sqlite node version doesnt support a node.js version higher than v12.20.2
Read this related thread

I'm running home assistant, so I assume it is a later version of node. I will try to find out the version. Thanks

yes indeed. sqlite only for node.js v12.

node-red-node-sqlite current version 0.6.0 installs ok for me on Ubuntu with nodejs 14.16.0

Hi @Colin .. yea possibly on Ubuntu it works without issue because the sqlite3 pre-built binaries are available for Nodejs v14 for that OS.
The problem I and @NodeC was facing was on windows systems with an error.
node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.2.0 and node@14.16.0
One way to solve it was to downgrade to node v12.

I had some time in the weekend and updated nodejs again to v14 on my win10 test system and followed @Steve-Mcl suggestion to install the windows build tools
npm install --global windows-build-tools
and that did the trick.
Sqlite node installed and seems to be working.

ps. Sorry @rikki78 if this is totally unrelated to your issue.

2 Likes

So I have checked the node version, which is v14.16.0
node-red-node-sqlite is v0.6, and I'm running on Ubuntu 20.04.

In a terminal go to your .node-red folder and run
npm remove node-red-node-sqlite
npm install node-red-node-sqlite

and copy/paste the output here please.


root@a0d7b954-nodered:/config/node-red/node_modules$ npm remove node-red-node-sqlite
removed 1 package and audited 308 packages in 2.107s

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

found 15 vulnerabilities (10 low, 5 high)
  run `npm audit fix` to fix them, or `npm audit` for details


   โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
   โ”‚                                                               โ”‚
   โ”‚      New major version of npm available! 6.14.11 โ†’ 7.7.5      โ”‚
   โ”‚   Changelog: https://github.com/npm/cli/releases/tag/v7.7.5   โ”‚
   โ”‚               Run npm install -g npm to update!               โ”‚
   โ”‚                                                               โ”‚
   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

root@a0d7b954-nodered:/config/node-red/node_modules$ npm install node-red-node-sqlite
+ node-red-node-sqlite@0.6.0
added 1 package from 1 contributor and audited 309 packages in 2.736s

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

found 17 vulnerabilities (12 low, 5 high)
  run `npm audit fix` to fix them, or `npm audit` for details


   โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
   โ”‚                                                               โ”‚
   โ”‚      New major version of npm available! 6.14.11 โ†’ 7.7.5      โ”‚
   โ”‚   Changelog: https://github.com/npm/cli/releases/tag/v7.7.5   โ”‚
   โ”‚               Run npm install -g npm to update!               โ”‚
   โ”‚                                                               โ”‚
   โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

root@a0d7b954-nodered:/config/node-red/node_modules$

Why are you running as root? The root account on Ubuntu is disabled by default and should not normally be enabled unless you have a good reason and know what you are doing.

Also I draw your attention to what I suggested, pay particular note to the bit about the folder.

I'm running home assistant, and node red is running in docker. To be able to access the container I have to be root.
The node red node modules are installed in this config folder and therefore I've run this command there. In this folder all the modules are installed, also when they are installed through the palette.

OK, I don't know anything about that environment, so may not be able to help.

I presume you can see the node-red startup log somewhere. What does it show when you start node-red?

Good point! Something is mentioned about sqlite.


27 Mar 16:18:09 - [warn] ------------------------------------------------------
27 Mar 16:18:09 - [warn] [node-red-contrib-mysensors/mysdb] Error: Cannot find module '/config/node-red/node_modules/sqlite3/lib/binding/node-v83-linux-x64/node_sqlite3.node'
Require stack:
- /config/node-red/node_modules/sqlite3/lib/sqlite3-binding.js
- /config/node-red/node_modules/sqlite3/lib/sqlite3.js
- /config/node-red/node_modules/sqlite/main.js
- /config/node-red/node_modules/node-red-contrib-mysensors/dist/lib/database-sqlite.js
- /config/node-red/node_modules/node-red-contrib-mysensors/dist/nodes/mysensors-db.js
- /opt/node_modules/@node-red/registry/lib/loader.js
- /opt/node_modules/@node-red/registry/lib/index.js
- /opt/node_modules/@node-red/runtime/lib/nodes/index.js
- /opt/node_modules/@node-red/runtime/lib/index.js
- /opt/node_modules/node-red/lib/red.js
- /opt/node_modules/node-red/red.js

That is a problem with a dependency on that node. I suggest removing and re-installing that one (assuming you are using it).

Thanks for the hint.
Is there any chance, removing the node and reinstalling will break it? I'm asking because it is used in quite some flows and if this doesn't work, the WAF will be greatly reduced if you understand what I mean :wink:

Unlikely I would have thought, but I wouldn't guarantee it.

Can you post the full startup log, there may be something you are missing.

Yes sure:

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] customizations.sh: executing... 
[cont-init.d] customizations.sh: exited 0.
[cont-init.d] nginx.sh: executing... 
[cont-init.d] nginx.sh: exited 0.
[cont-init.d] node-red.sh: executing... 
[17:42:46] INFO: Password is NOT in the Have I Been Pwned database! Nice!
[17:42:47] INFO: Password is NOT in the Have I Been Pwned database! Nice!
patching file nodes/ui_base.html
Hunk #1 succeeded at 1159 (offset 628 lines).
audited 309 packages in 1.996s
16 packages are looking for funding
  run `npm fund` for details
found 17 vulnerabilities (12 low, 5 high)
  run `npm audit fix` to fix them, or `npm audit` for details
[cont-init.d] node-red.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[17:42:50] INFO: Starting Node-RED...
> addon-node-red@ start /opt
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
27 Mar 17:42:50 - [info] 
Welcome to Node-RED
===================
27 Mar 17:42:50 - [info] Node-RED version: v1.2.9
27 Mar 17:42:50 - [info] Node.js  version: v14.16.0
27 Mar 17:42:50 - [info] Linux 5.8.0-45-generic x64 LE
27 Mar 17:42:51 - [info] Loading palette nodes
27 Mar 17:42:52 - [info] Dashboard version 2.28.1 started at /endpoint/ui
/bin/sh: /opt/node_modules/node-red-node-pi-gpio/testgpio.py: not found
27 Mar 17:42:53 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
27 Mar 17:42:53 - [warn] ------------------------------------------------------
27 Mar 17:42:53 - [warn] [node-red-contrib-mysensors/mysdb] Error: Cannot find module '/config/node-red/node_modules/sqlite3/lib/binding/node-v83-linux-x64/node_sqlite3.node'
Require stack:
- /config/node-red/node_modules/sqlite3/lib/sqlite3-binding.js
- /config/node-red/node_modules/sqlite3/lib/sqlite3.js
- /config/node-red/node_modules/sqlite/main.js
- /config/node-red/node_modules/node-red-contrib-mysensors/dist/lib/database-sqlite.js
- /config/node-red/node_modules/node-red-contrib-mysensors/dist/nodes/mysensors-db.js
- /opt/node_modules/@node-red/registry/lib/loader.js
- /opt/node_modules/@node-red/registry/lib/index.js
- /opt/node_modules/@node-red/runtime/lib/nodes/index.js
- /opt/node_modules/@node-red/runtime/lib/index.js
- /opt/node_modules/node-red/lib/red.js
- /opt/node_modules/node-red/red.js
27 Mar 17:42:53 - [warn] [node-red-node-sqlite/sqlite] Error: Cannot find module '/config/node-red/node_modules/sqlite3/lib/binding/node-v83-linux-x64/node_sqlite3.node'
Require stack:
- /config/node-red/node_modules/sqlite3/lib/sqlite3-binding.js
- /config/node-red/node_modules/sqlite3/lib/sqlite3.js
- /config/node-red/node_modules/node-red-node-sqlite/sqlite.js
- /opt/node_modules/@node-red/registry/lib/loader.js
- /opt/node_modules/@node-red/registry/lib/index.js
- /opt/node_modules/@node-red/runtime/lib/nodes/index.js
- /opt/node_modules/@node-red/runtime/lib/index.js
- /opt/node_modules/node-red/lib/red.js
- /opt/node_modules/node-red/red.js
27 Mar 17:42:53 - [warn] ------------------------------------------------------
27 Mar 17:42:53 - [info] Settings file  : /etc/node-red/config.js
27 Mar 17:42:53 - [info] Context store  : 'default' [module=memory]
27 Mar 17:42:53 - [info] User directory : /config/node-red/
27 Mar 17:42:53 - [warn] Projects disabled : editorTheme.projects.enabled=false
27 Mar 17:42:53 - [info] Flows file     : /config/node-red/flows.json
27 Mar 17:42:53 - [info] Server now running at http://127.0.0.1:46836/

Here after flows are started, I assume these are not needed.