flutterfire_cli icon indicating copy to clipboard operation
flutterfire_cli copied to clipboard

Failed to list Firebase projects

Open gradycsjohnson opened this issue 4 years ago • 2 comments

I'm running the CLI for the first time and am running into authentication errors.

I figure I should be prompted for my credentials but instead I just get the following error. I've seen nothing in the documentation about manually configuring the CLI with a username/password.

> flutterfire configure
i Found 0 Firebase projects.
FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command.
COMMAND: firebase projects:list --json 
ERROR: Failed to list Firebase projects. See firebase-debug.log for more info.
Version:
> flutterfire -v
0.1.1+2

I have firebase CLI installed and am logged in:

> firebase login
Already logged in as xxxxx

OS:

Ubuntu 20.04.3 LTS

firebase-debug.log:

[debug] [2022-01-09T18:03:02.724Z] ----------------------------------------------------------------------
[debug] [2022-01-09T18:03:02.726Z] Command:       /home/gj/.nvm/versions/node/v14.7.0/bin/node /home/gj/.yarn/bin/firebase projects:list --json
[debug] [2022-01-09T18:03:02.726Z] CLI Version:   8.10.0
[debug] [2022-01-09T18:03:02.726Z] Platform:      linux
[debug] [2022-01-09T18:03:02.726Z] Node Version:  v14.7.0
[debug] [2022-01-09T18:03:02.727Z] Time:          Sun Jan 09 2022 13:03:02 GMT-0500 (Eastern Standard Time)
[debug] [2022-01-09T18:03:02.727Z] ----------------------------------------------------------------------
[debug] [2022-01-09T18:03:02.727Z] 
[debug] [2022-01-09T18:03:02.730Z] > 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] [2022-01-09T18:03:02.730Z] > authorizing via signed-in user
[debug] [2022-01-09T18:03:02.734Z] > 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] [2022-01-09T18:03:02.734Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token  
 <request body omitted>
[debug] [2022-01-09T18:03:02.874Z] <<< HTTP RESPONSE 400 {"cache-control":"no-cache, no-store, max-age=0, must-revalidate","date":"Sun, 09 Jan 2022 18:03:02 GMT","pragma":"no-cache","expires":"Mon, 01 Jan 1990 00:00:00 GMT","content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","server":"scaffolding on HTTPServer2","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2022-01-09T18:03:02.878Z] >>> HTTP REQUEST GET https://firebase.googleapis.com/v1beta1/projects?pageSize=1000  
 
[debug] [2022-01-09T18:03:03.170Z] <<< HTTP RESPONSE 401 {"www-authenticate":"Bearer realm=\"https://accounts.google.com/\", error=\"invalid_token\"","vary":"X-Origin, Referer, Origin,Accept-Encoding","content-type":"application/json; charset=UTF-8","date":"Sun, 09 Jan 2022 18:03:03 GMT","server":"ESF","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"}
[debug] [2022-01-09T18:03:03.171Z] <<< HTTP RESPONSE BODY {"error":{"code":401,"message":"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED"}}
[debug] [2022-01-09T18:03:03.174Z] HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
[debug] [2022-01-09T18:03:03.181Z] FirebaseError: HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
    at module.exports (/home/gj/.config/yarn/global/node_modules/firebase-tools/lib/responseToError.js:38:12)
    at Request._callback (/home/gj/.config/yarn/global/node_modules/firebase-tools/lib/api.js:41:35)
    at Request.self.callback (/home/gj/.config/yarn/global/node_modules/request/request.js:185:22)
    at Request.emit (events.js:314:20)
    at Request.EventEmitter.emit (domain.js:486:12)
    at Request.<anonymous> (/home/gj/.config/yarn/global/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:314:20)
    at Request.EventEmitter.emit (domain.js:486:12)
    at IncomingMessage.<anonymous> (/home/gj/.config/yarn/global/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:420:28)
    at IncomingMessage.emit (events.js:326:22)
    at IncomingMessage.EventEmitter.emit (domain.js:486:12)
    at endReadableNT (_stream_readable.js:1244:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
[error] 
[error] Error: Failed to list Firebase projects. See firebase-debug.log for more info.

gradycsjohnson avatar Jan 09 '22 18:01 gradycsjohnson

For posterity, this solved my problem: firebase login --reauth

gradycsjohnson avatar Jan 27 '22 13:01 gradycsjohnson

firebase login --reauth

Thank you very much i have been struggling from so long

ramanjitsingh-hub avatar Jan 28 '22 14:01 ramanjitsingh-hub

For posterity, this solved my problem: firebase login --reauth

This is the solution to authentication issue.

russellwheatley avatar Oct 19 '23 15:10 russellwheatley