== HELP == status errored
fails to start
If you run it manually via = node server.js = everything works.
How could we reproduce this issue?
server.js
const express = require('express')
const traccar = require('./controllers/traccar');
const app = express() const port = process.env.PORT || 8081;
require('dotenv').config();
const helmet = require('helmet') app.use(helmet())
// Traccar app app.post('/', traccar);
app.listen(port, () => console.log(Traccar Application to Thingsboard gateway running on port ${port}!))
Supporting information
# Run the following commands
$ pm2 report
● pm2-kto.service - PM2 process manager Loaded: loaded (/etc/systemd/system/pm2-kto.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2024-04-20 10:01:19 CEST; 5min ago Docs: https://pm2.keymetrics.io/ Process: 772 ExecStart=/usr/local/lib/node_modules/pm2/bin/pm2 resurrect (code=exited, status=0/SUCCESS) Main PID: 946 (PM2 v5.3.1: God) Tasks: 11 (limit: 2219) Memory: 71.2M CPU: 12.286s CGroup: /system.slice/pm2-kto.service └─946 "PM2 v5.3.1: God Daemon (/home/kto/.pm2)" "" "" "" "" "" "" "" "" "" "" ""
Apr 20 10:01:19 gps-traccar pm2[772]: [PM2] PM2 Successfully daemonized Apr 20 10:01:19 gps-traccar pm2[772]: [PM2] Resurrecting Apr 20 10:01:19 gps-traccar pm2[772]: [PM2] Restoring processes located in /home/kto/.pm2/dump.pm2 Apr 20 10:01:19 gps-traccar pm2[772]: [PM2] Process /home/kto/tb-traccar-connector/server.js restored Apr 20 10:01:19 gps-traccar pm2[772]: ┌────┬───────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐ Apr 20 10:01:19 gps-traccar pm2[772]: │ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │ Apr 20 10:01:19 gps-traccar pm2[772]: ├────┼───────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤ Apr 20 10:01:19 gps-traccar pm2[772]: │ 0 │ server │ default │ 0.0.1 │ fork │ 962 │ 0s │ 0 │ online │ 0% │ 34.6mb │ kto │ disabled │ Apr 20 10:01:19 gps-traccar pm2[772]: └────┴───────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘ Apr 20 10:01:19 gps-traccar systemd[1]: Started PM2 process manager. =========:~$ pm2 report
--- PM2 report ----------------------------------------------------------------
Date : Sat Apr 20 2024 10:07:10 GMT+0200 (Central European Summer Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version : 5.3.1
node version : 12.22.9
node path : not found
argv : /usr/bin/node,/usr/local/lib/node_modules/pm2/lib/Daemon.js
argv0 : node
user : kto
uid : 1000
gid : 1000
uptime : 5min
===============================================================================
--- CLI ----------------------------------------------------
local pm2 : 5.3.1
node version : 12.22.9
node path : /usr/local/bin/pm2
argv : /usr/bin/node,/usr/local/bin/pm2,report
argv0 : node
user : kto
uid : 1000
gid : 1000
===============================================================================
--- System info --------------------------------------------
arch : x64
platform : linux
type : Linux
cpus : Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
cpus nb : 4
freemem : 1647108096
totalmem : 2058579968
home : /home/kto
===============================================================================
--- PM2 list -----------------------------------------------
┌────┬───────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├────┼───────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0 │ server │ default │ 0.0.1 │ fork │ 0 │ 0 │ 15 │ errored │ 0% │ 0b │ kto │ disabled │
└────┴───────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
/home/kto/.pm2/pm2.log last 20 lines:
PM2 | 2024-04-20T10:01:24: PM2 log: App [server:0] exited with code [1] via signal [SIGINT]
PM2 | 2024-04-20T10:01:24: PM2 log: App [server:0] starting in -fork mode-
PM2 | 2024-04-20T10:01:24: PM2 log: App [server:0] online
PM2 | 2024-04-20T10:01:25: PM2 log: App [server:0] exited with code [1] via signal [SIGINT]
PM2 | 2024-04-20T10:01:25: PM2 log: App [server:0] starting in -fork mode-
PM2 | 2024-04-20T10:01:25: PM2 log: App [server:0] online
PM2 | 2024-04-20T10:01:25: PM2 log: App [server:0] exited with code [1] via signal [SIGINT]
PM2 | 2024-04-20T10:01:25: PM2 log: App [server:0] starting in -fork mode-
PM2 | 2024-04-20T10:01:25: PM2 log: App [server:0] online
PM2 | 2024-04-20T10:01:26: PM2 log: App [server:0] exited with code [1] via signal [SIGINT]
PM2 | 2024-04-20T10:01:26: PM2 log: App [server:0] starting in -fork mode-
PM2 | 2024-04-20T10:01:26: PM2 log: App [server:0] online
PM2 | 2024-04-20T10:01:27: PM2 log: App [server:0] exited with code [1] via signal [SIGINT]
PM2 | 2024-04-20T10:01:27: PM2 log: App [server:0] starting in -fork mode-
PM2 | 2024-04-20T10:01:27: PM2 log: App [server:0] online
PM2 | 2024-04-20T10:01:27: PM2 log: App [server:0] exited with code [1] via signal [SIGINT]
PM2 | 2024-04-20T10:01:27: PM2 log: App [server:0] starting in -fork mode-
PM2 | 2024-04-20T10:01:27: PM2 log: App [server:0] online
PM2 | 2024-04-20T10:01:28: PM2 log: App [server:0] exited with code [1] via signal [SIGINT]
PM2 | 2024-04-20T10:01:28: PM2 log: Script /home/kto/tb-traccar-connector/server.js had too many unstable restarts (16). Stopped. "errored"
@pro100805 you should paste the output of pm2 info server here. And it will help to figure out the script and args you specified to run the app.
Greetings, please tell me how best to do it.