部署失败,504

时间:2017-01-03 10:17:52

标签: deployment cloudfoundry swisscomdev

我尝试从控制台将应用程序部署到Swisscom App Cloud。它报告进展到最后,报告没有进一步解释的504:

Updating app helloclass-fe-develop in org UCID-Bern Team / space HELLOCLASS-TEST as christian.cueni@iterativ.ch...
OK

Uploading helloclass-fe-develop...
FAILED
Error processing app files: Error uploading application.
Server error, status code: 504, error code: 0, message: 

应用程序日志报告应用已更新:

2017-01-03 09:37:39 [RTR/0] OUT helloclass-develop.scapp.io - [03/01/2017:08:37:39.584 +0000] "GET / HTTP/1.1" 200 0 594 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36 Google Favicon" 66.249.93.201:50868 10.0.18.35:64341 x_forwarded_for:"83.76.152.96" x_forwarded_proto:"https" vcap_request_id:8a8adcc7-9e97-4bd9-4492-68e92883ee3d response_time:0.001739219 app_id:310166b4-f3a6-4168-a9ac-530e45dbfb10 app_index:0
2017-01-03 09:37:39 [APP/PROC/WEB/0] OUT 83.76.152.96, 66.249.93.201, 66.249.93.201 - - - [03/Jan/2017:08:37:39 +0000] "GET / HTTP/1.1" 200 606
2017-01-03 10:05:50 [API/2] OUT Updated app with guid 310166b4-f3a6-4168-a9ac-530e45dbfb10 ({"name"=>"helloclass-fe-develop"})
2017-01-03 10:57:15 [API/1] OUT Updated app with guid 310166b4-f3a6-4168-a9ac-530e45dbfb10 ({"state"=>"STOPPED"})
2017-01-03 10:57:15 [CELL/0] OUT Exit status 0
2017-01-03 10:57:15 [APP/PROC/WEB/0] OUT Exit status 0
2017-01-03 10:57:15 [CELL/0] OUT Destroying container
2017-01-03 10:57:15 [CELL/0] OUT Successfully destroyed container
2017-01-03 10:57:16 [API/1] OUT Updated app with guid 310166b4-f3a6-4168-a9ac-530e45dbfb10 ({"state"=>"STARTED"})
2017-01-03 10:57:16 [CELL/0] OUT Creating container
2017-01-03 10:57:16 [CELL/0] OUT Successfully created container
2017-01-03 10:57:17 [CELL/0] OUT Starting health monitoring of container
2017-01-03 10:57:19 [CELL/0] OUT Container became healthy

尽管有这些消息表明该应用已更新,但我仍然看到正在投放的应用的旧版本。

修改

使用-v参数运行命令后,我发现失败的原因是网关超时:

RESPONSE: [2017-01-03T13:32:39+01:00]
HTTP/1.1 504 Gateway Timeout
Connection: close
Content-Length: 176
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: text/html
Date: Tue, 03 Jan 2017 12:32:39 GMT
Expires: 0
Pragma: no-cache
Strict-Transport-Security: max-age=15768000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Vcap-Request-Id: 3ac831ef-e70b-4f4e-7c56-e308806f039e
X-Xss-Protection: 1; mode=block

<html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>

FAILED
Error processing app files: Error uploading application.
Server error, status code: 504, error code: 0, message: 

这是一个特定的云计算还是与Swisscom AppCloud相关的东西?是否存在cloudfoundry固有的超时限制?

1 个答案:

答案 0 :(得分:2)

您可以使用cf push运行-v或启用CF_TRACE以查看CLI与CF端点的更多交互。
该错误消息类似于https://github.com/cloudfoundry/cli/issues/1042:云控制器无法及时完成请求,并且将API请求路由到云控制器的路由器不再等待,并将504(网关超时)返回到CLI。

跟踪应该告诉您哪个API调用超时。
CLI中止了该操作,而云控制器可能最终成功完成了操作。

我原以为CLI在这里执行的操作是:

  1. 发送您应用中的文件列表及其校验和以进行资源匹配(因此可以跳过上传CC缓存的未经修改的应用位数)
  2. 上传应用文件
  3. (重新)启动应用(包括升级)
  4. 民意调查&amp;等到应用程序实例返回它正在运行
  5. 从CLI输出我假设第一次操作超时,因此不清楚应用程序的重启方式。