Cli: Handle logged out users with grace

Created on 5 Nov 2018  ยท  7Comments  ยท  Source: netlify/cli

Everything stopped from working 2 hours ago

when i try to deploy a new site i have:

netlify status
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
Current Netlify User โ”‚
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
FetchError: invalid json response body at https://api.netlify.com/api/v1/accounts reason: Unexpected end of JSON input
at /usr/local/lib/node_modules/netlify-cli/node_modules/node-fetch/lib/index.js:239:32
at

same when i add netlify deploy

when i type : netlify login i have:

netlify login
Already logged in!

I'm using a Mac, Node JS version 8.11.3 and npm 5.6

dx bug

Most helpful comment

Just ran into this same problem. I fixed it by just doing netlify logout and then netlify login. I think it was because I changed my password recently, which makes sense why it wasn't working from a security standpoint but ya this error should probably be handled better.

All 7 comments

ok so i dig it into my files, in mac by default all the files that begin with . will be hidden, so you need to make them visible, then navigate to your user folder, and remove the .netlify folder, then type

netlify login

this will generate new credentials

Thanks for the report, sounds like we aren't handling a loading error.

ok so i dig it into my files, in mac by default all the files that begin with . will be hidden, so you need to make them visible, then navigate to your user folder, and remove the .netlify folder, then type

netlify login

this will generate new credentials

Ran in the same problem, this fixed it for me. Not sure if this problem occured because I changed my password, so the credentials stored under .netlify was invalidated?

Just ran into this same problem. I fixed it by just doing netlify logout and then netlify login. I think it was because I changed my password recently, which makes sense why it wasn't working from a security standpoint but ya this error should probably be handled better.

Still an issue!

Re-create credentials, or simply double-check correctly used such.

For a quick reproducing you could revoke the Netlify CLI permissions under:
https://app.netlify.com/user/applications

or NETLIFY_AUTH_TOKEN=1 netlify status

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ercgrat picture ercgrat  ยท  3Comments

TomPichaud picture TomPichaud  ยท  3Comments

bcomnes picture bcomnes  ยท  3Comments

RaeesBhatti picture RaeesBhatti  ยท  4Comments

mrlubos picture mrlubos  ยท  5Comments