google-cloud-python: Unsuccessful authentication without errors/warnings

At first the authentication worked fine and I could see the API requests in the dashboard. But at some point the requests were not showing up anymore in the dashboard API overview.

I created a service account and stored the json file locally. Then I set the environment variable GCLOUD_PROJECT to the project ID and GOOGLE_APPLICATION_CREDENTIALS to the path of the json file.

from google.cloud import speech
client = speech.Client()
print(client._credentials.service_account_email)

Prints the correct service account email.

import io
with io.open(audio_file, 'rb') as f:
    audio = client.sample(f.read(), source_uri=None, sample_rate=48000, encoding=speech.encoding.Encoding.FLAC)
alternatives = audio.sync_recognize(language_code='de-DE')

The resulting transcript is correct, but nothing happens on the dashboard at https://console.cloud.google.com/apis/api/speech.googleapis.com/overview?project=[project-ID]

I also tried to initialize the client with the function speech.Client.from_service_account_json and to authenticate by installing the Google Cloud SDK and gcloud auth application-default login, but without success.

The error count (Fehler) is increasing here but I don’t know how to get additional information.

  • Windows 7
  • conda environment
  • python 3.5.2
  • google-cloud-speech 0.23.0

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (15 by maintainers)

Most upvoted comments

It’s None at first because the credentials have yet to be refreshed. It should be the time of execution plus one hour after because it refreshed during the execution.

Maybe @gguuss knows?