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

docker中启动项目失败,提示"Plugin development is disabled by env unmatched, require env([ 'local' ]) but got env is prod" #5305

Closed
qinfeng0214 opened this issue Apr 15, 2024 · 2 comments

Comments

@qinfeng0214
Copy link

在此输入你需要反馈的 Bug 具体信息(Bug in Detail):

这是一些输出信息
[root@native-cloud4 ~]# kk logs galaxy-www-ksyun-8665794674-28d4q -n console
Defaulted container "core" out of: core, static-resource, copy-resource (init)

www-ksyun@1.0.0 start /data/web/www-ksyun/www-ksyun
cross-env ENV=prod egg-scripts --port=7003 start --title=egg-www-ksyun --ignore-stderr

[egg-scripts] Starting egg application at /data/web/www-ksyun/www-ksyun
[egg-scripts] Run node --no-deprecation --trace-warnings /data/web/www-ksyun/www-ksyun/node_modules/egg-scripts/lib/start-cluster {"port":7003,"title":"egg-www-ksyun","baseDir":"/data/web/www-ksyun/www-ksyun","framework":"/data/web/www-ksyun/www-ksyun/node_modules/egg"} --title=egg-www-ksyun
2024-04-15 11:20:30,837 INFO 50 [master] =================== egg start =====================
2024-04-15 11:20:30,838 INFO 50 [master] node version v14.15.4
2024-04-15 11:20:30,838 INFO 50 [master] egg version 2.37.0
2024-04-15 11:20:30,838 INFO 50 [master] start with options:
{
"framework": "/data/web/www-ksyun/www-ksyun/node_modules/egg",
"baseDir": "/data/web/www-ksyun/www-ksyun",
"port": 7003,
"workers": 64,
"plugins": null,
"https": false,
"title": "egg-www-ksyun"
}
2024-04-15 11:20:30,838 INFO 50 [master] start with env: isProduction: true, EGG_SERVER_ENV: undefined, NODE_ENV: production
2024-04-15 11:20:30,843 INFO 50 [master] agent_worker#1:57 start with clusterPort:39457
2024-04-15 11:20:31,103 INFO 57 Plugin development is disabled by env unmatched, require env([ 'local' ]) but got env is prod
2024-04-15 11:20:31,130 INFO 57 [egg:core] App root: /data/web/www-ksyun/www-ksyun
2024-04-15 11:20:31,130 INFO 57 [egg:core] All *.log files save on "/data/logs/www-ksyun"
2024-04-15 11:20:31,130 INFO 57 [egg:core] Loaded enabled plugin [{"enable":true,"package":"egg-session","name":"session","dependencies":[],"optionalDependencies":[],"env":[],"from":"/data/web/www-ksyun/www-ksyun/node_modules/egg/config/plugin.js","path":"/data/web/www-ksyun/www-ksyun/node_modules/egg-session","version":"3.3.0"},{"enable":true,"package":"egg-security","name":"security","dependencies":[],"optionalDependencies":["session"],"env":[],"from":"/data/web/www-ksyun/www-ksyun/node_modules/egg/config/plugin.js","path":"/data/web/www-ksyun/www-ksyun/node_modules/egg-security","version":"2.11.0","dependents":["nunjucks"]},{"enable":true,"package":"egg-jsonp","name":"jsonp","dependencies":[],"optionalDependencies":["security"],"env":[],"from":"/data/web/www-ksyun/www-ksyun/node_modules/egg/config/plugin.js","path":"/data/web/www-ksyun/www-ksyun/node_modules/egg-jsonp","version":"2.0.0"},{"enable":true,"package":"egg-onerror","name":"onerror","dependencies":[],"optionalDependencies":["jsonp"],"env":[],"from":"/data/web/www-ksyun/www-ksyun/node_modules/egg/config/plugin.js","path":"/data/web/www-ksyun/www-ksyun/node_modules/egg-onerror","version":"2.2.0"},{"enable":true,"package":"egg-i18n","name":"i18n","dependencies":[],"optionalDependencies":[],"env":[],"from":"/data/web/www-ksyun/www-ksyun/node_modules/egg/config/plugin.js","path":"/data/web/www-ksyun/www-ksyun/node_modules/egg-i18n","version":"2.1.1"},{"enable":true,"package":"egg-watcher","name":"watcher","dependencies":[],"optionalDependencies":[],"env":[],"from":"/data/web/www-ksyun/www-ksyun/node_modules/egg/config/plugin.js","path":"/data/web/www-ksyun/www-ksyun/node_modules/egg-watcher","version":"3.1.1"},{"enable":true,"package":"egg-schedule","name":"schedule","dependencies":[],"optionalDependencies":[],"env":[],"from":"/data/web/www-ksyun/www-ksyun/node_modules/egg/config/plugin.js","path":"/data/web/www-ksyun/www-ksyun/node_modules/egg-schedule","version":"3.7.0","dependents":["logrotator"]},{"enable":true,"package":"egg-multipart","name":"multipart","dependencies":[],"optionalDependencies":["schedule"],"env":[],"from":"/data/web/www-ksyun/www-ksyun/node_modules/egg/config/plugin.js","path":"/data/web/www-ksyun/www-ksyun/node_modules/egg-multipart","version":"2.13.1"},{"enable":true,"package":"egg-logrotator","name":"logrotator","dependencies":["schedule"],"optionalDependencies":[],"env":[],"from":"/data/web/www-ksyun/www-ksyun/node_modules/egg/config/plugin.js","path":"/data/web/www-ksyun/www-ksyun/node_modules/egg-logrotator","version":"3.1.0"},{"enable":true,"package":"egg-static","name":"static","dependencies":[],"optionalDependencies":[],"env":[],"from":"/data/web/www-ksyun/www-ksyun/node_modules/egg/config/plugin.js","path":"/data/web/www-ksyun/www-ksyun/node_modules/egg-static","version":"2.3.1"},{"enable":true,"package":"egg-view","name":"view","dependencies":[],"optionalDependencies":[],"env":[],"from":"/data/web/www-ksyun/www-ksyun/node_modules/egg/config/plugin.js","path":"/data/web/www-ksyun/www-ksyun/node_modules/egg-view","version":"2.1.4","dependents":["nunjucks"]},{"enable":true,"package":"egg-view-nunjucks","name":"nunjucks","dependencies":["security","view"],"optionalDependencies":[],"env":[],"from":"/data/web/www-ksyun/www-ksyun/config/plugin.js","path":"/data/web/www-ksyun/www-ksyun/node_modules/egg-view-nunjucks","version":"2.3.0"},{"enable":true,"package":"egg-cors","name":"cors","dependencies":[],"optionalDependencies":[],"env":[],"from":"/data/web/www-ksyun/www-ksyun/config/plugin.js","path":"/data/web/www-ksyun/www-ksyun/node_modules/egg-cors","version":"2.2.3"},{"enable":true,"package":"egg-http-proxy","name":"httpProxy","dependencies":[],"optionalDependencies":[],"env":[],"from":"/data/web/www-ksyun/www-ksyun/config/plugin.js","path":"/data/web/www-ksyun/www-ksyun/node_modules/egg-http-proxy","version":"1.0.1"}]
2024-04-15 11:20:31,186 INFO 57 [egg:logger] init all loggers with options: {"dir":"/data/logs/www-ksyun","encoding":"utf8","env":"prod","level":"INFO","consoleLevel":"INFO","disableConsoleAfterReady":true,"outputJSON":false,"buffer":true,"appLogName":"www-ksyun-web.log","coreLogName":"egg-web.log","agentLogName":"egg-agent.log","errorLogName":"common-error.log","coreLogger":{},"allowDebugAtProd":false,"enablePerformanceTimer":false,"type":"agent"}
2024-04-15 11:20:31,192 INFO 57 [egg:core] dump config after load, 3ms
2024-04-15 11:20:31,232 INFO 57 [egg-watcher:agent] watcher start success
2024-04-15 11:20:31,232 INFO 57 [egg:core:ready_stat] end ready task /data/web/www-ksyun/www-ksyun/node_modules/egg-schedule/agent.js:12:9, remain ["/data/web/www-ksyun/www-ksyun/node_modules/egg-watcher/lib/init.js:15:14"]
2024-04-15 11:20:31,233 WARN 57 [egg-watcher] defaultEventSource watcher will NOT take effect
2024-04-15 11:20:31,233 INFO 57 [egg:core:ready_stat] end ready task /data/web/www-ksyun/www-ksyun/node_modules/egg-watcher/lib/init.js:15:14, remain []
2024-04-15 11:20:31,234 INFO 50 [master] agent_worker#1:57 started (394ms)
2024-04-15 11:20:31,234 INFO 50 [master] start appWorker with args ["{"framework":"/data/web/www-ksyun/www-ksyun/node_modules/egg","baseDir":"/data/web/www-ksyun/www-ksyun","port":7003,"workers":64,"plugins":null,"https":false,"title":"egg-www-ksyun","clusterPort":39457}"]
2024-04-15 11:20:40,620 INFO 69 Plugin development is disabled by env unmatched, require env([ 'local' ]) but got env is prod

可复现问题的仓库地址(Reproduction Repo)

这是package.json的配置
"start": "cross-env ENV=prod egg-scripts --port=7003 start --title=egg-www-ksyun --ignore-stderr"

Node 版本号:

v14.15.4

Eggjs 版本号:

2.37.0

相关插件名称与版本号(PlugIn and Name):

"dependencies": {         "axios": "^1.6.5",         "cross-env": "^6.0.3",         "cssmin": "^0.4.3",         "dayjs": "^1.11.5",         "egg": "^2.15.1",         "egg-cors": "^2.2.3",         "egg-http-proxy": "^1.0.1",         "egg-scripts": "^2.11.0",         "egg-security": "^2.7.1",         "egg-view-assets": "^1.3.0",         "egg-view-nunjucks": "^2.2.0",         "lru-cache": "^5.1.1",         "marked": "^0.7.0",         "sass": "^1.75.0",         "skywalking-backend-js": "^0.7.0"     },     "devDependencies": {         "@babel/core": "^7.7.7",         "@babel/preset-env": "^7.7.7",         "autod": "^3.0.1",         "autod-egg": "^1.1.0",         "babel-core": "^6.26.3",         "copyfiles": "^2.2.0",         "cssmin": "^0.4.3",         "egg-bin": "^4.11.0",         "egg-ci": "^1.11.0",         "egg-mock": "^3.21.0",         "eslint": "^5.13.0",         "eslint-config-egg": "^7.1.0",         "fs-extra": "^10.0.0",         "htmlmin": "^0.0.7",         "ks3": "^0.5.0",         "uglify-js": "^3.8.0",         "write": "^2.0.0"     }

操作平台与版本号(Platform and Version):

docker

@sinkhaha
Copy link
Contributor

日志贴不完整吧,没看到启动失败原因,“Plugin development is disabled by env unmatched, require env([ 'local' ]) but got env is prod”这个看起来只是说development这个插件在正式环境下禁用而已,不影响启动

@qinfeng0214
Copy link
Author

日志贴不完整吧,没看到启动失败原因,“Plugin development is disabled by env unmatched, require env([ 'local' ]) but got env is prod”这个看起来只是说development这个插件在正式环境下禁用而已,不影响启动

是的,实际上是因为OOM的原因

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

2 participants