My docker compose node red has been very stable and I have multiple backups which also now fail. Because of calls to i2c in settings.js node red will not start. What happened? Is it an auto upgrade to 4.0.5
Anyway I've tried to rebuild eg using palette to install contrib-i2c. I get a long error message that starts with:
npm error code 1
npm error path /data/node_modules/i2c-bus
I get the same when I manually:
cd DockerIOT/nodered
dbash
cd /data
npm install i2c-bus
I have a near identical setup on another PI running 4.0.0 and it loads fine.
I'm sorry that I am a bit out of my depth here but would really appreciate some help.
Thanks I'll investigate that. I'm still confused as to what changed my stable setup and why when I restored a known good "tar" backup it still had the problem. I would love to lockdown my system so that this cannot happen.
I don't know about Docker. Does it build the container from the latest node-red docker image each time you instantiate it? Or something like that? If the latest node-red docker image includes that version of python, but not a later version of node-gyp then possibly that should be changed. @knolleary am I talking rubbish here?
You have a point but all the other elements like Grafana on my Pi are in Docker. I like the idea of everything being in "boxes" and the ease of backup. I'm investigating how to force a download of an earlier version of Nodered to see if that helps.
Docker can be good if you are using a pre-canned application like Grafana, which does not need to access the host hardware and requires minimum configuration to work. For something like node-red I strongly recommend just using the recommended install script. It will make your life easier. You would not have had this problem for example.
Yes you're probably right, but I have invested a lot of time learning Docker and getting Nodered to work in that environment. I had considered that this is the way forward.
I use my a compose.yaml file and in it i stipulate which Node-RED to use
Here is an example to load a certain version.
Hope this helps
services:
# ------------------------------------------------------------------------------------------
# NodeRED
# ------------------------------------------------------------------------------------------ ---
node-red:
image: nodered/node-red:3.1.3 # Make sure I am not using 'latest' as it may get changed in the future and break flows or nodes etc.
# container_name: - not used
Hi,
I had tried that with various iterations eg 4.0.0 and eventually gave up. However I tried your 3.1.3 and lo and behold it works!! I'm not sure what happens when it pulls down a Nodered docker image. Does it pull down all the node_modules including the ones that seemed to be causing me issues. I had a known good working backup tar file which I have used before to get me out of trouble, but it seems this time when I restored it, it pulled a newer version from the repository. Next question is: Is this a really old version of Nodered and will that cause problems. Also I had no interaction with nodered prior to it crashing so how did it decide to update itself.
Anyway thanks a lot.
How do you restart Docker and Node-RED what command do use ?
I have been using v3.1.3 for nearly 9 months and because I do not upgrade it, it works even if my PC crashes due to a power failure and I restart Docker.
I may update one day but thats the good thing about docker, I can choose which Node-RED version I use.
I am sure there are other ways, but it has proven reliable for me.
It all depends on what you have setup in your docker-compose.yml file.
Perhaps you could paste the contents of your file here ?
Also this is the command I use to restart Docker, even if my PC has crashed due to power outage.
Everything works fine, this way it doesn't restart the docker-compose.yml sudo systemctl restart docker
As was suggested: don't run node-red in docker, unless you know what you are doing.
If you want to make it work, you can create your own custom docker file, include all required components manually, build the image and start the container.