Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to detect whether we are running on Google Compute Engine

I am trying to use Google Cloud Speech recognition but I get this error

I/omputeEngineCredentials: Failed to detect whether we are running on Google Compute Engine. W/System.err: java.io.IOException: The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.

I set the environment variable from System Properties/Environment Variables/User variables and also I set the credentials manually using this guide.

I have searched every topic that is relevant to this, but I can't get it to work. What am I missing?

like image 681
Student Avatar asked Nov 23 '19 17:11

Student


People also ask

How do I reset Google Compute Engine?

Right-click the VM and select Migrate for Google Compute Engine Operations > Restart.

How do I connect Google Compute Engine?

To connect to an instance without an external IP address, use the gcloud compute ssh command with the --internal-ip flag. In the Google Cloud console, go to the VM Instances page and find the internal IP address for the instance that you want to connect to. Connect to the instance.

Is Google Compute Engine?

Google Compute Engine (GCE) is an infrastructure as a service (IaaS) offering that allows clients to run workloads on Google's physical hardware. Google Compute Engine provides a scalable number of virtual machines (VMs) to serve as large compute clusters for that purpose.


1 Answers

I faced this issue while connecting to Cloud Storage from local .Following are the steps I followed that worked for me:

  1. Install Cloud SDK. Reference link:Cloud SDK
  2. Follow all the steps to initialize the SDK.
  3. Now ,create application default credentials by using the following command in the root directory of your application gcloud auth application-default login, by which google-cloud will automatically detect your credentials.
like image 151
snehab Avatar answered Oct 21 '22 19:10

snehab