Your build failed to run: Couldn't read commit xxxxxxxx

9/9/2020

I'm trying to build and deploy an image on GCP with cloud build. I have a rails api repo on bitbucket running on docker, the repo is synced with google cloud repository

I configured a trigger on cloud build when a commit is made on my master branch.

Trigger Configuration:

Trigger Configuration

Service account permissions:

Service account permissions

But when the master branch gets a commit, the triggers returns the following error: our build failed to run: <br>Couldn't read commit xxxxxxxx

Build Error:

Build Error

I tried checked the GCP doc and I can't find anything. I think the issue might be on the IAM level, maybe the service account needs more credentials.

-- Hugues
docker
google-cloud-build
google-cloud-platform
google-kubernetes-engine
kubernetes

2 Answers

2/8/2022

For me the Cloud Build API needed to be enabled. Once I did this my build ran, I didn't need to do anything special for permissions.

-- Justin K
Source: StackOverflow

9/9/2020

I actually edited the IAM setting for this service account to add: Project > Editor Source Repository > Reader

Now it works

-- Hugues
Source: StackOverflow