简体   繁体   中英

Gcloud pub/sub ignoring configuration?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM