我正在尝试获取一个简单的HelloWorld!将部署设置部署到AppEngine。我正在与另一个朋友/开发人员一起工作,他/她的计算机上的开发人员能够使这个简单的gcloud app deploy
成功运行,但是在我的计算机上却无法正常工作(经典的在我的计算机上工作 )。我想知道这是否是我们存储桶的权限问题,但是我和我朋友的AppEngine帐户之间的所有内容均已镜像。我乐于助人,因此可以提供任何帮助。
我将描述要遵循的内容似乎在互联网上很少见,因此我希望有知识的人可以提供帮助。
运行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"
}
]
]
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>
答案 0 :(得分:0)
问题摘要: Windows本地计算机文件系统上和Google Cloud Storage中的文本文件大小不同-SHA校验和比较失败。
可能的解决方案:
- 在使用Dos2Unix通过Cigwin部署应用之前,先在本地修复文件
或从Linux部署:
- 将部署文件上传到Cloud Shell并从那里进行部署。
- 将部署文件上传到Linux VM Instance。
有关Windows and Unix interoperability的摘要,请查看文档
答案 1 :(得分:0)
使用旧方法进行部署-appcfg.py: https://cloud.google.com/appengine/docs/standard/python/tools/appcfg-arguments
为我工作。
或者您可以看到以下答案: https://stackoverflow.com/a/52894113/8244338