You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and create a custom token fine. I was able to do it locally, without error.
Now, we get errors locally like
Failed to determine service account. Make sure to initialize the SDK with a service account credential. Alternatively specify a service account with iam.serviceAccounts.signBlob permission. Original error: Error: Error while making request: getaddrinfo ENOTFOUND metadata. Error code: ENOTFOUND
This is very similar to the hoops introduced in 13.x to get the projectId.
To get everything properly working with each other, you need to do something like unnecessarily create the google auth, wait for the projectId/for it to be "filled", and then set the service account that that had auto set in the initializeApp function,
All of the above seems like a big regression to many working features which needs to be fixed, or much of the documentation needs updating as running just initializeApp now does not set up your app fully like it did prior to 13.x, or plainly just a bug.
The exact same service account and env vars are set, when testing against pre 13 and 13.x, and works fine with the appropriate code above, no issue with env vars, nor service account perms.
The text was updated successfully, but these errors were encountered:
When you call initializeApp() with no parameters the SDK will try to fetch the credentials from your environment.
How are you setting the service account credentials in your local environment? Do you use the GOOGLE_APPLICATION_CREDENTIALS env variable?
In regards the perms, as I mentioned in the post, this works perfectly, with the same service account, service account json file, and .env vars and the above code, on pre 13.x, and with the altered code on 13, so it's 100% nothing to do with the perms. I think it's to do with how the app is initialising now, and due to the "promise-y" nature of loading GoogleAuth, things aren't setting up right.
projectId doesn't exist on the Credential type. Even if I DID force cast it as having a projectId, it's still empty. It's empty until the getProjectId is awaited upon, in the private (inaccessible to even cast as) ApplicationDefaultCredential
I truly don't understand the strategy that's gone on with some of this stuff and the change to GoogleAuth. Either expose the googleAuth object on the credential, or expose the internals of the default credential, or at least let us check, and cast the credential as the internal class. I'm really surprised that more things hasn't broken for more people, we've had a nightmare with the change.
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
What happened? How can we make the problem occur?
Prior to 13.x and the switch to google auth, you were able to run code like this
and create a custom token fine. I was able to do it locally, without error.
Now, we get errors locally like
This is very similar to the hoops introduced in 13.x to get the projectId.
To get everything properly working with each other, you need to do something like unnecessarily create the google auth, wait for the projectId/for it to be "filled", and then set the service account that that had auto set in the
initializeApp
function,All of the above seems like a big regression to many working features which needs to be fixed, or much of the documentation needs updating as running just
initializeApp
now does not set up your app fully like it did prior to 13.x, or plainly just a bug.--- edit ---
My creds are loaded from my .env file, via
The exact same service account and env vars are set, when testing against pre 13 and 13.x, and works fine with the appropriate code above, no issue with env vars, nor service account perms.
The text was updated successfully, but these errors were encountered: