【发布时间】:2019-05-31 14:58:41
【问题描述】:
我正在尝试获得一个简单的 HelloWorld! AppEngine 的部署设置。我正在与另一位朋友/开发人员一起工作,他在他的机器上能够让这个简单的gcloud app deploy 成功工作,但在我的机器上它不起作用(经典 在我的机器上工作)。我想知道这是否是我们的存储桶的权限问题,但我和我朋友的 AppEngine 帐户之间的一切都是镜像的。我很机智,因此感谢您提供任何帮助。
我将要描述的内容似乎在互联网上很少见,所以我希望有知识的人可以提供帮助。
- 我已安装并验证了 GoogleCloudSDK。
- 我有一个名为“default”的简单目录,其中包含 app.yaml 和 index.html
运行gcloud app deploy default 命令时,我收到以下错误:
Beginning deployment of service [default]...
╔═════════════════════════════════════════════╗
╠═ Uploading 2 files to Google Cloud Storage ═╣
╚═════════════════════════════════════════════╝
File upload done.
Updating service [default]...failed.
ERROR: (gcloud.app.deploy) Error Response: [3] The following errors occurred while copying files to App Engine:
File https://storage.googleapis.com/staging.xxxxxxx.appspot.com/59add2715212c2a5fa68f05ead6ea6a307d279b5 failed with: Conflicting SHA1 sum for file. Expected "90d147b8_dd2137ab_8ec7f19f_c0891006_6585d3de" but received "59add271_5212c2a5_fa68f05e_ad6ea6a3_07d279b5".
Details: [
[
{
"@type": "type.googleapis.com/google.rpc.ResourceInfo",
"description": "Conflicting SHA1 sum for file. Expected \"90d147b8_dd2137ab_8ec7f19f_c0891006_6585d3de\" but received \"59add271_5212c2a5_fa68f05e_ad6ea6a3_07d279b5\".",
"resourceName": "https://storage.googleapis.com/staging.xxxxxxx.appspot.com/59add2715212c2a5fa68f05ead6ea6a307d279b5",
"resourceType": "file"
}
]
]
我尝试过的
- 删除存储桶中的所有文件。
- 在 staging.xxxxxxx.appspot.com 上删除整个存储桶。
- 从 https://cloud.google.com/sdk/ 卸载并重新安装 SDK。我使用的是 Windows 10 64 位。
- 重新运行
gcloud init并查看这些说明。 - 重新运行
gcloud auth application-default login并使用我的 Google 帐户进行身份验证。
这是我的示例文件
app.yaml
runtime: nodejs10
handlers:
- url: /
static_files: index.html
upload: index.html
index.html
<html>
<head>
<title>Test Title</title>
</head>
<body>
<p>
Hello from the static index.html file.
</p>
</body>
</html>
【问题讨论】:
-
我在运行
gcloud app deploy时也有大约 50% 的时间遇到此问题,我必须运行该命令 1 到 5 次才能成功部署。我感觉这可能是由于互联网连接不稳定,但我不确定 -
您似乎在 Google 的公开问题跟踪器上提交了此问题。您是否收到任何针对您的问题的带外回复?还是刚刚关闭? issuetracker.google.com/issues/122326194
-
您可以自己计算文件的 sha1sum,以进一步确定问题所在。我正在使用 linux 并且有
sha1sum <file>但看来您可以在 WIndows 上使用 FCIV:support.microsoft.com/en-us/help/889768/… -
知道这个问题是否只出现在 Windows 上会很有趣(@sven-hakvoort -- 你也是 Windows 吗?)。可能是 Windows 文件 CR+LR 在某些文件中(以某种方式)转换为 Linux LF,这导致哈希不匹配?
-
@DazWilkin,是的,发生此问题时我也在使用 Windows,因此可能会产生影响
标签: google-app-engine google-cloud-platform gcloud