Closed Algunenano closed 3 years ago
@Algunenano could you share more info? Backend/Infra? What is the priority of this issue?
Backend/Infra?
Backend. It's node code.
What is the priority of this issue?
The process kept running, but it's left in an unknown status. In fact, more modern stable releases of node would have killed the process. So it's not high priority but something we should look into sooner rather than later.
As a side note, if https://github.com/CartoDB/Windshaft-cartodb/issues/1065 was already place the process would have shutdown and restarted, and in this case it should be avoided.
This is happening, under some circumstances, while rotating the logging file for analysis: node-windshaft-analysis.log
(once per day, usually at 00:17 AM). The stream to that file has been closed and Bunyan is not able to refresh the file descriptor before writing a new entry log despite we've implemented a callback to refresh it. We had a similar issue while implementing cluster-mode (plus graceful shutdown) for Tilesets API and I had to overwrite the method .close()
in Logger to handle it properly.
We need to spend some time to determine the right place and approach to fix it.
@dgaubert please let @CartoDB/rt-managers now if this is appropriate to tackle at the RT
Back from vacations!
please let @CartoDB/rt-managers now if this is appropriate to tackle at the RT
Sure thing!
It happened again tonight:
[2019-06-04 00:17:26.061] [FATAL] [default] - Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
at doWrite (_stream_writable.js:406:19)
at writeOrBuffer (_stream_writable.js:394:5)
at WriteStream.Writable.write (_stream_writable.js:294:11)
at Logger._emit (/home/ubuntu/www/node-windshaft/releases/20190521103931/node_modules/bunyan/lib/bunyan.js:938:22)
at Logger.info (/home/ubuntu/www/node-windshaft/releases/20190521103931/node_modules/bunyan/lib/bunyan.js:1037:24)
at AnalysisLogger.logLimitsError (/home/ubuntu/www/node-windshaft/releases/20190521103931/node_modules/camshaft/lib/logging/logger.js:41:21)
at LimitsContext.logError (/home/ubuntu/www/node-windshaft/releases/20190521103931/node_modules/camshaft/lib/limits/context.js:18:21)
at Object.limitNumberOfRows (/home/ubuntu/www/node-windshaft/releases/20190521103931/node_modules/camshaft/lib/node/limits.js:10:17)
at BaseNode.Node.checkLimits (/home/ubuntu/www/node-windshaft/releases/20190521103931/node_modules/camshaft/lib/node/node.js:535:12)
at /home/ubuntu/www/node-windshaft/releases/20190521103931/node_modules/camshaft/lib/limits/checker.js:12:17
Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
at doWrite (_stream_writable.js:406:19)
at writeOrBuffer (_stream_writable.js:394:5)
at WriteStream.Writable.write (_stream_writable.js:294:11)
at Logger._emit (/home/ubuntu/www/node-windshaft/releases/20190521103931/node_modules/bunyan/lib/bunyan.js:938:22)
at Logger.info (/home/ubuntu/www/node-windshaft/releases/20190521103931/node_modules/bunyan/lib/bunyan.js:1037:24)
at AnalysisLogger.logLimitsError (/home/ubuntu/www/node-windshaft/releases/20190521103931/node_modules/camshaft/lib/logging/logger.js:41:21)
at LimitsContext.logError (/home/ubuntu/www/node-windshaft/releases/20190521103931/node_modules/camshaft/lib/limits/context.js:18:21)
at Object.limitNumberOfRows (/home/ubuntu/www/node-windshaft/releases/20190521103931/node_modules/camshaft/lib/node/limits.js:10:17)
at BaseNode.Node.checkLimits (/home/ubuntu/www/node-windshaft/releases/20190521103931/node_modules/camshaft/lib/node/node.js:535:12)
at /home/ubuntu/www/node-windshaft/releases/20190521103931/node_modules/camshaft/lib/limits/checker.js:12:17
[2019-06-04 00:17:26.062] [INFO] [default] - Process is going to exit with code: 1
[2019-06-04 00:18:11.063] [INFO] [default] - Process didn't close on time. Force exit
[2019-06-04 00:18:15.816] [INFO] console - {"name":"windshaft-server","db":8,"action":"acquire","elapsed":103,"waiting":0}
Notice it's a fatal error so it's restarting the service.
Hey!
Since we implemented graceful shutdown
, we are not leaving any request w/o response. In any case, we should fix it. This issue fits to be tackled in RT.
cc/ @CartoDB/rt-managers
And again:
[2019-07-28 00:17:36.031] [FATAL] [default] - Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
at doWrite (_stream_writable.js:406:19)
at writeOrBuffer (_stream_writable.js:394:5)
at WriteStream.Writable.write (_stream_writable.js:294:11)
at Logger._emit (/home/ubuntu/www/node-windshaft/releases/20190723161603/node_modules/bunyan/lib/bunyan.js:938:22)
at Logger.info (/home/ubuntu/www/node-windshaft/releases/20190723161603/node_modules/bunyan/lib/bunyan.js:1037:24)
at AnalysisLogger.logLimitsError (/home/ubuntu/www/node-windshaft/releases/20190723161603/node_modules/camshaft/lib/logging/logger.js:41:21)
at LimitsContext.logError (/home/ubuntu/www/node-windshaft/releases/20190723161603/node_modules/camshaft/lib/limits/context.js:18:21)
at Object.limitNumberOfRows (/home/ubuntu/www/node-windshaft/releases/20190723161603/node_modules/camshaft/lib/node/limits.js:10:17)
at BaseNode.Node.checkLimits (/home/ubuntu/www/node-windshaft/releases/20190723161603/node_modules/camshaft/lib/node/node.js:535:12)
at /home/ubuntu/www/node-windshaft/releases/20190723161603/node_modules/camshaft/lib/limits/checker.js:12:17
Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
at doWrite (_stream_writable.js:406:19)
at writeOrBuffer (_stream_writable.js:394:5)
at WriteStream.Writable.write (_stream_writable.js:294:11)
at Logger._emit (/home/ubuntu/www/node-windshaft/releases/20190723161603/node_modules/bunyan/lib/bunyan.js:938:22)
at Logger.info (/home/ubuntu/www/node-windshaft/releases/20190723161603/node_modules/bunyan/lib/bunyan.js:1037:24)
at AnalysisLogger.logLimitsError (/home/ubuntu/www/node-windshaft/releases/20190723161603/node_modules/camshaft/lib/logging/logger.js:41:21)
at LimitsContext.logError (/home/ubuntu/www/node-windshaft/releases/20190723161603/node_modules/camshaft/lib/limits/context.js:18:21)
at Object.limitNumberOfRows (/home/ubuntu/www/node-windshaft/releases/20190723161603/node_modules/camshaft/lib/node/limits.js:10:17)
at BaseNode.Node.checkLimits (/home/ubuntu/www/node-windshaft/releases/20190723161603/node_modules/camshaft/lib/node/node.js:535:12)
at /home/ubuntu/www/node-windshaft/releases/20190723161603/node_modules/camshaft/lib/limits/checker.js:12:17
[2019-07-28 00:17:36.032] [INFO] [default] - Process is going to exit with code: 1
[2019-07-28 00:18:21.033] [INFO] [default] - Process didn't close on time. Force exit
Again:
[2019-08-12 00:17:33.055] [FATAL] [default] - Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
at doWrite (_stream_writable.js:406:19)
at writeOrBuffer (_stream_writable.js:394:5)
at WriteStream.Writable.write (_stream_writable.js:294:11)
at Logger._emit (/home/ubuntu/www/node-windshaft/releases/20190730102543/node_modules/bunyan/lib/bunyan.js:938:22)
at Logger.info (/home/ubuntu/www/node-windshaft/releases/20190730102543/node_modules/bunyan/lib/bunyan.js:1037:24)
at AnalysisLogger.logLimitsError (/home/ubuntu/www/node-windshaft/releases/20190730102543/node_modules/camshaft/lib/logging/logger.js:41:21)
at LimitsContext.logError (/home/ubuntu/www/node-windshaft/releases/20190730102543/node_modules/camshaft/lib/limits/context.js:18:21)
at Object.limitNumberOfRows (/home/ubuntu/www/node-windshaft/releases/20190730102543/node_modules/camshaft/lib/node/limits.js:10:17)
at BaseNode.Node.checkLimits (/home/ubuntu/www/node-windshaft/releases/20190730102543/node_modules/camshaft/lib/node/node.js:535:12)
at /home/ubuntu/www/node-windshaft/releases/20190730102543/node_modules/camshaft/lib/limits/checker.js:12:17
Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed
at doWrite (_stream_writable.js:406:19)
at writeOrBuffer (_stream_writable.js:394:5)
at WriteStream.Writable.write (_stream_writable.js:294:11)
at Logger._emit (/home/ubuntu/www/node-windshaft/releases/20190730102543/node_modules/bunyan/lib/bunyan.js:938:22)
at Logger.info (/home/ubuntu/www/node-windshaft/releases/20190730102543/node_modules/bunyan/lib/bunyan.js:1037:24)
at AnalysisLogger.logLimitsError (/home/ubuntu/www/node-windshaft/releases/20190730102543/node_modules/camshaft/lib/logging/logger.js:41:21)
at LimitsContext.logError (/home/ubuntu/www/node-windshaft/releases/20190730102543/node_modules/camshaft/lib/limits/context.js:18:21)
at Object.limitNumberOfRows (/home/ubuntu/www/node-windshaft/releases/20190730102543/node_modules/camshaft/lib/node/limits.js:10:17)
at BaseNode.Node.checkLimits (/home/ubuntu/www/node-windshaft/releases/20190730102543/node_modules/camshaft/lib/node/node.js:535:12)
at /home/ubuntu/www/node-windshaft/releases/20190730102543/node_modules/camshaft/lib/limits/checker.js:12:17
[2019-08-12 00:17:33.056] [INFO] [default] - Process is going to exit with code: 1
[2019-08-12 00:18:18.057] [INFO] [default] - Process didn't close on time. Force exit
[2019-08-12 00:18:49.980] [INFO] console - {"name":"windshaft-server","db":8,"action":"acquire","elapsed":1017,"waiting":0}
is there any solution for this error ? I am stuck in it and don't know what to do
@shivam8800 are you setting up a log rotator in your installation?. Or are you experiencing the same issue with Bunyan?
This issue is related to the integration among Windshaft-CartoDB
, Bunyan
and the log rotator
. For Bunyan's support, please, open an issue in Bunyan's repository.
Oh got it, Actually, It was from pm2 Sorry for mentioning here :(
I got this error... searched further up in the logs and found this message, which was the cause:
Unhandled rejection Error: ENOSPC: no space left on device, write
@shivam8800 are you setting up a log rotator in your installation?. Or are you experiencing the same issue with Bunyan?
This issue is related to the integration among
Windshaft-CartoDB
,Bunyan
and thelog rotator
. For Bunyan's support, please, open an issue in Bunyan's repository.
确实由 Bunyan 引起的 😂
Closing stale ticket
From api-blue-05 logs:
cc/ @CartoDB/rt-managers (Backend)