NERC-CEH / fit-count-app

Fit Count App & Website
Apache License 2.0
0 stars 0 forks source link

"Refresh token is invalid" message in FIT Count website logs #182

Closed andrewvanbreda closed 6 months ago

andrewvanbreda commented 7 months ago

@BirenRathod @kazlauskis I am noticing this error in the FIT Count webisite logs (appearing multiple times) I hope this doesn't mean the app is failing from the Drupal 10 website upgrade?

League\OAuth2\Server\Exception\OAuthServerException: The refresh token is invalid. in League\OAuth2\Server\Exception\OAuthServerException::invalidRefreshToken() (line 229 of /code/vendor/league/oauth2-server/src/Exception/OAuthServerException.php).

BirenRathod commented 7 months ago

@andrewvanbreda I noticed too but need confirmation from @kazlauskis if the app is working or not. This could be for any apps not just fitcount as the same module is applied to all websites.

kazlauskis commented 7 months ago

This means that existing user sessions are invalid and users will have to relogin. Not the end of the world, but unlike websites, typically mobile app users don't expect to relogin to the apps. This has happened during another Drupal version upgrade in the past. I am not an expert in this, so I don't know how to prevent it, but maybe when upgrading Drupal, there is something you can do to prevent this.

BirenRathod commented 7 months ago

@kazlauskis Just for info to let you know that there were things happened here. 1. simple_oauth module upgraded 2. Drupal upgraded. so is this the simple cause of the Drupal upgrade or the consequences of both? Also, another upgrade for simple_oauth is pending. I will investigate it.

kazlauskis commented 7 months ago

The last time it happened, I think we have only upgraded the Drupal. It was moved to a new Pantheon deployment then. My guess it could have lost some local temp files or something that the module requires to validate refresh tokens. I am not sure what happened during this upgrade.

kazlauskis commented 7 months ago

OK, I have checked this now more closely and can confirm that when websites are upgraded with new deployments instead of in-place, users have to relogin. @BirenRathod, can we make these Drupal version jumps without creating new parallel Pantheon entries?

On Pantheon, I can see we have brc-ebms and brc-ebms-10, brc-irecord and brc-irecord-10 etc, users have to relogin on all the apps linked to those websites.

BirenRathod commented 7 months ago

@kazlauskis can you give more details about the Drupal version jump bit? I don't understand. The old websites are no longer in use technically as there is no domain linked to them. for e.g. brc-ebms & brc-irecord are no longer in use.

kazlauskis commented 7 months ago

For some reason, if a website is moved to a new Pantheon deployment (site), the simple_oauth module doesn't recognise the current refresh_tokens (user sessions). I am not sure how the migrations are done, but could there be some temporary files that aren't moved or maybe some DB values changed when doing such upgrades?

Can Drupal 9 to Drupal 10 upgrade be done on Pantheon within an existing site? i.e. without creating a new Pantheon deployment.

BirenRathod commented 7 months ago

@kazlauskis I created new upstream for Drupal 10 but it migrated within Pantheon, so I can keep all files & folders structures same.