remy / nodemon

Monitor for any changes in your node.js application and automatically restart the server - perfect for development
http://nodemon.io/
MIT License
26.22k stars 1.72k forks source link

Code that ran yesterday is crashing today with output "Killed" #2017

Closed rstoermer closed 2 years ago

rstoermer commented 2 years ago

Expected behaviour

Nodemon starts process

Actual behaviour

Code that worked yesterday with nodemon isn't working anymore and just reporting "Killed" in terminal. The container is not crashing instantly, but after 10 - 15 seconds. However the first line in my entry file is never reached, so I assume an error in nodemon. The same code is running without nodemon when doing "node ./dist/app.js" after building the js files.

I am starting via skaffold with a Helm deployment in a Kubernetes cluster...

nodemon.json

{
    "verbose": true,
    "ignore": ["*.json", "node_modules", "/src/types"],
    "signal": "SIGTERM",
    "execMap": {
        "ts": "node --require ts-node/register"
    }
}

Waiting for deployments to stabilize...

Steps to reproduce


If applicable, please append the --dump flag on your command and include the output here ensuring to remove any sensitive/personal details or tokens.

rstoermer commented 2 years ago

Alright, found the error. The memory limit we were setting in Kubernetes was too low. It would be better if nodemon would be a bit more expressive than just saying: "Killed"

remy commented 2 years ago

The killed message came from your code, not from nodemon. You can see this from your logged output:

[data-broker] [nodemon] spawning
[data-broker] [nodemon] child pid: 31
[data-broker] [nodemon] watching 115 files
[data-broker] Killed
[data-broker] [nodemon] app crashed - waiting for file changes before starting...

Everything from nodemon is prefixed with [nodemon].