Hi I hope someone here can help me. I am trying to install a set of nodes and uninstall another set and they both return similar error. If someone here who has more experience in deciphering the logs, it would be much appreciated.
NR Version: 1.1.3
Platform: Raspberry Pi OS
Update: So it appears that even given these errors, when I restart NR manually, the nodes are now magically installed or uninstalled. The weirdest thing is that if I install another set of nodes and repeat with this same method, restart manually, the previous nodes are now uninstalled, as if they were cached or installed temporarily, and the new nodes are installed in their place.
If any additional info would be helpful, please feel free to ask.
Install
2020-09-13T01:35:58.883Z Install : node-red-contrib-stoptimer-varidelay 0.4.4
2020-09-13T01:35:58.968Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix="~" --production node-red-contrib-stoptimer-varidelay@0.4.4
2020-09-13T01:36:10.199Z [out]
2020-09-13T01:36:10.199Z [out] > @serialport/bindings@8.0.8 install /home/pi/.node-red/node_modules/@serialport/bindings
2020-09-13T01:36:10.199Z [out] > prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2020-09-13T01:36:10.199Z [out]
2020-09-13T01:36:11.425Z [err] prebuild-install
2020-09-13T01:36:11.426Z [err] WARN install No prebuilt binaries found (target=12.18.3 runtime=node arch=arm libc= platform=linux)
2020-09-13T01:36:13.682Z [out] make: Entering directory '/home/pi/.node-red/node_modules/@serialport/bindings/build'
2020-09-13T01:36:13.685Z [out] CXX(target) Release/obj.target/bindings/src/serialport.o
2020-09-13T01:36:13.700Z [err] g++: internal compiler error: Segmentation fault signal terminated program cc1plus
2020-09-13T01:36:13.700Z [err] Please submit a full bug report,
2020-09-13T01:36:13.700Z [err] with preprocessed source if appropriate.
2020-09-13T01:36:13.700Z [err] See <file:///usr/share/doc/gcc-8/README.Bugs> for instructions.
2020-09-13T01:36:13.701Z [err] make: *** [bindings.target.mk:112: Release/obj.target/bindings/src/serialport.o] Error 4
2020-09-13T01:36:13.701Z [out] make: Leaving directory '/home/pi/.node-red/node_modules/@serialport/bindings/build'
2020-09-13T01:36:13.705Z [err] gyp
2020-09-13T01:36:13.706Z [err]
2020-09-13T01:36:13.707Z [err] ERR! build error
2020-09-13T01:36:13.715Z [err] gyp
2020-09-13T01:36:13.716Z [err] ERR! stack Error: `make` failed with exit code: 2
2020-09-13T01:36:13.716Z [err] gyp ERR!
2020-09-13T01:36:13.716Z [err] stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
2020-09-13T01:36:13.716Z [err] gyp ERR! stack
2020-09-13T01:36:13.716Z [err] at ChildProcess.emit (events.js:315:20)
2020-09-13T01:36:13.716Z [err] gyp ERR!
2020-09-13T01:36:13.717Z [err] stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
2020-09-13T01:36:13.718Z [err] gyp
2020-09-13T01:36:13.718Z [err] ERR! System Linux 5.4.51-v7+
2020-09-13T01:36:13.718Z [err] gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2020-09-13T01:36:13.718Z [err] gyp ERR!
2020-09-13T01:36:13.719Z [err] cwd /home/pi/.node-red/node_modules/@serialport/bindings
2020-09-13T01:36:13.719Z [err] gyp
2020-09-13T01:36:13.719Z [err] ERR! node -v v12.18.3
2020-09-13T01:36:13.719Z [err] gyp ERR! node-gyp -v v5.1.0
2020-09-13T01:36:13.719Z [err] gyp ERR! not ok
2020-09-13T01:36:13.720Z [err]
2020-09-13T01:36:14.472Z [err] npm
2020-09-13T01:36:14.472Z [err] WARN node-red-project@0.0.1 No repository field.
2020-09-13T01:36:14.484Z [err] npm
2020-09-13T01:36:14.485Z [err] WARN node-red-project@0.0.1 No license field.
2020-09-13T01:36:14.485Z [err]
2020-09-13T01:36:14.511Z [err] npm
2020-09-13T01:36:14.512Z [err] ERR! code ELIFECYCLE
2020-09-13T01:36:14.512Z [err] npm
2020-09-13T01:36:14.512Z [err] ERR! errno 1
2020-09-13T01:36:14.519Z [err] npm
2020-09-13T01:36:14.520Z [err] ERR! @serialport/bindings@8.0.8 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
2020-09-13T01:36:14.520Z [err] npm ERR! Exit status 1
2020-09-13T01:36:14.520Z [err] npm
2020-09-13T01:36:14.520Z [err] ERR!
2020-09-13T01:36:14.520Z [err] npm ERR!
2020-09-13T01:36:14.520Z [err] Failed at the @serialport/bindings@8.0.8 install script.
2020-09-13T01:36:14.520Z [err] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-09-13T01:36:14.552Z [err]
2020-09-13T01:36:14.553Z [err] npm ERR! A complete log of this run can be found in:
2020-09-13T01:36:14.553Z [err] npm ERR! /home/pi/.npm/_logs/2020-09-13T01_36_14_530Z-debug.log
2020-09-13T01:36:14.573Z rc=1
Remove
2020-09-13T01:41:31.443Z Remove : node-red-node-pi-gpio
2020-09-13T01:41:31.572Z npm remove --no-audit --no-update-notifier --no-fund --save node-red-node-pi-gpio
2020-09-13T01:41:42.024Z [out]
2020-09-13T01:41:42.024Z [out] > @serialport/bindings@8.0.8 install /home/pi/.node-red/node_modules/@serialport/bindings
2020-09-13T01:41:42.024Z [out] > prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2020-09-13T01:41:42.024Z [out]
2020-09-13T01:41:43.251Z [err] prebuild-install
2020-09-13T01:41:43.254Z [err] WARN install No prebuilt binaries found (target=12.18.3 runtime=node arch=arm libc= platform=linux)
2020-09-13T01:41:45.530Z [out] make: Entering directory '/home/pi/.node-red/node_modules/@serialport/bindings/build'
2020-09-13T01:41:45.533Z [out] CXX(target) Release/obj.target/bindings/src/serialport.o
2020-09-13T01:41:45.548Z [err] g++: internal compiler error: Segmentation fault signal terminated program cc1plus
2020-09-13T01:41:45.548Z [err] Please submit a full bug report,
2020-09-13T01:41:45.548Z [err] with preprocessed source if appropriate.
2020-09-13T01:41:45.548Z [err] See <file:///usr/share/doc/gcc-8/README.Bugs> for instructions.
2020-09-13T01:41:45.549Z [err] make: *** [bindings.target.mk:112: Release/obj.target/bindings/src/serialport.o] Error 4
2020-09-13T01:41:45.549Z [out] make: Leaving directory '/home/pi/.node-red/node_modules/@serialport/bindings/build'
2020-09-13T01:41:45.555Z [err] gyp ERR! build error
2020-09-13T01:41:45.567Z [err] gyp
2020-09-13T01:41:45.567Z [err] ERR! stack Error: `make` failed with exit code: 2
2020-09-13T01:41:45.567Z [err] gyp
2020-09-13T01:41:45.568Z [err] ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
2020-09-13T01:41:45.568Z [err] gyp ERR!
2020-09-13T01:41:45.568Z [err] stack at ChildProcess.emit (events.js:315:20)
2020-09-13T01:41:45.568Z [err] gyp
2020-09-13T01:41:45.568Z [err] ERR! stack
2020-09-13T01:41:45.568Z [err] at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
2020-09-13T01:41:45.572Z [err] gyp ERR! System Linux 5.4.51-v7+
2020-09-13T01:41:45.572Z [err] gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2020-09-13T01:41:45.572Z [err] gyp ERR! cwd /home/pi/.node-red/node_modules/@serialport/bindings
2020-09-13T01:41:45.572Z [err] gyp ERR! node -v v12.18.3
2020-09-13T01:41:45.572Z [err] gyp ERR! node-gyp -v v5.1.0
2020-09-13T01:41:45.572Z [err] gyp ERR! not ok
2020-09-13T01:41:46.308Z [err] npm
2020-09-13T01:41:46.308Z [err] WARN node-red-project@0.0.1 No repository field.
2020-09-13T01:41:46.320Z [err] npm
2020-09-13T01:41:46.320Z [err] WARN node-red-project@0.0.1 No license field.
2020-09-13T01:41:46.321Z [err]
2020-09-13T01:41:46.341Z [err] npm
2020-09-13T01:41:46.341Z [err] ERR! code ELIFECYCLE
2020-09-13T01:41:46.342Z [err] npm ERR!
2020-09-13T01:41:46.342Z [err] errno 1
2020-09-13T01:41:46.349Z [err] npm
2020-09-13T01:41:46.349Z [err] ERR! @serialport/bindings@8.0.8 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
2020-09-13T01:41:46.349Z [err] npm ERR! Exit status 1
2020-09-13T01:41:46.350Z [err] npm ERR!
2020-09-13T01:41:46.350Z [err]
2020-09-13T01:41:46.350Z [err] npm ERR!
2020-09-13T01:41:46.350Z [err] Failed at the @serialport/bindings@8.0.8 install script.
2020-09-13T01:41:46.350Z [err] npm ERR!
2020-09-13T01:41:46.350Z [err] This is probably not a problem with npm. There is likely additional logging output above.
2020-09-13T01:41:46.377Z [err]
2020-09-13T01:41:46.378Z [err] npm ERR! A complete log of this run can be found in:
2020-09-13T01:41:46.378Z [err] npm ERR! /home/pi/.npm/_logs/2020-09-13T01_41_46_359Z-debug.log
2020-09-13T01:41:46.396Z rc=1
The software that installs nodes (npm) tries to make sure everything you have previously asked for whenever you do anything, that is why you keep getting the error about the serial port.
What OS and hardware are you running on and how did you install node red?
Did you follow the recommendations in the node red Getting Started guide?
pi@PiHole-PiVPN-NUT-3B:~ $ uname -a
Linux PiHole-PiVPN-NUT-3B 5.4.51-v7+ #1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l GNU/Linux
RPi Model 3B+ with SD card of F2FS filesystem
Yes I followed the RPi startup guide including the bash script. It has been running for a while, probably like 6 months, just now migrating over from Hubitat Elevation's RM to NR. But a couple days ago when I went to go an update some nodes, specifically I do not remember sorry, but I think one of them dealt with the serial ports, it seemed to break everything including my install of PiVPN using Wireguard to the point that wireguard will not even install anymore, not sure if that issue is related, but figured I would try and make the picture as clear as possible.
If you want me to run any diagnostic commands on the pi I have time right now.
What error is that giving? The fact that GCC is getting a segmentation error suggests there is something serious wrong with your system. You may have to start again with s new SD card. Always use good quality cards from a reputable source.
It is a Sandisk Ultra, so I doubt it is a SD card issue. Is there any way to view a log of the recent node updates to see what the last successful install was?
Even a good quality card can become corrupted, particularly if the power is pulled without doing a clean shutdown, or there is a problem with the power supply.
Everything is up to date. The only thing I remember is I went to update a set of nodes, I am pretty sure it said something about Serial Ports, and that update failed, and all subsequent installs/uninstalls failed. So I tried a reboot, then the VPN failed to start.
These unconnected issues & the fact its a PI running on an SD does smack of corruption.
That original error in building serial port is almost always due to needing build essentials - so potentially you have random corruption (affecting the build tools and other stuff).
Is there any way to fix that short of a factory reset? A way to reinstall the current linux version maybe? Because I have a lot of stuff on here, PiHole with a DHCP server configs, NUT configured, NR with security enabled. And while I could do it all over again, I rather avoid that.
First things first, make sure you have a good backup of volatile stuff (especially the flows + creds files in the .node-red folder
I cant argue with that.
You might be able to recover this with cloning to another SD (ignoring errors of course) and try to repair (re-install build tools etc) - but to be honest, a new SD with a fresh OS install is the best way to go.
Depending on how important this installation is, you might want to invest in an SSD (or at least have a ready duplicate/clone of the SD once you are up and running).
Do you know if this is supported? Given that I put a SATA m.2 not a NVME m.2? I realize it may be overkill for what I think are USB 2.0? ports on the 3B+, but I have one lying around unused so I figured I would ask
Yeah I guess I just need to figure out the series of events so that I don't forget anything. BTW, would docker help any of this? I have heard that it is good at compartmentalizing programs, would it be worth to explore that route?
This is the output from Wireguard failing to install btw:
Setting up wireguard-dkms (1.0.20200712-1) ...
Removing old wireguard-1.0.20200712 DKMS files...
------------------------------
Deleting module version: 1.0.20200712
completely from the DKMS tree.
------------------------------
Done.
Loading new wireguard-1.0.20200712 DKMS files...
It is likely that 5.4.51-v7+ belongs to a chroot's host
Building for 5.4.51+, 5.4.51-v7+, 5.4.51-v7l+, 5.4.51-v8+ and 5.6.0-0.bpo.2-rt-armmp
Building initial module for 5.4.51+
Error! Bad return status for module build on kernel: 5.4.51+ (armv7l)
Consult /var/lib/dkms/wireguard/1.0.20200712/build/make.log for more information.
dpkg: error processing package wireguard-dkms (--configure):
installed wireguard-dkms package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:
wireguard-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)
Log file mentioned
DKMS make.log for wireguard-1.0.20200712 for kernel 5.4.51+ (armv7l)
Sun 13 Sep 2020 12:46:02 AM PDT
make: Entering directory '/usr/src/linux-headers-5.4.51+'
AR /var/lib/dkms/wireguard/1.0.20200712/build/built-in.a
CC [M] /var/lib/dkms/wireguard/1.0.20200712/build/main.o
CC [M] /var/lib/dkms/wireguard/1.0.20200712/build/noise.o
gcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-8/README.Bugs> for instructions.
CC [M] /var/lib/dkms/wireguard/1.0.20200712/build/device.o
make[1]: *** [scripts/Makefile.build:265: /var/lib/dkms/wireguard/1.0.20200712/build/main.o] Error 4
make[1]: *** Waiting for unfinished jobs....
gcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-8/README.Bugs> for instructions.
CC [M] /var/lib/dkms/wireguard/1.0.20200712/build/peer.o
make[1]: *** [scripts/Makefile.build:266: /var/lib/dkms/wireguard/1.0.20200712/build/noise.o] Error 4
gcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-8/README.Bugs> for instructions.
make[1]: *** [scripts/Makefile.build:266: /var/lib/dkms/wireguard/1.0.20200712/build/device.o] Error 4
gcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-8/README.Bugs> for instructions.
make[1]: *** [scripts/Makefile.build:266: /var/lib/dkms/wireguard/1.0.20200712/build/peer.o] Error 4
make: *** [Makefile:1709: /var/lib/dkms/wireguard/1.0.20200712/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.4.51+'
Notice that is the same error, the compiler (gcc) is crashing, so something in the os is corrupt. You could try uninstalling gcc (uninstalling build-essential might do that) and re-installing it and see if that fixes it. Even then you won't know what else might be corrupted. Personally I would bin the SD card and start again.
I keep image backups of the SD cards for my systems, making a new image each time I make any major changes to the system. I use git for version control of node red so I don't need to do a new image each time the flows change, just if things in the system change. I use clonezilla for making the images but there are other tools.
I am in the process of moving to an alternative system where I use Ansible to do all the system setup, so to make a new card for a system (and my PCs in fact) I just need to install the OS and basic setup then run the ansible script for that system and it installs and configures everything, pulls the node-red flows from my git repository, and it is ready to go.
Yeah I think I am going to transition to a SSD in an enclosure. Now I am researching if F2FS is worth it or if that was a cause of my issues, and also if I should install the 64-bit version of the Raspberry Pi OS. Any thoughts?
Yeah I do the same, the more annoying thing for me is the initial setup including all of the security stuff. And also the Pi-Hole setup and the NUT setup.