如题: PM2出现重复重启问题. 单个Node启动时,程序无问题. 但是使用pm2启动时,出现重启问题. 欢迎各位踊跃发言,或者提供思路也好.感谢各位.
PM2版本:v2.4.6
node版本:v6.10.3
NPM版本:3.10.10
PS:尝试升级过PM2版本,问题继续出现.
进程配置如下:
{
“name”: “",
“script”: "”,
“instances”: “1”,
“exec_mode”: “cluster”,
“args”: [""],
“node_args”: “–harmony --max-old-space-size=4096”,
“merge_logs”: true,
“cwd”: “./”,
“max_memory_restart”: “4096M”,
“log_date_format”: “YYYYMMDDHH”,
“error_file”: “./log/err.log”,
“out_file”: “./log/out.log”,
“env”: {
“NODE_ENV”: “development”,
“AWESOME_SERVICE_API_TOKEN”: “xxx”
},
// “watch”: [".//.js"],
“ignore_watch”: [],
“watch_options”: { “followSymlinks”: false }
}
使用Node独立进程启动此进程时,程序表现正常,并未出现致命中断情况.使用Windows环境
程序重启后: 此时程序的错误日志为空,只有正常输出日志.但为莫名中断. 并在进程目录下会创建npm-debug.log文件.
PM2日志如下:
[31]: arguments adaptor frame: 1->2 { // actual arguments [00] : 0x3f6d00f04ff1 <String[4]: next> }
[32]: new Promise [native promise.js:53] [pc=0x37fab2c4dd79] (this=0x3f6d00f04429 <the hole>,v=0x75a6e3711e9 <JS Function (SharedFunctionInfo 0x1f89e41db7a1)>#18#) { // stack-allocated locals var .new.target = 0x3f6d00fc3041 <JS Function Promise (SharedFunctionInfo 0x3f6d00f74f51)>#39# var q = 0x75a6e371231 <a Promise with map 0x1f8464162ea1>#66# var w = 0x75a6e3713d9 <an Object with map 0x1f846419f3e1>#67# // expression stack (top to bottom) [08] : 0x3f6d00f04ff1 <String[4]: next> [07] : 0x3f6d00f04381 <undefined> [06] : 0x75a6e3711e9 <JS Function (SharedFunctionInfo 0x1f89e41db7a1)>#18# [05] : 0x3f6d00fc2e11 <FixedArray[38]>#42# [04] : 0x3f6d00fc2e11 <FixedArray[38]>#42# [03] : 0x3f6d00fc3041 <JS Function Promise (SharedFunctionInfo 0x3f6d00f74f51)>#39# --------- s o u r c e c o d e --------- function Promise(v){\x0aif(v===j){\x0areturn %_NewObject(u,new.target);\x0a}\x0aif((new.target===(void 0)))throw e(65,this);\x0aif(!(typeof(v)===‘function’))\x0athrow e(137,v);\x0avar q=PromiseInit(%_NewObject(u,new.target));\x0avar w=CreateResolvingFunctions(q);\x0atry{\x0a%DebugPushPromise(q,Promise);\x0av(w.resolve,w.reject);\x0a}catch(e){\x0a%_Call(…
}
[34]: /* anonymous /(aka / anonymous */) [/home/zhanghang/testNode/Import/bin/pdyimport_bulk.js:196] [pc=0x37fab2f991ef] (this=0x3f6d00f04201 <null>) { // stack-allocated locals var arguments = 0x75a6e370bd1 <an Arguments with map 0x1abadc80ace9>#68# // heap-allocated locals var gen = 0x75a6e370d71 <an Object with map 0x2302f440c5a9>#17# // expression stack (top to bottom) [02] : 0x75a6e3711e9 <JS Function (SharedFunctionInfo 0x1f89e41db7a1)>#18# [01] : 0x3f6d00fc3041 <JS Function Promise (SharedFunctionInfo 0x3f6d00f74f51)>#39# --------- s o u r c e c o d e --------- function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = genkey; var value = info.value; } catch (error) { r 2018-03-29 14:58:14: App name:UPT.Server-PDYimporter id:0 disconnected 2018-03-29 14:58:14: App [UPT.Server-PDYimporter] with id [0] and pid [14238], exited with code [0] via signal [SIGILL] 2018-03-29 14:58:14: Starting execution sequence in -cluster mode- for app name:UPT.Server-PDYimporter id:0 2018-03-29 14:58:14: App name:UPT.Server-PDYimporter id:0 online Stacktrace (bbbbbbbb-bbbbbbbb) 0x109368c0f1e9 (nil):
PM2日志如下:由于日志很大,所以只粘贴一部分,貌似无法插入附件. 如以上日志不够,我会及时补充.
Up… 求助啊各位… 能指引下方向也好啊…
给个日志地址吧
你在process层捕获unhandle error 和老婆unrejecterror