question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing GOOGLE_APPLICATION_CREDENTIALS env variable in flex for .NET core?

See original GitHub issue

I’m trying to use datastore from a F# .NET Core 2.0 application. The code works fine locally and I expected it to do so on AppEngine as well.

Info about the app:

  • Docker base image: gcr.io/google-appengine/aspnetcore:2.0
  • Version of datastore package: 2.1.0-alpha00
  • Code to create datastoredb: DatastoreDb.Create("MY GOOGLE PROJECT")
  • App yaml
env: flex
runtime: custom
service: service-name
manual_scaling:
  instances: 1

Result:

Unhandled Exception: System.TypeInitializationException: The type initializer for ‘<StartupCode$FatSlack>.$Program’ threw an exception. —> System.InvalidOperationException: 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. at Google.Api.Gax.TaskExtensions.WaitWithUnwrappedExceptions(Task task) at Google.Api.Gax.Grpc.ChannelPool.GetChannel(ServiceEndpoint endpoint) at Datastore.getToken(String kind, String name) in /Users/tomasjansson/git/unacast/CoreService/src/FatSlack/Datastore.fs:line 7

Expected result:

An instance of the DataStoreDb is created.

I thought that those where somehow automatically mounted when a custom flex application was started. I realize that this might not be an issue with the framework, but rather how custom flex appications are started on app engine.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:83 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jskeetcommented, Feb 2, 2018

Not at my computer right now, but will check when I’m back.

1reaction
jskeetcommented, Sep 27, 2017

@Jonathan34: I’m using that one because it’s the one @mastoj is using. I’m trying to be as similar as I can, without venturing into F# 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

C# Application Default Credentials not available
I'm currently trying to access the cloud API and I am receiving this error: The Application Default Credentials are not available. They are ......
Read more >
Google Cloud Application Default Credentials - PHP
Google Cloud Application Default Credentials (ADC) is a strategy to locate sources that contain secrets/key material to create credentials.
Read more >
How Application Default Credentials works | Authentication
Monitoring, logging, and application performance suite. ... Fully managed environment for running containerized apps. ... Platform for modernizing existing apps and ...
Read more >
Getting Started w/ .NET on GCP
NET. Several years ago, I spent many, contented days writing C#. Google ... bucket name and use the environment variables you created previously...
Read more >
How to Set GOOGLE_APPLICATION_CREDENTIALS in ...
Setting GOOGLE_APPLICATION_CREDENTIALS env variable​​ In order to provide the location of the credentials JSON file, you need to make use of the GOOGLE_...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found