Failed retrieving user account: Unauthorized. Double-check your login status with 'netlify status' or contact support with details of your error

Hello :wave:

I recently updated netlify-cli from version 2.64.0 to 3.2.0 and get error now:

Failed retrieving user account: Unauthorized. Double-check your login status with 'netlify status' or contact support with details of your error.

dev, status, login, switch give me the same error.

Could you help me fix this issue?

V

1 Like

I am experiencing the same issue since yesterday, after uploading netlify-cli

It seems the auth method changed on Netlify side :thinking:

I used this guide to fix the issue: https://docs.netlify.com/cli/get-started/#obtain-a-token-in-the-netlify-ui

  1. Issued new Netlify access token in https://app.netlify.com/user/applications
  2. Changed token in config.json file in my Home directory (macOS): /Users/USER_NAME/.netlify/config.json

NOTE: the netlify login didn’t work - it would simply these steps.

3 Likes

Thank you very much for your insight — it fixed my auth problem :tada:

1 Like

Sorry for the trouble here, and thanks so much @vitalikda for sharing a fix. I’ll share this report with our CLI team so they can investigate.

1 Like

One last question before I file an issue: can you say how you did the update? That might help us determine the root cause here.

@jen I got standard notification from npm, as I recall:

npm i -g netlify-cli

Hi @SRFeesha and thank you for sharing the solution. Could you specify what didn’t work with the netlify login command? Another workaround could be to run netlify logout then netlify login.

Hi @erez, as mentioned in my original post, commands showed me Unauthorized error message.

I didn’t try ntl logout because it is not listed in cli commands.

ntl-cli

1 Like

Thanks @vitalikda, the netlify logout command is a hidden command. I should have made that clearer in my initial post. We’re working on making it public though:

I second the vitalikda response: same exact situation

If still, it doesn’t work by invoking access token.
Follow these steps

  1. Uninstall netlify-cli g
  2. Remove /Users/USER_NAME/.netlify
  3. Install other netlify-cli version.

Hopefully, it will fixed the issue

Hey jen, Yesterday I just signout from Netlify dashboard and today I wasn’t able to login again (Auth provider Github). So I just reset my password and then this problem occur. I have tried @vitalikda 's solution but it doesn’t work on my end.

So I posted here my solution that works for me.

Thanks

1 Like

@vitalikda Can you please tell me how to perform

  1. Changed token in config.json file in my Home directory (macOS): /Users/USER_NAME/.netlify/config.json
    this step in windows


How to solve this, I am still not getting.
Can anyone please help me??

Try

netlify logout

command as per @erez suggestion

If it worked, then you should be able to run

netlify login
3 Likes

For me, nothing of that sort worked. I get a crash of the Netlify-CLI the moment I try to invoke anything. I did the uninstall, delete the Netlify config, reinstall thing, but every time I launch Netlify with almost any command except help or plugins, I get an error as documented here. For me, Netlify-CLI is currently complete inoperational.

Marco

Hello @MarcoZ,

Thank you for letting us know! That is not the experience we would like you to have.

I see you have filed an issue for this, thank you for doing that. Please keep an eye on that issue as we will update you there as soon as we have some news.

I had the same issue @Shahzad6077: I was forced to logout of the dashboard and reset my password, upon trying to use the cli commands after resetting pass I received ‘Failed retrieving user account: Unauthorized. Double-check your login status with ‘netlify status’ or contact support with details of your error.’ message which could be expected.

Following the contents of this thread I have tried all 3 proposed solutions:

  1. Updating /.netlify/config.json manually with a new token obtained in the UI
  2. Removing the globally installed CLI package, removing /.netlify and it’s contents entirely and re-installing the cli and running netlify login
  3. Running the hidden netlify logout command and then trying to run netlify login

I still see the same error for every single netlify command, including the hidden netlify logout command.

Are there any other proposed workarounds that can be tried? Currently the cli is not available to me because of this.

I tried reinstalling, deleting user config files and it’s still broken :frowning:

welp