Skip to content

Failed to parse access token response: Error: Server responded with status 400 #435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wwwy3y3 opened this issue Jan 8, 2019 · 2 comments

Comments

@wwwy3y3
Copy link

wwwy3y3 commented Jan 8, 2019

Describe your environment

  • Operating System version: debian (from node:carbon docker image)
  • Firebase SDK version: 6.4.0
  • Library version: 6.4.0
  • Firebase Product: database

Describe the problem

On my instance, I have multiple credentials downloaded from dashboard and use them to host multiple firebase apps.

// credential changes for different apps
// credential is directly downloaded from dashboard
const projectId = credential.project_id;
const databaseURL = `https://${projectId}.firebaseio.com`;
let firebaseApp;
try {
      firebaseApp = firebaseAdmin.app(projectId);
} catch (e) {
      firebaseApp = firebaseAdmin.initializeApp({
        credential: firebaseAdmin.credential.cert(credential),
        databaseURL
      }, projectId);
}

// use firebaseApp to request then
const database = firebaseApp.database();

While some apps work fiine, some apps will throw warning below:

@firebase/database: FIREBASE WARNING: {\"code\":\"app/invalid-credential\",\"message\":\"Credential implementation provided to initializeApp() via the \\\"credential\\\" property failed to fetch a valid Google OAuth2 access token with the following error: \\\"Failed to parse access token response: Error: Server responded with status 400.\\\".\"}

And my requests to firebase just hang, no errors thrown, and my requests will be timed out.

Steps to reproduce:

It works on my local machine with firebase-admin, and it seems to only happen on certain apps. Since no errors actually thrown, it's really hard to debug with only 400 status response. Perhaps you guys have experienced this kind of error before and might be able to help me?

@gabimoncha
Copy link

Hello, I encountered this issue also, just opened one without realising you already had one. My scripts throws the exact same error only on Windows. On Mac there is no problem. I will test it now on Ubuntu and see...

@hiranya911
Copy link
Contributor

See my comment on #436.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants