gcloud app deploy触发了奇怪的错误:文件的SHA1和冲突

Nea*_*mau 7 google-app-engine google-cloud-platform gcloud

我想要一个简单的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"
    }
  ]
]
Run Code Online (Sandbox Code Playgroud)

我试过了什么

  • 删除存储桶中的所有文件.
  • 在staging.xxxxxxx.appspot.com上删除整个存储桶.
  • https://cloud.google.com/sdk/卸载并重新安装SDK .我在Windows 10 64bit上.
  • 重新运行gcloud init并完成这些说明.
  • gcloud auth application-default login使用我的Google帐户重新运行和验证.

这是我的示例文件

的app.yaml

runtime: nodejs10

handlers:
- url: /
  static_files: index.html
  upload: index.html
Run Code Online (Sandbox Code Playgroud)

的index.html

<html>
  <head>
    <title>Test Title</title>
  </head>
  <body>
    <p>
      Hello from the static index.html file.
    </p>
  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

Paw*_*ara 0

问题摘要:Windows 本地计算机文件系统和 Google 云存储中的文本文件大小不同 - SHA 校验和比较失败。

可能的解决方案:

  1. 在使用Dos2Unix使用 Cigwin部署应用程序之前在本地修复文件,

或从 Linux 部署:

  1. 将部署文件上传到Cloud Shell并从那里进行部署。
  2. 将部署文件上传到Linux VM 实例

有关Windows 和 Unix 互操作性的摘要,请查看文档