在 Google App Engine 上部署 Angular-Fullstack (MEAN)
Deploying Angular-Fullstack (MEAN) on Google App Engine
我用 Yeoman Angular-Fullstack 生成器 (https://github.com/angular-fullstack/generator-angular-fullstack) 生成了一个项目。
我创建了一个 app.yaml 并尝试使用以下命令在 GAE 上部署项目:
gcloud app deploy
但是我收到一个错误:
ERROR: (gcloud.app.deploy) Error Response: [13] Timed out when starting VMs. It's possible that the application code is unhealthy. (0/2 ready, 2 still deploying).
关于如何调试 gcloud 部署的任何提示?我是 运行 最新的 gcloud SDK。
--
这是更长的调试跟踪:
Updating service [default]...-DEBUG: Operation [apps/<MY-PROJECT>/operations/63e50c89-da5f-4697-aeea-447865a82cc4] not complete. Waiting 5s.
Updating service [default]...|DEBUG: Operation [apps/<MY-PROJECT>/operations/63e50c89-da5f-4697-aeea-447865a82cc4] complete. Result: {
"metadata": {
"target": "apps/<MY-PROJECT>/services/default/versions/20160804t151734",
"method": "google.appengine.v1beta5.Versions.CreateVersion",
"user": "<MY-EMAIL>@gmail.com",
"insertTime": "2016-08-04T12:16:31.905Z",
"endTime": "2016-08-04T12:24:03.526Z",
"@type": "type.googleapis.com/google.appengine.v1beta5.OperationMetadataV1Beta5"
},
"done": true,
"name": "apps/<MY-PROJECT>/operations/63e50c89-da5f-4697-aeea-447865a82cc4",
"error": {
"message": "Timed out when starting VMs. It's possible that the application code is unhealthy. (0/2 ready, 2 still deploying).",
"code": 13
}
}
Updating service [default]...failed.
DEBUG: (gcloud.app.deploy) Error Response: [13] Timed out when starting VMs. It's possible that the application code is unhealthy. (0/2 ready, 2 still deploying).
Traceback (most recent call last):
File "/Users/jp/softaa/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 719, in Execute
result = args.calliope_command.Run(cli=self, args=args)
File "/Users/jp/softaa/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 1404, in Run
resources = command_instance.Run(args)
File "/Users/jp/softaa/google-cloud-sdk/lib/surface/app/deploy.py", line 57, in Run
return deploy_util.RunDeploy(self, args)
File "/Users/jp/softaa/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 215, in RunDeploy
api_client.DeployService(name, version, service, manifest, image)
File "/Users/jp/softaa/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/appengine_api_client.py", line 89, in DeployService
return operations.WaitForOperation(self.client.apps_operations, operation)
File "/Users/jp/softaa/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/api/operations.py", line 70, in WaitForOperation
encoding.MessageToPyValue(completed_operation.error)))
OperationError: Error Response: [13] Timed out when starting VMs. It's possible that the application code is unhealthy. (0/2 ready, 2 still deploying).
ERROR: (gcloud.app.deploy) Error Response: [13] Timed out when starting VMs. It's possible that the application code is unhealthy. (0/2 ready, 2 still deploying).
如果您的问题只是关于查找此错误的原因,我建议您使用本地主机上的开发服务器来查找错误。
没有深入研究,我猜 Node 部分不满足 GAE 的要求,或者您正在尝试部署到不支持 Node 应用程序的区域。
GAE 未随 Mongo 提供。你有两个选择
- 使用 GAE flex 并构建您自己的 mongo 容器并使用它
- 使用像 https://mlab.com 这样的 Mongo 云提供商,他们甚至有免费版本可供测试。
我用 Yeoman Angular-Fullstack 生成器 (https://github.com/angular-fullstack/generator-angular-fullstack) 生成了一个项目。
我创建了一个 app.yaml 并尝试使用以下命令在 GAE 上部署项目:
gcloud app deploy
但是我收到一个错误:
ERROR: (gcloud.app.deploy) Error Response: [13] Timed out when starting VMs. It's possible that the application code is unhealthy. (0/2 ready, 2 still deploying).
关于如何调试 gcloud 部署的任何提示?我是 运行 最新的 gcloud SDK。
--
这是更长的调试跟踪:
Updating service [default]...-DEBUG: Operation [apps/<MY-PROJECT>/operations/63e50c89-da5f-4697-aeea-447865a82cc4] not complete. Waiting 5s.
Updating service [default]...|DEBUG: Operation [apps/<MY-PROJECT>/operations/63e50c89-da5f-4697-aeea-447865a82cc4] complete. Result: {
"metadata": {
"target": "apps/<MY-PROJECT>/services/default/versions/20160804t151734",
"method": "google.appengine.v1beta5.Versions.CreateVersion",
"user": "<MY-EMAIL>@gmail.com",
"insertTime": "2016-08-04T12:16:31.905Z",
"endTime": "2016-08-04T12:24:03.526Z",
"@type": "type.googleapis.com/google.appengine.v1beta5.OperationMetadataV1Beta5"
},
"done": true,
"name": "apps/<MY-PROJECT>/operations/63e50c89-da5f-4697-aeea-447865a82cc4",
"error": {
"message": "Timed out when starting VMs. It's possible that the application code is unhealthy. (0/2 ready, 2 still deploying).",
"code": 13
}
}
Updating service [default]...failed.
DEBUG: (gcloud.app.deploy) Error Response: [13] Timed out when starting VMs. It's possible that the application code is unhealthy. (0/2 ready, 2 still deploying).
Traceback (most recent call last):
File "/Users/jp/softaa/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 719, in Execute
result = args.calliope_command.Run(cli=self, args=args)
File "/Users/jp/softaa/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 1404, in Run
resources = command_instance.Run(args)
File "/Users/jp/softaa/google-cloud-sdk/lib/surface/app/deploy.py", line 57, in Run
return deploy_util.RunDeploy(self, args)
File "/Users/jp/softaa/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 215, in RunDeploy
api_client.DeployService(name, version, service, manifest, image)
File "/Users/jp/softaa/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/appengine_api_client.py", line 89, in DeployService
return operations.WaitForOperation(self.client.apps_operations, operation)
File "/Users/jp/softaa/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/api/operations.py", line 70, in WaitForOperation
encoding.MessageToPyValue(completed_operation.error)))
OperationError: Error Response: [13] Timed out when starting VMs. It's possible that the application code is unhealthy. (0/2 ready, 2 still deploying).
ERROR: (gcloud.app.deploy) Error Response: [13] Timed out when starting VMs. It's possible that the application code is unhealthy. (0/2 ready, 2 still deploying).
如果您的问题只是关于查找此错误的原因,我建议您使用本地主机上的开发服务器来查找错误。 没有深入研究,我猜 Node 部分不满足 GAE 的要求,或者您正在尝试部署到不支持 Node 应用程序的区域。
GAE 未随 Mongo 提供。你有两个选择
- 使用 GAE flex 并构建您自己的 mongo 容器并使用它
- 使用像 https://mlab.com 这样的 Mongo 云提供商,他们甚至有免费版本可供测试。