Node red fail to start after sqlite node installed

Hello,

I'm running node-red on SIEMENS iot2050.
Node-red version: v1.2.7
Node.js version: v10.15.2
Linux 4.19.59+ arm64 LE

Everything was ok as soon as I installed a node, with: npm install node-red-node-sqlite in /usr/lib/node_modules folder.

After that node red wasn't active... also after a reboot.
I re-installed node red (loosing everything I did :face_with_symbols_over_mouth:...)... and now I can't ave node red active on startup.

If I start manually it's ok.

If I run sudo systemctl statu node-red, I get this answer:
image

I think it is possible to fix, but I can't figure out how to do!

In a terminal, stop node red then star it again and you should see the startup log which should give more information. Don't start it using systemd but manually in a terminal. I don't know how you run node-red on that system but possibly the command node-red will do it.
If possible please copy/paste the log rather than screenshot.

[Edit] Reinstalling node-red should not have deleted your flows file, it is probably just that the reinstalled system is looking in a different place. It may be useful to tell us how you installed it and how you did it the first time.

Thank for your reply.
This is the log:

I would say that the sqlite install failed. You might want to remove it then install manually from the userDir folder so that you can see exactly what happens - you can do the same from the palette manager by clicking the view log button.

How could I remove sqlite from cmd?

I've already remove it from Manage Palette in teh node-red GUI!

Remove it the same way you installed it, in the same directory, but using npm remove instead of npm install.

Mmmm... there something more...

Something is in a mess. How did you install node-red, nodejs and npm? Both the first time you did that and when you re-installed.

Is it really not possible for you to copy/paste logs here, screenshots are a pain? In order to google that error I had to retype it.

Is it really not possible for you to copy/paste logs here, screenshots are a pain?

Sorry, you're totally right.

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'remove',
1 verbose cli 'node-red-node-sqlite' ]
2 info using npm@6.10.3
3 info using node@v10.15.2
4 verbose npm-session 6adc786238d0dcff
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 verbose stack Error: Unsupported URL Type "npm:": npm:undefined@)
7 verbose stack at unsupportedURLType (/usr/lib/nodejs/npm-package-arg/npa.js:197:15)
7 verbose stack at fromURL (/usr/lib/nodejs/npm-package-arg/npa.js:250:13)
7 verbose stack at Function.resolve (/usr/lib/nodejs/npm-package-arg/npa.js:71:12)
7 verbose stack at computeVersionSpec (/usr/share/npm/lib/install/deps.js:311:21)
7 verbose stack at Uninstaller.Installer.normalizeCurrentTree (/usr/share/npm/lib/install.js:404:68)
7 verbose stack at Array. (/usr/lib/nodejs/slide/lib/bind-actor.js:15:8)
7 verbose stack at LOOP (/usr/lib/nodejs/slide/lib/chain.js:15:14)
7 verbose stack at /usr/lib/nodejs/slide/lib/chain.js:18:7
7 verbose stack at Uninstaller.loadArgMetadata (/usr/share/npm/lib/uninstall.js:59:5)
7 verbose stack at /usr/share/npm/lib/install.js:695:16
7 verbose stack at BB.join.then (/usr/share/npm/lib/install/read-shrinkwrap.js:34:16)
7 verbose stack at tryCatcher (/usr/lib/nodejs/bluebird/js/release/util.js:16:23)
7 verbose stack at Promise._settlePromiseFromHandler (/usr/lib/nodejs/bluebird/js/release/promise.js:512:31)
7 verbose stack at Promise._settlePromise (/usr/lib/nodejs/bluebird/js/release/promise.js:569:18)
7 verbose stack at Promise._settlePromise0 (/usr/lib/nodejs/bluebird/js/release/promise.js:614:10)
7 verbose stack at Promise._settlePromises (/usr/lib/nodejs/bluebird/js/release/promise.js:693:18)
8 verbose cwd /usr/lib/node_modules
9 verbose Linux 4.19.59+
10 verbose argv "/usr/bin/node" "/usr/bin/npm" "remove" "node-red-node-sqlite"
11 verbose node v10.15.2
12 verbose npm v6.10.3
13 error code EUNSUPPORTEDPROTOCOL
14 error Unsupported URL Type "npm:": npm:undefined@)
15 verbose exit [ 1, true ]

First time I didn't install node-red since was already built in the image of SO... second time I've done with npm.

Is node red installed into /use/lib/node_modules? If so then I suggest that you delete that whole folder and start again. I don't know the recommended way to install node red on that device though. The fact it didn't find your flows file, wherever that is, suggests that you have installed it in a different manner to the original install.

According to the startup log in the first image, the Users Directory is /root/.node-red

You have installed things as root globally so things are in the wrong place.

As others have said, the thing to do at this point is to take a deep breath, make a copy of your flows, credentials, etc. and start again from scratch.

Only node-red itself should be installed globally with sudo npm -g install node-red --production --unsafe-perm.

Check to make sure you don't have other things incorrectly installed globally with sudo npm ls --depth=0

Rename /root/.node-red to keep it safe. Do the same for whatever user you normally log in with.

Then run node-red manually to recreate the correct folder at ~/.node-red along with a new settings.js. cd to that folder and remember to always do that.

Go to the Editor for your node-red and install what you need from the palette manager not from the command line. Then you can edit your old flows file, copy the content and, in the Editor again, import from clipboard. You will possibly then need to set up some credentials for nodes that need them.

Guys. This is based on a Siemens box. I don’t know it explicitly but it may well default to being used as a root user.

Ah. Thanks Dave. Though if that is true, Siemens need a kick up the backside.

well - hopefully not - but just be careful before telling users to uninstall and reinstall as they may already be doing it right... most likely it doesn't have correct build tools or python or... something to install sqlite and build it. But yes - /usr/lib/node_modules in not the correct place to install in the first place... so some sort of back to initial state is required.

1 Like

It seems as though root is used as standard.

It is hard to track down useful data but found this:

meta-iot2050/node-red-node-sqlite_0.5.0.bb at master · siemens/meta-iot2050 (github.com)

So it seems that there is some kind of tooling that will manage these configurations for you.

I would suggest asking on the Siemens forum about how to manage these installations. It is too different to something standard that we are used to.

1 Like

Hej guys, thanks for the information you've given me!
I'm not so expert in Debian SO, this is the reason why I was more confused rather than now.

So I think I'll recreate the SO image according to previous time I did, and as SIEMENS says.

The only thing I want to ask is: is it possible that the second installation didn't affect files of the previous? Are there any possibilities that the flows that I create with the first instance are already accessible? Where I could find them?

Thanks

The flows file will be called flows_something.json. So you could search the filing system for files of that name to find where it is. Something like
find / -name "flows_*.json"

That should also find the credentials file which will be called flows_something_cred.json, you need the one without the _cred.

[Edit] Actually better to use this, which will also find the flow backup files
find / -name "*flows_*.json*"

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.