Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Does the gcloud snap package include beta components?

According to https://cloud.google.com/sdk/docs/downloads-snap:
This package contains the gcloud CLI, gcloud alpha, gcloud beta, gsutil, docker-credential-gcloud, and bq commands only.

However trying to run

 

 

gcloud beta emulators pubsub start \                                                                                                            ─╯
    --project=the-project \
    --host-port='localhost:8043'

 

 

gives:
You need the [pubsub-emulator] component to use the Google Cloud  
Pub/Sub emulator.
ERROR: (gcloud.beta.emulators.pubsub.start) You cannot perform this action because this Google Cloud CLI installation is managed by an external packag
e manager.
Please consider using a separate installation of the Google Cloud CLI created through the default mechanism described at: https://cloud.google.com/sdk
/

Is the documentation wrong or obsolete?

 

 

0 1 758
1 REPLY 1

HI @reusable8778

Welcome to the community and thank you for raising awareness.

Let me first confirm that the published Google Cloud documentations are always up to date. The reason why you are getting the mentioned error message ("...Google Cloud CLI installation is managed by an external package manager") is because it might have been installed using non-standard installation  or through the apt or yum package managers.

A couple of workarounds can make this work; (i) You can uninstall the Google Cloud CLI installation from the external package manager then install it again using the official Google Cloud SDK installer. This will allow you to have full control over the Google Cloud CLI installed on your machine and be able to start the Pub/Sub emulator. (ii) You can use a gcloud command line tool from a Docker container to start the Pub/Sub emulator. This will create a temporary Google Cloud CLI instance that is not managed by an external package manager.

You can review these resources for further understanding.

Hope this helps.