Crashing in Docker
Hi,
Kutt keeps crashing for me every now and then. I'm not sure what the causes is. I just did a pull to make sure I'm on the latest version of the image.
The Docker logs show:
> Ready on http://localhost:3000
npm error path /kutt
npm error command failed
npm error signal SIGTERM
npm error command sh -c node server/server.js --production
npm error A complete log of this run can be found in: /root/.npm/_logs/2025-03-02T21_18_25_758Z-debug-0.log
This is what I'm getting in my logs when I docker exec into the container:
/kutt # cat /root/.npm/_logs/2025-03-02T21_18_25_758Z-debug-0.log
0 verbose cli /usr/local/bin/node /usr/local/bin/npm
1 info using [email protected]
2 info using [email protected]
3 silly config load:file:/usr/local/lib/node_modules/npm/npmrc
4 silly config load:file:/kutt/.npmrc
5 silly config load:file:/root/.npmrc
6 silly config load:file:/usr/local/etc/npmrc
7 verbose title npm start
8 verbose argv "start"
9 verbose logfile logs-max:10 dir:/root/.npm/_logs/2025-03-02T21_18_25_758Z-
10 verbose logfile /root/.npm/_logs/2025-03-02T21_18_25_758Z-debug-0.log
11 silly logfile done cleaning log files
12 verbose stack Error: command failed
12 verbose stack at promiseSpawn (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:22:22)
12 verbose stack at spawnWithShell (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:124:10)
12 verbose stack at promiseSpawn (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:12:12)
12 verbose stack at runScriptPkg (/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js:77:13)
12 verbose stack at runScript (/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js:9:12)
12 verbose stack at #run (/usr/local/lib/node_modules/npm/lib/commands/run-script.js:131:13)
12 verbose stack at async RunScript.exec (/usr/local/lib/node_modules/npm/lib/commands/run-script.js:40:7)
12 verbose stack at async Npm.exec (/usr/local/lib/node_modules/npm/lib/npm.js:207:9)
12 verbose stack at async module.exports (/usr/local/lib/node_modules/npm/lib/cli/entry.js:74:5)
13 verbose pkgid [email protected]
14 error path /kutt
15 error command failed
16 error signal SIGTERM
17 error command sh -c node server/server.js --production
18 verbose cwd /kutt
19 verbose os Linux 5.15.0-133-generic
20 verbose node v22.13.1
21 verbose npm v10.9.2
22 verbose exit 1
23 verbose code 1
24 error A complete log of this run can be found in: /root/.npm/_logs/2025-03-02T21_18_25_758Z-debug-0.log
I can then start it again with docker compose up -d and it will run, I can log into the site and use things. Then at some point it just crashes again and I have to restart it again.
Any ideas?
Thanks for your time,
EDIT:
Here is my docker-compose file:
services:
server:
image: kutt/kutt:latest
volumes:
- /mnt/data-docker/docker.redacted.org/kutt/data:/var/lib/kutt
- /mnt/data-docker/docker.redacted.org/kutt/custom:/kutt/custom
environment:
DB_FILENAME: "/var/lib/kutt/data.sqlite"
JWT_SECRET: "REDACTED"
# openssl rand -base64 172 | tr -d '\ n'
TRUST_PROXY: true
CUSTOM_DOMAIN_USE_HTTPS: true
DEFAULT_DOMAIN: "k.redacted.org"
ports:
- 3000:3000
It's hard to fond a clue from these logs. Could you send the npm logs that are mentioned in the your Docker logs?
This is the NPM log...
As per what
cat /root/.npm/_logs/2025-03-02T21_18_25_758Z-debug-0.log
produces.
This needs to be closed.