Can't login to Netlify CMS any more

Hi
I have successfully been logging into Netlify CMS for several months on site ryan21.netlify.app but a few days ago this stopped working with login error Gotrue-js: failed getting jwt access token.

I tried to reset my password which seemed to work but I got the same error Gotrue-js: failed getting jwt access token when trying to login with the new password.

I went into Netlify Identity and deleted myself as a user then reinvited myself. I got the email to join, which I followed and set up a login. However, I can’t login and get the same error.

Any ideas how I can fix this?

Thanks

This is the error message in the console

Error: Gotrue-js: Failed to parse tokenResponse claims: TypeError: e is undefined
value user.js:194
e user.js:58
value index.js:171
value index.js:202

This issue on GitHub might be related:

1 Like

Thanks for that thought,Tom. I’m not sure whether that’s related or not to be honest. I’ve been trying lots of different ideas and I have fixed the problem, or so it seems.

This really doesn’t make much sense to me but I did 2 things

  • I removed async and defer from the identity widget and the netlifycms widget

  • I removed the branch name from the YAML config file (I am working with master which sensibly is the default)

Hey presto! I can log in.

As I say, that doesn’t make much sense to me, but problem solved.

1 Like

It must have been the asynchronous loading! Glad it’s working now.

1 Like

Glad everything is working, @AttractMore :netliconfetti:

Actually, I spoke too soon.

I was able to login and do some updates to the site withouut any problem. I looged out and now can’t log back in again. Same error as before - Gotrue-js: failed getting jwt access token

Frustrating!

Hi @AttractMore,

Seems like a big thing, but if you’re the only user, could you try to delete the entire Identity instance and set it up again? It’s a pain, but might work. If not, maybe creating a different website entirely would help.

Or, before you try that, would it be possible for you to create a test login for us to be able to check what might be happening?

Hi @hrishikesh

Thanks for the suggestion.

I’d be happy to create a test login for you, but first some more info!

Both myself and the client can now login ONLY if we use a private browser window. However, we can’t log out due to the JWT token error. Clearly this is a better situation than before but still mysterious.

Can you let me have an email address for the test login.

That’s an interesting find.

You could add hrishikesh@netlify.com or setup a random email address like test@test.com for testing purposes. If you go down the second path, you’d have to turn on auth confirm on for a moment, sign up with that email address and turn the setting off.

Thanks. You’re invited!

Interesting, I can’t even signup, I’m getting the JWT error here itself.

Aha, I think we have a lead. Looks like your service worker is taking over the requests made by Netlfy Identity and this would even explain why it works in incognito.

I did wonder if the SW might be implicated!

Any idea how I can resolve this?

2 ways:

  1. Either remove the SW altogether.
  2. Configure the SW to ignore requests having /.netlify/ in it.
1 Like

Thanks. I’ll look at implementing option 2.

Thanks very much for your help and support.

1 Like

I have excluded /.netlify and /admin from the service worker.

Still getting the same error on logout. I can see the jwt token as a cookie when I’m logged in but on logout the console shows

Cookie “nf_jwt” has been rejected because it is already expired. logout
ACCESS_TOKEN_ERROR: Failed getting access token: Gotrue-js: failed getting jwt access token
t AccessTokenError.js:12
r AccessTokenError.js:40
tokenPromise implementation.js:275
requestHeaders GitHubAPI.js:54
request API.js:283
listFiles API.js:651
getMedia implementation.js:465
getMedia implementation.js:452
getMedia backend.js:792
f mediaLibrary.js:246
loadMedia mediaLibrary.js:263
Redux 2
componentDidMount MediaLibrary.js:296
React 2
unstable_runWithPriority scheduler.production.min.js:19
React 4
unstable_runWithPriority scheduler.production.min.js:19
React 4
Redux 7
loginUser auth.js:110
promise callbackt.loginUser/< auth.js:105
Redux 2
handleLogin App.js:153
componentDidMount AuthenticationPage.js:161
React 2
unstable_runWithPriority scheduler.production.min.js:19
React 4
unstable_runWithPriority scheduler.production.min.js:19
React 4
Redux 7
p auth.js:72
promise callback
p/< auth.js:130
r Redux
mediaLibrary.js:247:16
f mediaLibrary.js:247
(Async: promise callback)
f mediaLibrary.js:246
loadMedia mediaLibrary.js:263
Redux 2
componentDidMount MediaLibrary.js:296
React 2
unstable_runWithPriority scheduler.production.min.js:19
React 4
unstable_runWithPriority scheduler.production.min.js:19
React 4
Redux 7
loginUser auth.js:110
(Async: promise callback)
loginUser auth.js:105
Redux 2
handleLogin App.js:153
componentDidMount AuthenticationPage.js:161
React 2
unstable_runWithPriority scheduler.production.min.js:19
React 4
unstable_runWithPriority scheduler.production.min.js:19
React 4
Redux 7
p auth.js:72
(Async: promise callback)
p auth.js:130
r Redux

​Does that help?

Now I can’t signup/login. It says user not found. Could you send out another invite.

Do check your invite only members usage, or you might get billed for no reason. If you’re close to exhausting the limit or to be safe, I suggest following this:

I’ve sent a pw reset to see if that helps. The user email is still there in Identity.

I have used 3 of the 5 emails so can send another if needed.

I got the password reset email and now I can login. However, I am not seeing this error. I was able to login/logout without any issues.

Have you cleared your cache after you modified the service worker, or tried in incognito?