Google Cloud Builder触发器显示“No such blob”错误

问题描述 投票:5回答:1

我正在设置Google Cloud Build触发器。我选择GitHub,对GitHub进行身份验证,选择我想用作触发器的存储库,然后选择“Cloud Build配置文件(yaml或json)”并将“Cloud Build配置文件位置”设置为默认值cloudbuild.yaml

但是,当我通过选择“运行触发器”触发运行时,Google Cloud Builder会向我提供错误

Failed to trigger build: cloud.mygcpproject/github_example_myproject:cloudbuild.yaml: No such blob refs/heads/master:cloudbuild.yaml

但文件cloudbuild.yaml确实存在于该存储库中。我尝试过多次删除和重新创建触发器,总是有相同的结果。

这是顶级内容:

total 72
drwxr-xr-x 8 rlandster rlandster 4096 Apr  9 20:11 .
drwxr-xr-x 7 rlandster rlandster 4096 Apr  3 19:29 ..
drwxr-xr-x 2 rlandster rlandster 4096 Mar 10 11:54 aws
-rw-r--r-- 1 rlandster rlandster   74 Dec 11 18:43 aws.mdwn
-rw-r--r-- 1 rlandster rlandster  364 Apr  9 20:11 cloudbuild.yaml
drwxr-xr-x 3 rlandster rlandster 4096 Mar 11 04:56 debian
-rw-r--r-- 1 rlandster rlandster   42 Mar  9 19:56 debian.mdwn
drwxr-xr-x 3 rlandster rlandster 4096 Feb  2 13:26 gcp
-rw-r--r-- 1 rlandster rlandster   54 Feb  2 13:22 gcp.mdwn
drwxr-xr-x 2 rlandster rlandster 4096 Mar  3 10:15 git
drwxr-xr-x 8 rlandster rlandster 4096 Apr 17 05:08 .git
-rw-r--r-- 1 rlandster rlandster   48 Mar  3 10:15 git.mdwn
-rw-r--r-- 1 rlandster rlandster 2699 Mar 11 19:42 gpg.mdwn
-rw-r--r-- 1 rlandster rlandster   89 Mar 11 19:41 index.mdwn
drwxr-xr-x 2 rlandster rlandster 4096 Mar  3 10:15 ldap
-rw-r--r-- 1 rlandster rlandster   46 Mar  3 10:15 ldap.mdwn
-rw-r--r-- 1 rlandster rlandster 1242 Mar 10 20:51 local.css
-rw-r--r-- 1 rlandster rlandster   23 Dec 11 18:41 README.md

为了确保cloudbuild.yaml在远程,我做了远程存储库的git clone,然后列出对象:

$ git ls-tree refs/heads/master
100644 blob ba1d886a431eeefae6e86ea82e4b32f58e555482    README.md
100644 blob 255991c16bfa8ceda1f910ca8c2c9a76176074cc    aws.mdwn
040000 tree 1b65cfb9fab80cb19ca874f24eec18f4a33441ba    aws
100644 blob f9c0fa22a6b36daae4a258825fa14ee970c55db9    cloudbuild.yaml
100644 blob 1a1720e89e8f7e5782404d1dcde409f93fa2b3a3    debian.mdwn
040000 tree be830bc70f66503f3723b68293d1c2be171ba491    debian
100644 blob e24269417aa5afaa14b8d77a2af6d484bb132e91    gcp.mdwn
040000 tree c9470904cac2c9b4ecfc2d129a295414d3f91b35    gcp
100644 blob 96a0c8fc32b7ccb9d16a68beb20f471e4b3e2c8f    git.mdwn
040000 tree 84249e1a63519cfc1865f241caa03ff2c8276f70    git
100644 blob fe6ec42d23f3a35945f16ebe2f088c937b6a4fe0    gpg.mdwn
100644 blob 22c4923e6233039f7a5280eeeeeeb358765989dc    index.mdwn
100644 blob baa1399e4948a8f1456fa80100f08a369ce84439    ldap.mdwn
040000 tree d777c11680977d00b244877e6ee43a548c6d956a    ldap
100644 blob b30f876c9c054b304d30d584e3407da0f940419c    local.css

$ git cat-file -s refs/heads/master:cloudbuild.yaml   
364

更新:虽然手动触发仍会导致相同的“No such blob”错误,但git push会触发成功构建。因此,只是手动触发不起作用。

github google-cloud-platform
1个回答
0
投票

in this article之前报告了这个错误

接下来,在您的仓库的根目录中创建此cloudbuild.yaml文件。 内容将是Cloud Build执行器的说明,我们将在其中编写gsutil命令。本教程的其余部分假设您的git存储库至少具有以下结构(以粗体显示):

.

├── cloudbuild.yaml
├── dags
│   └── my_dag.py ... etc
└── plugins

通过git状态确保:

  • 你在主分公司
  • 实际上跟踪了文件cloudbuild.yml(意味着添加+提交已完成)

在文章评论中,用户报告:

想想,因为源代码存储库在我提交时没有获取cloudbuild.yaml。 我认为这是因为我已经基于某个路径设置了一个触发器,它只是忽略了该提交。

© www.soinside.com 2019 - 2024. All rights reserved.