Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm start 没问题,pm2启动项目 日志每天产生大量的重复报错! #1509

Open
overlbjn opened this issue Aug 31, 2020 · 5 comments

Comments

@overlbjn
Copy link

overlbjn commented Aug 31, 2020

npm start 正常运行,pm2 启动项目也正常运行,但是 /root/.pm2/logs/xxxxx-error.log 里面的项目错误日志每天会有几百M,都是重复的报错,如下:
Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed at process.target.send (internal/child_process.js:636:16) at IPCTransport.send (/usr/lib/node_modules/pm2/node_modules/@pm2/io/build/main/transports/IPCTransport.js:79:21) at NotifyFeature.onUncaughtException (/usr/lib/node_modules/pm2/node_modules/@pm2/io/build/main/features/notify.js:120:62) at process.emit (events.js:203:15) at process._fatalException (internal/bootstrap/node.js:497:27) Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed at process.target.send (internal/child_process.js:636:16) at Object.send (/root/liveapp-server/node_modules/[email protected]@log4js/lib/clustering.js:86:15) at Logger._log (/root/liveapp-server/node_modules/[email protected]@log4js/lib/logger.js:87:16) at Logger.log (/root/liveapp-server/node_modules/[email protected]@log4js/lib/logger.js:70:12) at Logger.(anonymous function) [as error] (/root/liveapp-server/node_modules/[email protected]@log4js/lib/logger.js:119:10) at DateFileLogger.error (/root/liveapp-server/node_modules/[email protected]@think-logger3/src/adapter/base.js:28:26) at process.on.err (/root/liveapp-server/node_modules/[email protected]@think-cluster/lib/worker.js:109:20) at process.emit (events.js:203:15) at process._fatalException (internal/bootstrap/node.js:497:27) Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed at process.target.send (internal/child_process.js:636:16)

node 版本 V10.19.0

请问可能是什么原因?

@overlbjn overlbjn changed the title npm start 没问题,pm2启动项目 日志每天 npm start 没问题,pm2启动项目 日志每天产生大量的重复报错! Aug 31, 2020
@lizheming
Copy link
Contributor

pm2.json 的配置贴一下吧

@luojiyin1987
Copy link

OptimalBits/bull#1281 @lizheming 是否有启发?

@lizheming
Copy link
Contributor

升级下 Node 版本试试?@luojiyin1987

@luojiyin1987
Copy link

看报错信息是node 进程间IPC通信出问题了, 应该是master进程跟work进程之间出问题。不知道代码上如何处理和pm2的配置。如果对方会用 perf 进行动态跟踪,应该能定位到错误发生的地方。 @overlbjn
我还没遇到这样的问题 @lizheming

@lizheming
Copy link
Contributor

@luojiyin1987 ThinkJS 内部没有处理 PM2 的通信,从报错日志来看比较像是内部使用的 log4js 在 cluster 下打印日志输出与 PM2 进行通信发生了问题。如果是使用 console 输出日志的话可以试试改成 file 输出 @overlbjn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants