无法将 NodeJS + AngularJS 应用程序推送到 PAS - Pivotal Cloud Foundry (PCF)
Failing to push a NodeJS + AngularJS app to PAS - Pivotal Cloud Foundry (PCF)
我正在尝试推送 nodejs/angularjs 应用程序,但出现以下错误。
> Instance never healthy after 1m0s: Failed to make TCP connection to
> port 8080: connection refused; process did not exit
我试过以下但惨败(抱歉,我是新手):
- 使用 -t 将运行状况检查的超时时间增加到 600 或更多,但它仍然失败。
- 升级资源(RAM 等),但这也没有帮助。
- 等了一整夜,问题神奇地消失了...
cf logs apptheone --recent
的输出:
> 2019-10-24T14:46:29.56+0530 [CELL/0] OUT Downloading droplet...
> 2019-10-24T14:46:30.64+0530 [CELL/0] OUT Downloaded droplet
> 2019-10-24T14:46:30.87+0530 [CELL/0] OUT Starting health monitoring of
> container 2019-10-24T14:46:31.93+0530 [APP/PROC/WEB/0] OUT >
> apptheone@1.0.0 start /home/vcap/app 2019-10-24T14:46:31.93+0530
> [APP/PROC/WEB/0] OUT > node build.js && http-server -a localhost -p
> 8000 -c-1 ./app 2019-10-24T14:46:32.15+0530 [APP/PROC/WEB/0] OUT
> Starting up http-server, serving ./app 2019-10-24T14:46:32.15+0530
> [APP/PROC/WEB/0] OUT Available on: 2019-10-24T14:46:32.15+0530
> [APP/PROC/WEB/0] OUT http://localhost:8000
> 2019-10-24T14:46:32.15+0530 [APP/PROC/WEB/0] OUT Hit CTRL-C to stop
> the server 2019-10-24T14:47:31.64+0530 [HEALTH/0] ERR Failed to
> make TCP connection to port 8080: connection refused
> 2019-10-24T14:47:31.64+0530 [CELL/0] ERR Timed out after 1m0s: health
> check never passed. 2019-10-24T14:47:31.64+0530 [CELL/SSHD/0] OUT
> Exit status 0 2019-10-24T14:47:47.73+0530 [CELL/0] OUT Cell
> 91bc6c2e-8684-46ac-9047-a62e099b0941 stopping instance
> 37f79676-3d09-4e44-4f79-fab8 2019-10-24T14:47:47.73+0530 [CELL/0]
> OUT Cell 91bc6c2e-8684-46ac-9047-a62e099b0941 destroying container for
> instance 37f79676-3d09-4e44-4f79-fab8 2019-10-24T14:47:47.74+0530
> [API/1] OUT Process has crashed with type: "web"
> 2019-10-24T14:47:47.76+0530 [API/1] OUT App instance exited with guid
> cb94664f-0016-48b3-8467-15d128e4521b payload:
> {"instance"=>"37f79676-3d09-4e44-4f79-fab8", "index"=>0,
> "cell_id"=>"91bc6c2e-8684-46ac-9047-a62e099b0941",
> "reason"=>"CRASHED", "exit_description"=>"Instance never healthy after
> 1m0s: Failed to make TCP connection to port 8080: connection refused;
> process did not exit", "crash_count"=>6,
> "crash_timestamp"=>1571908667728853273,
> "version"=>"25df8154-3283-4807-b0eb-d0f7351ec85d"}
> 2019-10-24T14:47:47.90+0530 [PROXY/0] OUT Exit status 137
> 2019-10-24T14:47:48.64+0530 [CELL/0] OUT Cell
> 91bc6c2e-8684-46ac-9047-a62e099b0941 successfully destroyed container
> for instance 37f79676-3d09-4e44-4f79-fab8
cf events apptheone
的输出:
> 2019-10-24T14:21:47.00+0530 app.crash bobthefixerB
> index: 0, reason: CRASHED, cell_id:
> 91bc6c2e-8684-46ac-9047-a62e099b0941, instance:
> 64e466c1-8b7e-41d5-5a80-7408, exit_description: Instance never healthy
> after 1m0s: Failed to make TCP connection to port 8080: connection
> refused; process did not exit 2019-10-24T14:21:47.00+0530
> audit.app.process.crash web index: 0, reason:
> CRASHED, cell_id: 91bc6c2e-8684-46ac-9047-a62e099b0941, instance:
> 64e466c1-8b7e-41d5-5a80-7408, exit_description: Instance never healthy
> after 1m0s: Failed to make TCP connection to port 8080: connection
> refused; process did not exit 2019-10-24T14:06:29.00+0530
> audit.app.process.crash web index: 0, reason:
> CRASHED, cell_id: d5d90154-3642-4ff0-8ed7-00ea8c96bb5d, instance:
> 899dc217-0cfa-418a-7920-3814, exit_description: Instance never healthy
> after 1m0s: Failed to make TCP connection to port 8080: connection
> refused; process did not exit
这是我们的 package.json 的样子:
{
"name": "apptheone",
"private": true,
"version": "1.0.0",
"description": "bla bla blaa",
"license": "MIT",
"devDependencies": {
"chai": "^4.1.2",
"check-dependencies": "^1.1.0",
"eslint": "^4.19.1",
"eslint-config-google": "^0.9.1",
"http-server": "^0.10.0",
"loadash": "^1.0.0",
"mocha": "^5.0.5",
"protractor-jasmine2-html-reporter": "0.0.7"
},
"scripts": {
"update-deps": "npm update",
"start": "node build.js && http-server -a localhost -p 8000 -c-1 ./app",
"protractor": " cd ./tests && protractor protractor.conf.js",
"test": "node node_modules/mocha/bin/mocha node-red/test/**/*.js"
},
"dependencies": {
"auditjs": "^2.4.3",
"bower": "^1.8.4",
"dependency-check": "^3.1.0",
"jslint": "^0.11.0",
"json-formatter-js": "^2.2.0",
"npm": "^5.8.0",
"requirejs": "^2.3.5",
"shelljs": "^0.8.3"
}
}
注意: 当我第一次尝试推送应用程序时,我能够通过一个简单的 cf push apptheone
成功地做到这一点并且静态网页是实时的出色地。但后来我在玩 PCF UI 并删除了应用程序及其关联的 services/routes,从那以后我就无法推送同一个应用程序。应用程序代码完全没有变化。
请仔细检查您的应用程序正在侦听 0.0.0.0
而不是 localhost
。仅在 localhost
上侦听时,这可能会导致运行状况检查失败,因为您的应用在 运行.
所在的容器之外不可用
希望对您有所帮助!
我正在尝试推送 nodejs/angularjs 应用程序,但出现以下错误。
> Instance never healthy after 1m0s: Failed to make TCP connection to
> port 8080: connection refused; process did not exit
我试过以下但惨败(抱歉,我是新手):
- 使用 -t 将运行状况检查的超时时间增加到 600 或更多,但它仍然失败。
- 升级资源(RAM 等),但这也没有帮助。
- 等了一整夜,问题神奇地消失了...
cf logs apptheone --recent
的输出:
> 2019-10-24T14:46:29.56+0530 [CELL/0] OUT Downloading droplet...
> 2019-10-24T14:46:30.64+0530 [CELL/0] OUT Downloaded droplet
> 2019-10-24T14:46:30.87+0530 [CELL/0] OUT Starting health monitoring of
> container 2019-10-24T14:46:31.93+0530 [APP/PROC/WEB/0] OUT >
> apptheone@1.0.0 start /home/vcap/app 2019-10-24T14:46:31.93+0530
> [APP/PROC/WEB/0] OUT > node build.js && http-server -a localhost -p
> 8000 -c-1 ./app 2019-10-24T14:46:32.15+0530 [APP/PROC/WEB/0] OUT
> Starting up http-server, serving ./app 2019-10-24T14:46:32.15+0530
> [APP/PROC/WEB/0] OUT Available on: 2019-10-24T14:46:32.15+0530
> [APP/PROC/WEB/0] OUT http://localhost:8000
> 2019-10-24T14:46:32.15+0530 [APP/PROC/WEB/0] OUT Hit CTRL-C to stop
> the server 2019-10-24T14:47:31.64+0530 [HEALTH/0] ERR Failed to
> make TCP connection to port 8080: connection refused
> 2019-10-24T14:47:31.64+0530 [CELL/0] ERR Timed out after 1m0s: health
> check never passed. 2019-10-24T14:47:31.64+0530 [CELL/SSHD/0] OUT
> Exit status 0 2019-10-24T14:47:47.73+0530 [CELL/0] OUT Cell
> 91bc6c2e-8684-46ac-9047-a62e099b0941 stopping instance
> 37f79676-3d09-4e44-4f79-fab8 2019-10-24T14:47:47.73+0530 [CELL/0]
> OUT Cell 91bc6c2e-8684-46ac-9047-a62e099b0941 destroying container for
> instance 37f79676-3d09-4e44-4f79-fab8 2019-10-24T14:47:47.74+0530
> [API/1] OUT Process has crashed with type: "web"
> 2019-10-24T14:47:47.76+0530 [API/1] OUT App instance exited with guid
> cb94664f-0016-48b3-8467-15d128e4521b payload:
> {"instance"=>"37f79676-3d09-4e44-4f79-fab8", "index"=>0,
> "cell_id"=>"91bc6c2e-8684-46ac-9047-a62e099b0941",
> "reason"=>"CRASHED", "exit_description"=>"Instance never healthy after
> 1m0s: Failed to make TCP connection to port 8080: connection refused;
> process did not exit", "crash_count"=>6,
> "crash_timestamp"=>1571908667728853273,
> "version"=>"25df8154-3283-4807-b0eb-d0f7351ec85d"}
> 2019-10-24T14:47:47.90+0530 [PROXY/0] OUT Exit status 137
> 2019-10-24T14:47:48.64+0530 [CELL/0] OUT Cell
> 91bc6c2e-8684-46ac-9047-a62e099b0941 successfully destroyed container
> for instance 37f79676-3d09-4e44-4f79-fab8
cf events apptheone
的输出:
> 2019-10-24T14:21:47.00+0530 app.crash bobthefixerB
> index: 0, reason: CRASHED, cell_id:
> 91bc6c2e-8684-46ac-9047-a62e099b0941, instance:
> 64e466c1-8b7e-41d5-5a80-7408, exit_description: Instance never healthy
> after 1m0s: Failed to make TCP connection to port 8080: connection
> refused; process did not exit 2019-10-24T14:21:47.00+0530
> audit.app.process.crash web index: 0, reason:
> CRASHED, cell_id: 91bc6c2e-8684-46ac-9047-a62e099b0941, instance:
> 64e466c1-8b7e-41d5-5a80-7408, exit_description: Instance never healthy
> after 1m0s: Failed to make TCP connection to port 8080: connection
> refused; process did not exit 2019-10-24T14:06:29.00+0530
> audit.app.process.crash web index: 0, reason:
> CRASHED, cell_id: d5d90154-3642-4ff0-8ed7-00ea8c96bb5d, instance:
> 899dc217-0cfa-418a-7920-3814, exit_description: Instance never healthy
> after 1m0s: Failed to make TCP connection to port 8080: connection
> refused; process did not exit
这是我们的 package.json 的样子:
{
"name": "apptheone",
"private": true,
"version": "1.0.0",
"description": "bla bla blaa",
"license": "MIT",
"devDependencies": {
"chai": "^4.1.2",
"check-dependencies": "^1.1.0",
"eslint": "^4.19.1",
"eslint-config-google": "^0.9.1",
"http-server": "^0.10.0",
"loadash": "^1.0.0",
"mocha": "^5.0.5",
"protractor-jasmine2-html-reporter": "0.0.7"
},
"scripts": {
"update-deps": "npm update",
"start": "node build.js && http-server -a localhost -p 8000 -c-1 ./app",
"protractor": " cd ./tests && protractor protractor.conf.js",
"test": "node node_modules/mocha/bin/mocha node-red/test/**/*.js"
},
"dependencies": {
"auditjs": "^2.4.3",
"bower": "^1.8.4",
"dependency-check": "^3.1.0",
"jslint": "^0.11.0",
"json-formatter-js": "^2.2.0",
"npm": "^5.8.0",
"requirejs": "^2.3.5",
"shelljs": "^0.8.3"
}
}
注意: 当我第一次尝试推送应用程序时,我能够通过一个简单的 cf push apptheone
成功地做到这一点并且静态网页是实时的出色地。但后来我在玩 PCF UI 并删除了应用程序及其关联的 services/routes,从那以后我就无法推送同一个应用程序。应用程序代码完全没有变化。
请仔细检查您的应用程序正在侦听 0.0.0.0
而不是 localhost
。仅在 localhost
上侦听时,这可能会导致运行状况检查失败,因为您的应用在 运行.
希望对您有所帮助!