2 years ago
I get this error in my logs, even though my app seems to work fine?
npm ERR! path /app
npm ERR! command failed
npm ERR! signal SIGTERM
npm ERR! command sh -c node app.js
npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-08-23T03_29_15_206Z-debug-0.log
Is there a way to look at a more detailed log?
3 Replies
2 years ago
Ok I think I'm understanding where this is coming from. I'm guessing this is just the old build being closed?
2 years ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open brody • over 1 year ago
7 months ago
What's the correct way to handle this? We have the following in our index.js for our Node server:
const cleanExit = async (exitCode = 0) => {
await Sentry.flush(2000);
process.exit(exitCode);
}
process.on('uncaughtException', (error) => {
console.serverError('Uncaught Exception:', error);
cleanExit(1);
})
process.on('unhandledRejection', (reason, promise) => {
console.serverError('Unhandled Rejection:', reason, promise);
cleanExit(1);
})
process.on('SIGTERM', () => {
console.log('SIGTERM received, shutting down gracefully');
cleanExit(0);
})
process.on('SIGINT', () => {
console.log('SIGINT received, shutting down gracefully');
cleanExit(0);
})However - it doesn't seem to be triggered. The logs don't appear and we still see the SIGTERM error in the logs (npm ERR! signal SIGTERM). Could it be that the SIGTERM isn't being passed to Node correctly from npm, or Railway's Docker container, etc?