I am running a node.js application on a RaspberryPi0-WiFi. The application has two docker containers, one for FTP processing and one for the actually application which is connected to an OLED screen for visual output.
We need to use PM2 because our application collects statistics and those are then being broadcast to the PM2-PLUS service for our engineers to monitor the application with.
My problem, is that if the device is powered-off, then back on again, we suddenly start to receive the following error message.
events.js:170
18.10.19 03:07:34 (+0100) throw er; // Unhandled ‘error’ event
18.10.19 03:07:34 (+0100) ^
18.10.19 03:07:34 (+0100)
18.10.19 03:07:34 (+0100) Error [ERR_IPC_DISCONNECTED]: IPC channel is already disconnected
18.10.19 03:07:34 (+0100) at ChildProcess.target.disconnect (internal/child_process.js:804:26)
18.10.19 03:07:34 (+0100) at Timeout._ [as onTimeout] (/usr/local/lib/node_modules/pm2/node_modules/@pm2/agent/src/InteractorClient.js:233:13)
18.10.19 03:07:34 (+0100) at listOnTimeout (internal/timers.js:535:17)
18.10.19 03:07:34 (+0100) at processTimers (internal/timers.js:479:7)
18.10.19 03:07:34 (+0100) Emitted ‘error’ event at:
18.10.19 03:07:34 (+0100) at ChildProcess.target.disconnect (internal/child_process.js:804:12)
18.10.19 03:07:34 (+0100) at Timeout. [as _onTimeout] (/usr/local/lib/node_modules/pm2/node_modules/@pm2/agent/src/InteractorClient.js:233:13)
18.10.19 03:07:34 (+0100) at listOnTimeout (internal/timers.js:535:17)
18.10.19 03:07:34 (+0100) at processTimers (internal/timers.js:479:7)
Has anyone been successful in running PM2 with Docker.
Only the first time that the application runs after an update does it work. If you power off the device and power it back on again, the error appears. Am I missing something when it restart?
Help appreciated.
I have changed the CMD and I still get the same error.
OLD:
[“pm2-runtime”, “ecosystem.config.js”, “–no-deamon”]NEW:
CMD [“pm2”, “start”, “FoxyBox.js”,“–no-daemon”]
It worked for the first couple of power-cycles but then the ERR_IPC_DISCONNECTED error happened again and the application then keeps going in to a constant re-start cycle. Any ideas?