谷歌云构建器触发器给出"No such blob"错误



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

但是,当我通过选择"运行触发器"触发运行时,Google云构建器会给我错误

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

更新:虽然手动触发仍会导致相同的"无此类 blob"错误,但 git 推送确实会触发成功的构建。因此,只是手动触发不起作用。

该错误之前已在本文中报告过

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

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

通过 git 状态确保:

  • 您在主分支上
  • 实际跟踪文件cloudbuild.yml(意味着已完成添加+提交(

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

图,因为在我提交时源存储库没有拾取cloudbuild.yaml
我认为发生这种情况是因为我根据特定路径设置了一个触发器,它只是忽略了该提交。

相关内容

最新更新