eggjs / egg

🥚 Born to build better enterprise frameworks and apps with Node.js & Koa
https://eggjs.org
MIT License
18.9k stars 1.82k forks source link

linux 环境无法通过egg-scripts start启动项目,wait start 300超时退出 #3439

Closed ppatch closed 5 years ago

ppatch commented 5 years ago

linux 环境无法通过egg-scripts start启动项目,wait start 300超时退出进程:

1.命令: [root@VM_0_3_centos sun]# npm run start

egg-activity@1.0.0 start /www/sun egg-scripts start --port=7001 --daemon --env=test --title=sun-dev --ignore-stderr

[egg-scripts] Starting egg application at /www/sun [egg-scripts] Run node /www/sun/node_modules/egg-scripts/lib/start-cluster {"port":7001,"title":"sun-dev","baseDir":"/www/sun","framework":"/www/sun/node_modules/egg"} --title=sun-dev [egg-scripts] Save log file to /root/logs [egg-scripts] Wait Start: 1... [egg-scripts] Wait Start: 2... [egg-scripts] Wait Start: 3... [egg-scripts] Wait Start: 4... [egg-scripts] Wait Start: 5... [egg-scripts] Wait Start: 6... [egg-scripts] Wait Start: 7... ... ... ...

[egg-scripts] Wait Start: 296... [egg-scripts] Wait Start: 297... [egg-scripts] Wait Start: 298... [egg-scripts] Wait Start: 299... [egg-scripts] Wait Start: 300... [egg-scripts] Start failed, 300s timeout npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! egg-activity@1.0.0 start: egg-scripts start --port=7001 --daemon --env=test --title=sun-dev --ignore-stderr npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the egg-activity@1.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2019-01-31T06_51_12_246Z-debug.log

-

  1. /root/.npm/_logs/2019-01-31T06_51_12_246Z-debug.log 日志: 0 info it worked if it ends with ok 1 verbose cli [ '/server/node/node-10.15/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'run', 1 verbose cli 'start' ] 2 info using npm@6.0.1 3 info using node@v10.15.0 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle egg-activity@1.0.0~prestart: egg-activity@1.0.0 6 info lifecycle egg-activity@1.0.0~start: egg-activity@1.0.0 7 verbose lifecycle egg-activity@1.0.0~start: unsafe-perm in lifecycle true 8 verbose lifecycle egg-activity@1.0.0~start: PATH: /server/node/node-10.15/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/www/sun/node_modules/.bin:/www/src/jdk1.8.0/bin:/www/src/jdk1.8.0/bin:/usr/local/nginx/sbin:/usr/local/php/bin:/usr/local/mysql/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/server/jdk1.8.0/bin:/server/maven/bin:/mongodb-3.2.5/bin:/root/bin 9 verbose lifecycle egg-activity@1.0.0~start: CWD: /www/sun 10 silly lifecycle egg-activity@1.0.0~start: Args: [ '-c', 10 silly lifecycle 'egg-scripts start --port=7001 --daemon --env=test --title=sun-dev --ignore-stderr' ] 11 silly lifecycle egg-activity@1.0.0~start: Returned: code: 1 signal: null 12 info lifecycle egg-activity@1.0.0~start: Failed to exec start script 13 verbose stack Error: egg-activity@1.0.0 start: egg-scripts start --port=7001 --daemon --env=test --title=sun-dev --ignore-stderr 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (/server/node/node-10.15/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:283:16) 13 verbose stack at EventEmitter.emit (events.js:182:13) 13 verbose stack at ChildProcess. (/server/node/node-10.15/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:182:13) 13 verbose stack at maybeClose (internal/child_process.js:962:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5) 14 verbose pkgid egg-activity@1.0.0 15 verbose cwd /www/sun 16 verbose Linux 3.10.0-693.el7.x86_64 17 verbose argv "/server/node/node-10.15/bin/node" "/usr/local/bin/npm" "run" "start" 18 verbose node v10.15.0 19 verbose npm v6.0.1 20 error code ELIFECYCLE 21 error errno 1 22 error egg-activity@1.0.0 start: egg-scripts start --port=7001 --daemon --env=test --title=sun-dev --ignore-stderr 22 error Exit status 1 23 error Failed at the egg-activity@1.0.0 start script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]

    -

  2. package.json: { "name": "egg-activity", "version": "1.0.0", "description": "test", "private": true, "dependencies": { "ali-oss": "^6.1.0", "cross-env": "5.1.4", "crypto-js": "^3.1.9-1", "egg": "2.2.1", "egg-cors": "2.0.0", "egg-logger": "^2.3.1", "egg-mysql": "3.0.0", "egg-redis": "2.0.0", "egg-router-plus": "1.2.0", "egg-scripts": "2.5.0", "egg-sequelize": "^4.2.0", "egg-session": "^3.1.0", "egg-session-redis": "1.0.0", "egg-static": "2.1.1", "egg-validate": "1.0.0", "egg-view": "2.1.0", "egg-view-ejs": "^2.0.0", "md5": "2.2.1", "mocha": "^5.2.0", "moment": "2.22.1", "mysql2": "^1.6.4", "parameter": "2.2.3", "path-to-regexp": "^2.2.1", "sha1": "^1.1.1", "upyun": "3.3.4" }, "devDependencies": { "autod": "^3.0.1", "autod-egg": "^1.0.0", "egg-bin": "^4.3.5", "egg-ci": "^1.8.0", "egg-mock": "^3.14.0", "egg-watcher-chokidar": "^2.0.0", "eslint": "^4.11.0", "eslint-config-egg": "^6.0.0", "koa-rewrite": "^3.0.1", "sequelize-cli": "^5.4.0", "webstorm-disable-index": "^1.2.0" }, "engines": { "node": ">=8.9.0" }, "scripts": { "start": "egg-scripts start --port=7001 --daemon --env=test --title=sun-dev --ignore-stderr", "start1": "cross-env EGG_SERVER_ENV=test NODE_ENV=test egg-scripts start --port=8001 --daemon --title=egg-activity", "stop": "egg-scripts stop", "prod": "cross-env MOCK_HOME_DIR=/apps/logs/hd/ EGG_SERVER_ENV=prod NODE_ENV=prod egg-scripts start --port=8001 --daemon --title=egg-activity", "local": "egg-bin dev", "test-local": "egg-bin test", "debug": "egg-bin debug", "test": "npm run lint -- --fix && npm run test-local", "cov": "egg-bin cov", "lint": "eslint .", "ci": "npm run lint && npm run cov", "autod": "autod" }, "ci": { "version": "8" }, "repository": { "type": "git", "url": "" }, "author": "YOLO", "license": "MIT" }
atian25 commented 5 years ago

某个插件启动超时了,看下 /root/logs 里面的日志

egg-bot commented 5 years ago

Hello @ppatch. Please provide a reproducible example following the instruction.

Issues labeled by Need Reproduce will be closed if no activities in 7 days.


@ppatch,请根据这个说明提供最小可复现代码。

如果在 7 天内没有进展会被自动关闭。