Firebase-tools: Error: Failed to list Firebase projects.

Created on 18 Jul 2020  路  5Comments  路  Source: firebase/firebase-tools

I'm going to use AngularFire in my Angular App and host it on Firebase.

Firebase CLI keep throwing this error every time I try to initialize a Firebase project.

Error: Failed to list Firebase projects. See firebase-debug.log for more info.

And my _firebase-debug.log_ file is as follows;

[debug] [2020-07-18T11:57:55.549Z] ----------------------------------------------------------------------
[debug] [2020-07-18T11:57:55.552Z] Command:       C:\Program Files\nodejs\node.exe C:\Users\buddhi.ranasinghe\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js init
[debug] [2020-07-18T11:57:55.552Z] CLI Version:   7.12.1
[debug] [2020-07-18T11:57:55.552Z] Platform:      win32
[debug] [2020-07-18T11:57:55.553Z] Node Version:  v12.18.1
[debug] [2020-07-18T11:57:55.554Z] Time:          Sat Jul 18 2020 17:27:55 GMT+0530 (India Standard Time)
[debug] [2020-07-18T11:57:55.554Z] ----------------------------------------------------------------------
[debug] [2020-07-18T11:57:55.554Z] 
[debug] [2020-07-18T11:57:55.566Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2020-07-18T11:57:55.566Z] > authorizing via signed-in user
[info] 
     ######## #### ########  ######## ########     ###     ######  ########
     ##        ##  ##     ## ##       ##     ##  ##   ##  ##       ##
     ######    ##  ########  ######   ########  #########  ######  ######
     ##        ##  ##    ##  ##       ##     ## ##     ##       ## ##
     ##       #### ##     ## ######## ########  ##     ##  ######  ########

You're about to initialize a Firebase project in this directory:

  D:\DevDojo\blog
[info] 
=== Project Setup
[info] 
[info] First, let's associate this project directory with a Firebase project.
[info] You can create multiple project aliases by running firebase use --add, 
[info] but for now we'll just set up a default project.
[info] 
[debug] [2020-07-18T11:58:01.249Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"]
[debug] [2020-07-18T11:58:01.249Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token  
 <request body omitted>
[debug] [2020-07-18T11:58:01.492Z] Authentication Error: Your credentials are no longer valid. Please run firebase login --reauth

For CI servers and headless environments, generate a new token with firebase login:ci
[debug] [2020-07-18T11:58:01.737Z] FirebaseError: Authentication Error: Your credentials are no longer valid. Please run firebase login --reauth

For CI servers and headless environments, generate a new token with firebase login:ci
    at Object.<anonymous> (C:\Users\buddhi.ranasinghe\AppData\Roaming\npm\node_modules\firebase-tools\lib\auth.js:23:32)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\Users\buddhi.ranasinghe\AppData\Roaming\npm\node_modules\firebase-tools\lib\commands\login.js:8:12)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at loadCommand (C:\Users\buddhi.ranasinghe\AppData\Roaming\npm\node_modules\firebase-tools\lib\commands\index.js:5:19)
    at module.exports (C:\Users\buddhi.ranasinghe\AppData\Roaming\npm\node_modules\firebase-tools\lib\commands\index.js:73:20)
[error] 
[error] Error: Failed to list Firebase projects. See firebase-debug.log for more info.

P.S. I tried the solution give in this Stackoverflow question But it didn't work at all.

Most helpful comment

The error message says: Please run firebase login --reauth. Did you try that? If so, what happened?

All 5 comments

The error message says: Please run firebase login --reauth. Did you try that? If so, what happened?

The error message says: Please run firebase login --reauth. Did you try that? If so, what happened?

Yes. I did that. Reauth works successfully. But when I tried to initialize the project, at the stage where it fetches my existing projects, I get this error. I have another project which I deployed few months back. I tried to re-deploy it to check whether it works. At that moment also I got similar error.

@Buddhilive hmmm I'm not sure what's going on but maybe you can try an alternate authentication method:
https://github.com/firebase/firebase-tools#authentication

For example maybe try running firebase logout and then gcloud auth application-default login and see if you can use the Firebase CLI then?

@Buddhilive hmmm I'm not sure what's going on but maybe you can try an alternate authentication method:
https://github.com/firebase/firebase-tools#authentication

For example maybe try running firebase logout and then gcloud auth application-default login and see if you can use the Firebase CLI then?

Yeah, seems like the issue is with my Kaspersky Endpoint Security software. It's blocking some servers like NPM registry too. So I suspect it is doing the same for google auth servers. Can't say exactly. I have no control over it since it's installed and managed by our organization. I report this to System Admins.
For the time being, I implemented GitHub actions to deploy my project to Firebase.

I'm having the same issue. I'm running this from my own mac so I don't believe the issue is related to other software. Also authentication work fine with Firestore commands. So something else is causing this.

Any ideas?

Was this page helpful?
0 / 5 - 0 ratings