Skip to content

STORAGE_EMULATOR_HOST should not necessitate GOOGLE_APPLICATION_CREDENTIALS #9453

@jeanbza

Description

@jeanbza

When I run storage with STORAGE_EMULATOR_HOST, I should not need to provide GOOGLE_APPLICATION_CREDENTIALS since I'm talking to an unsecured emulator. However, I get:

deklerk at deklerk-macbookpro2 in ~/workspace/google-cloud-python/storage/tests/perf on master
$ unset GOOGLE_APPLICATION_CREDENTIALS
deklerk at deklerk-macbookpro2 in ~/workspace/google-cloud-python/storage/tests/perf on master
$ python3 benchwrapper.py --port 8081
Traceback (most recent call last):
  File "benchwrapper.py", line 27, in <module>
    client = storage.Client()
  File "/Users/deklerk/workspace/google-cloud-python/storage/google/cloud/storage/client.py", line 94, in __init__
    project=project, credentials=credentials, _http=_http
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/google/cloud/client.py", line 226, in __init__
    _ClientProjectMixin.__init__(self, project=project)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/google/cloud/client.py", line 178, in __init__
    project = self._determine_default(project)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/google/cloud/client.py", line 193, in _determine_default
    return _determine_default_project(project)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/google/cloud/_helpers.py", line 186, in _determine_default_project
    _, project = google.auth.default()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/google/auth/_default.py", line 317, 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

Metadata

Metadata

Labels

api: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions