Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use Google Cloud Pub/Sub with emulator #7715

Open
rpkamp opened this issue Sep 30, 2024 · 1 comment
Open

Unable to use Google Cloud Pub/Sub with emulator #7715

rpkamp opened this issue Sep 30, 2024 · 1 comment

Comments

@rpkamp
Copy link
Contributor

rpkamp commented Sep 30, 2024

Whenever I create an instance of PubSubClient and do something with it in my development environment, using the PubSub emulator, I get the following exception:

Google\ApiCore\ValidationException: Could not construct ApplicationDefaultCredentials

Looking into the code it seems the library can't construct credentials to use for PubSub, but it shouldn't even need it, as the emulator doesn't require any credentials.

The v1 version of the library also didn't need any credentials.

Environment details

  • OS: Ubuntu 22.04
  • PHP version: 8.3
  • Package name and version: google/cloud-pubsub, version 2.7.0

Steps to reproduce

  1. Set environment variable PUBSUB_EMULATOR_HOST
  2. Create new PubSubClient
  3. Do something with client
@pulzarraider
Copy link

You can try some example keys: key mentioned in #7187 or example-key.json.

However, you'll then face another issue: the library generates HTTPS links, while Pub/Sub only supports HTTP. This should be addressed by my merge request, which is currently awaiting approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants