I'm running into an issue when trying to use the Google Cloud Pub/Sub Emulator. I am able to start the emulator successfully, but I cannot create topics or interact with it using gcloud commands.
I have tried running this from:
I have already set all the necessary environment variables inside the container:
CLOUDSDK_PUBSUB_EMULATOR_HOST=pubsub-emulator:8085
PUBSUB_PROJECT_ID=my-project
GOOGLE_CLOUD_PROJECT=my-project
CLOUDSDK_CORE_DISABLE_PROMPTS=1
CLOUDSDK_AUTH_DISABLE_CREDENTIALS=1
However, every time I try to create a topic using:
gcloud pubsub topics create my-topic --project=my-project
I get the following error:
ERROR: Failed to create topic [projects/my-project/topics/my-topic]: Method doesn't allow unregistered callers (callers without established identity). Please use API Key or other form of API consumer identity to call this API.
I was under the impression that authentication is not required for local emulator use, but based on my testing, it seems like authentication might actually be necessary. My Questions
Is authentication required to use the Pub/Sub Emulator?
If authentication is not required, what might be causing gcloud to ignore the emulator and still require credentials?
Is there any way to use the emulator without linking it to a real Google Cloud account?
I would prefer not to create another Google account just for local development, but I will if it's truly necessary.
Any help would be greatly appreciated!
Thanks in advance.
According to the documentation
To use the emulator, you must have an application built using the Cloud Client Libraries. The emulator does not support Google Cloud console or
gcloud pubsub
commands.
You're running gcloud pubsub
commands