cloud-builds pub/sub topic appears to be unlisted or inaccessible
A

3

8

I'm attempting to create an integration between Bitbucket Repo and Google Cloud Build to automatically build and test upon pushes to certain branches and report status back (for that lovely green tick mark). I've got the first part working, but the second part (reporting back) has thrown up a bit of a stumbling block.

Per https://cloud.google.com/cloud-build/docs/send-build-notifications, Cloud Build is supposed to automatically publish update messages to a Pub/Sub topic entitled "cloud-builds". However, trying to find it (both through the web interface and via gcloud command line tool) has turned up nothing. Copious amounts of web searching has turned up https://github.com/GoogleCloudPlatform/google-cloud-visualstudio/issues/556, which seems to suggest that the topic referenced in that doc is now being filtered out of results; however, that issue seems to be specific to the visual studio tools and not GCP as a whole. Moreover, https://cloud.google.com/cloud-build/docs/configure-third-party-notifications suggests that it's still accessible, but perhaps only to Cloud Functions? And maybe only manually via the command line, since the web interface for Cloud Functions also does not display this phantom "cloud-builds" topic?

Any guidance as to where I can go from here? Near as I can tell, the two possibilities are that something is utterly borked in my GCP project and the Pub/Sub topic is either not visible just for me or has somehow been deleted, or I'm right and this topic just isn't accessible anymore.

Auric answered 15/2, 2019 at 18:49 Comment(1)
I'm having the same issue, did you figure out what's wrong?Percival
P
3

I was stuck with the same issue, after a while I created the cloud-builds topic manually and created a cloud function that subscribed to that topic.

Build details are pushed to the topic as expected after that, and my cloud function gets triggered with new events.

Percival answered 7/7, 2019 at 2:37 Comment(0)
C
2

You can check the existence of the cloud-builds topic an alternate way from the UI, by downloading the gcloud command line tool and, after running gcloud init, running gcloud pubsub topics list to list all topics for the configured project. If the topic projects/{your project}/topics/cloud-builds is not listed, I would suggest filing a bug to the cloud build team here.

Cowbell answered 17/2, 2019 at 1:10 Comment(0)
V
0

Creating the cloud-builds topic manually won't work since it's a special topic that Google managed. In this case, you have to go to the API central and disable the CloudBuild API, and then enable it again, the cloud-builds topic will be created for you. Enable and disable Cloud Build API

Velum answered 15/1, 2020 at 9:25 Comment(1)
This did not work for me. Tried disabling using "gcloud services disable cloudbuild.googleapis.com" and re-enabling with "gcloud services enable cloudbuild.googleapis.com" and still get the same error: "Resource not found (resource=cloud-builds)"Dippold

© 2022 - 2024 — McMap. All rights reserved.