0
votes

I have project A and project B in my google cloud. I have my configuration set to project A, but when I try and use my pub/sub reliant python scripts, the look for the subscription in project B, which then gives this error:

google.cloud.exceptions.NotFound: 404 projects/PROJECT_B/subscriptions/SUBSCRIPTION_NAME

I should note that I do not encounter this error on my machine, but it happens on a linux test server.

Also, running the commands

gcloud beta pubsub subscriptions list
gcloud beta pubsub topics list

List the subscriptions and topics in project A.

1

1 Answers

0
votes

Project used in request is derived from --project flag, if that is not set then it is pulled from core/project project property.

You can see current property settings via

gcloud config list

The property can be set via

gcloud config set core/project PROJECT_A

This has to be done on every machine you use gcloud on as these settings are local to the machine. They are usually stored in ~/.config/gcloud directory. You can use gcloud info command to see which directory credentials and other settings/properties are stored in.