2

I am trying to set up a cloud build trigger from a public github repository with the Cloud Build GitHub App. I installed the app on my repository and authorized it but when I was redirected to GCP to connect the repository to a project this error message came up:

Failed to retrieve GitHub repositories. The caller does not have permission

error

I suspect it may have something to do with having two factor authentication enabled on my github account, which I need for an organization.

I was able to mirror the same github repository from cloud source repositories without any issues though. I am the owner of the repository and gcp project.

*edit
Looks like the issue is due to having 2 factor authentication enabled on my github account. I disabled it and cloud build was able to connect with my repository. However I will need to have 2 factor enabled as my github organization requires it.

*edit
I hadn't mentioned the github organization i was part of had an ip whitelist configured on top of requiring 2 factor auth. I left the organization and reenabled 2 factor auth and cloud build was able to connect to my repo. Not sure why I would get the original issue if the repo is not in the github organization.

dses
  • 85
  • 1
  • 5
  • are you able to select source and authenticate your github account from Cloud Build Triggers? – critrange Jul 29 '20 at 19:19
  • @yash I tried to connect the repository from cloud build triggers and got a similar error message: "Google Cloud Platform was not authorized to list repositories. Its access was most likely revoked." Even clicking on the "Authorize Google Cloud Platform" button leads to the same error. – dses Jul 29 '20 at 19:27
  • hmm do you have access to the google cloud project? and aslo your billing account is not expired or installed correctly? and you enabled the Cloud Build service? – critrange Jul 29 '20 at 19:29
  • I am owner of the project, cloud build api is enabled, and i am on the $300 free trial. – dses Jul 29 '20 at 19:34
  • I have tried on my personal github account with 2 factor auth but I am able to connect the repo OK and create a push trigger, tested with a free trial account and a paid one, After authorizing in the github side I did had to refresh the GCP cloud build page for my github repo's to appear and be able to select to connect them, Possibly there could me more than it than just the 2 step verification, possibly reaching out to [support](https://console.cloud.google.com/support?project=seventh-voltage-269217) could help figuring this out – Andres S Jul 29 '20 at 22:22

1 Answers1

0

After looking more into this problem you either need to add GCE IP address ranges to the github organization IP whitelist https://cloud.google.com/compute/docs/faq#find_ip_range or just disable the whitelist if able to.

dses
  • 85
  • 1
  • 5