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

bigtable.client asking for credentials while using emulator #438

Closed
Job-Heersink opened this issue Oct 7, 2021 · 1 comment
Closed

bigtable.client asking for credentials while using emulator #438

Job-Heersink opened this issue Oct 7, 2021 · 1 comment
Labels
api: bigtable Issues related to the googleapis/python-bigtable API.

Comments

@Job-Heersink
Copy link

I'm experiencing issues with connecting locally to a cloud big table emulator.
It is very similar to this issue:
#184 (comment)

Environment details
OS type: Ubuntu
Python version: 3.8
pip version: 21.2.4
google-cloud-bigtable version: 2.4.0

my code:

os.environ["BIGTABLE_EMULATOR_HOST"] = "localhost:8086"
print(os.getenv("BIGTABLE_EMULATOR_HOST")) #checks out
self.client = bigtable.Client(project=project_id, admin=True)

self.instance = self.client.instance("anonymous")
self.instance.create()

I'm running the emulator via docker locally (bigtruedata/gcloud-bigtable-emulator) on port 8086.

I get the following error when trying to run the code:

Traceback (most recent call last):
  File "/home/job/projects/sg_lab/server/bigtable_handler.py", line 34, in <module>
    dh = BigtableHandler()
  File "/home/job/projects/sg_lab/server/bigtable_handler.py", line 12, in __init__
    self.client = bigtable.Client(admin=True)
  File "/home/job/.local/lib/python3.8/site-packages/google/cloud/bigtable/client.py", line 184, in __init__
    super(Client, self).__init__(
  File "/home/job/.local/lib/python3.8/site-packages/google/cloud/client.py", line 316, in __init__
    _ClientProjectMixin.__init__(self, project=project, credentials=credentials)
  File "/home/job/.local/lib/python3.8/site-packages/google/cloud/client.py", line 264, in __init__
    project = self._determine_default(project)
  File "/home/job/.local/lib/python3.8/site-packages/google/cloud/client.py", line 283, in _determine_default
    return _determine_default_project(project)
  File "/home/job/.local/lib/python3.8/site-packages/google/cloud/_helpers.py", line 152, in _determine_default_project
    _, project = google.auth.default()
  File "/home/job/.local/lib/python3.8/site-packages/google/auth/_default.py", line 483, in default
    raise exceptions.DefaultCredentialsError(_HELP_MESSAGE)
google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more information, please see https://cloud.google.com/docs/authentication/getting-started

Process finished with exit code 1
@product-auto-label product-auto-label bot added the api: bigtable Issues related to the googleapis/python-bigtable API. label Oct 7, 2021
@tseaver
Copy link
Contributor

tseaver commented Oct 19, 2021

@supergreditur Thanks for the report! As of PR #430, the emulator should be fine running in an environment lacking any credentials (we now run it that way in a Github Workflow action). That fix should be available once we make a new release (likely next week, after all the Googlers return from the NEXT conference).

@tseaver tseaver closed this as completed Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the googleapis/python-bigtable API.
Projects
None yet
Development

No branches or pull requests

2 participants