2

我一直在为 App Engine 上的博客托管临时设置,并且有几十个版本运行良好。我的 main.go 文件非常简单,但尝试部署会在 cmdline 处出现“内部错误”:

You may also view the gcloud log file, found at
[/Users/id/.config/gcloud/logs/2016.11.28/10.18.23.292328.log].
File upload done.
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [13] An internal error occurred.

日志文件的最后一块对于错误的原因没有帮助:

2016-11-28 10:18:50,133 DEBUG    root            Operation [apps/blog-149523/operations/2a31964d-4f0c-4c1c-9fd7-844d36be257f] complete. Result: {
    "metadata": {
        "target": "apps/blog-149523/services/default/versions/20161128t101823",
        "method": "google.appengine.v1beta5.Versions.CreateVersion",
        "user": "ian.douglas@iandouglas.com",
        "insertTime": "2016-11-28T17:18:34.140Z",
        "endTime": "2016-11-28T17:18:47.381Z",
        "@type": "type.googleapis.com/google.appengine.v1beta5.OperationMetadataV1Beta5"
    },
    "done": true,
    "name": "apps/blog-149523/operations/2a31964d-4f0c-4c1c-9fd7-844d36be257f",
    "error": {
        "message": "An internal error occurred.",
        "code": 13
    }
}
2016-11-28 10:18:50,134 DEBUG    root            (gcloud.app.deploy) Error Response: [13] An internal error occurred.
Traceback (most recent call last):
  File "/Users/id/src/public/google-cloud-sdk/lib/googlecloudsdk/calliope/cli.py", line 740, in Execute
    resources = args.calliope_command.Run(cli=self, args=args)
  File "/Users/id/src/public/google-cloud-sdk/lib/googlecloudsdk/calliope/backend.py", line 1648, in Run
    resources = command_instance.Run(args)
  File "/Users/id/src/public/google-cloud-sdk/lib/surface/app/deploy.py", line 53, in Run
    return deploy_util.RunDeploy(args, app_create=True)
  File "/Users/id/src/public/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 410, in RunDeploy
    all_services)
  File "/Users/id/src/public/google-cloud-sdk/lib/googlecloudsdk/command_lib/app/deploy_util.py", line 257, in Deploy
    endpoints_info)
  File "/Users/id/src/public/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/appengine_api_client.py", line 119, in DeployService
    return operations.WaitForOperation(self.client.apps_operations, operation)
  File "/Users/id/src/public/google-cloud-sdk/lib/googlecloudsdk/api_lib/app/api/operations.py", line 70, in WaitForOperation
    encoding.MessageToPyValue(completed_operation.error)))
OperationError: Error Response: [13] An internal error occurred.
2016-11-28 10:18:50,135 ERROR    root            (gcloud.app.deploy) Error Response: [13] An internal error occurred.
2016-11-28 10:18:50,501 DEBUG    root            Metrics reporting process started...

搜索“内部错误 13”让我得到了很多答案,即使在 SO 上,也说这是一个“暂时”错误,应该会自行消失,但我已经处理了一个多星期。

我已经尽可能简化了我的 main.go,但无济于事:

package main

import (
  "net/http"
  "fmt"
)

func init() {
  http.HandleFunc("/_ah/health", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "OK") })
  http.Handle("/", http.FileServer(http.Dir("public")))
}

但是部署过程并没有抱怨我的 Go 代码不好,它只是每次都抛出这个模糊的内部错误 13,而且我找不到任何关于它是否真的是服务器端的信息或我做过的事情。

谢谢你的帮助!

4

1 回答 1

0

我的路径中一定有一个名称不佳的 .md 文件。将此添加到我的 app.yaml 解决了问题:

skip_files:
  - ^(.*/)?.*\.md$

如果 gcloud 系统能告诉我更清楚一点就好了!

于 2016-11-28T17:46:19.427 回答