firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

firebase init error even though I reauthenticated

Open serdartkm opened this issue 9 years ago • 16 comments

Error: 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

C:\Oracle\tester>firebase login --reauth ? Allow Firebase to collect anonymous CLI usage information? No

Visit this URL on any device to log in: https://accounts.google.com/o/oauth2/auth?client_id=563584335869-fgrhgmd47bqnekij5i8b5pr03ho849e6.apps.googleusercontent.com&scope=email%20openid%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloudplatformprojects.readonly%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffirebase%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&response_type=code&state=320698024&redirect_uri=http%3A%2F%2Flocalhost%3A9005

Waiting for authentication...

C:\Oracle\tester>firebase init

 ######## #### ########  ######## ########     ###     ######  ########
 ##        ##  ##     ## ##       ##     ##  ##   ##  ##       ##
 ######    ##  ########  ######   ########  #########  ######  ######
 ##        ##  ##    ##  ##       ##     ## ##     ##       ## ##
 ##       #### ##     ## ######## ########  ##     ##  ######  ########

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

C:\Oracle\tester

Before we get started, keep in mind:

  • You are currently outside your home directory

? Are you ready to proceed? Yes ? Which Firebase CLI features do you want to setup for this folder? Press Space to select features, then Enter to confirm your choices. Hosting: Configure and deploy F irebase Hosting sites

=== Project Setup

First, let's associate this project directory with a Firebase project. You can create multiple project aliases by running firebase use --add, but for now we'll just set up a default project.

Error: 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

C:\Oracle\tester>

serdartkm avatar Jun 12 '17 08:06 serdartkm

this is also happening to me. (edit, this was because I used the project name, not the id).

justinbmeyer avatar Jun 14 '17 17:06 justinbmeyer

I have the same issue. I get this message when running firebase init, but also with firebase list and any other command.

I can get the list command running, using firebase list --token "$FIREBASE_TOKEN". The init command however still crashes during initialization of the cloud functions folder.

dedan avatar Jun 30 '17 15:06 dedan

hey @serdartkm I've had a similar or maybe the same issue also.

Here is what helped for me: https://github.com/firebase/firebase-tools/issues/342#issuecomment-314994814

heygambo avatar Jul 13 '17 07:07 heygambo

Add the --no-localhost flag, to see if it works for you, E.g:

firebase login:ci --no-localhost

GabrielRivera21 avatar Jul 19 '17 02:07 GabrielRivera21

The firebase SDK will also use your default gcloud credentials if you're using the google cloud sdk. This file $PWD/application_default_credentials.json can be reset using gcloud auth application-default login

sourcec0de avatar Aug 03 '18 12:08 sourcec0de

Hy i receive the message Error: Authentication Error: Your credentials are no longer valid. Please run firebase login --reauth and i just disable my antivirus (kaspersky) to able to run firebase deploy

zenojr avatar Sep 20 '18 02:09 zenojr

This seems like there's a few solutions in this thread, but since there's been not a lot of recent activity, we're closing this bug.

If anyone is still having issues with authentication, please open a new bug with the appropriate information! Thanks!

bkendall avatar Jan 09 '19 00:01 bkendall

You can logout with firebase logout and login in with firebase login. It solves the problem with ease.

bfamzz avatar Mar 27 '19 21:03 bfamzz

Had the same problem when running firebase deploy even after reauthenticating I had VPN connected.

  • Disconnecting from the VPN worked for me

lemndev avatar Sep 27 '19 15:09 lemndev

Help, I need to use VPN because I'm in China and there is no way to connect to google services without VPN.. any suggestions ?

zenkog avatar Nov 20 '19 00:11 zenkog

Sorry for the false alarm.. I found my problem is because I was behind Proxy. All I needed to do was just to disable Proxy from my System Preferences. Simple but crazy.. took my entire morning..

zenkog avatar Nov 20 '19 00:11 zenkog

Sorry for the false alarm.. I found my problem is because I was behind Proxy. All I needed to do was just to disable Proxy from my System Preferences. Simple but crazy.. took my entire morning..

Hi, could you provide a specific instruction about how to disable Proxy in the System Preferences? Many thanks!

Katherine2013 avatar May 27 '20 09:05 Katherine2013

hey @Katherine2013 , which OS are you working with, by default, you may want to ensure you are not using a VPN at this stage.

lemndev avatar May 27 '20 10:05 lemndev

Hi @lemndev , I'm with macOS and unfortunately I'm using VPN in China. I'm stuck with Firebase login right now. I believe the problem is from proxy settings. Is there anyway to solve it? Have tried many solutions but failed. Many thanks!

Katherine2013 avatar May 27 '20 10:05 Katherine2013

hey @Katherine2013 , personally i haven't used MacOS as a daily driver for even past 2 hours so i wouldn't lie that i know how to deal with that. I however landed on https://support.wickr.com/hc/en-us/articles/360008497154-Disabling-proxy-settings-on-macOS which i hope you find useful

lemndev avatar May 27 '20 10:05 lemndev

@lemndev Will try. Thanks anyway. Hope you safe in this special period.

Katherine2013 avatar May 27 '20 10:05 Katherine2013