User Access Token

Summary
Issue with user access token error after migrating to PostgreSQL and upgrading Mattermost.

Steps to reproduce

  1. Start with Mattermost 9.0.0 with MySQL 5.7.36.
  2. Migrate from MySQL 5.7.36 to PostgreSQL 15.12 using the official “Automated PostgreSQL migration” process.
  3. Upgrade Mattermost to version 10.5.1 ESR using the official “Upgrade Mattermost Server” guide.
  4. Login and then logout from the Mattermost web GUI.
  5. Optionally, activate the last Jitsi plugin (v2.0.1) and logout again.

Expected behavior
I expect no errors after logout

Observed behavior
Everything appears to be functioning correctly; however, when i logout of the WEB GUI, i encounter the following error/warning in the log file /opt/mattermost/log/mattermost.log:

{"timestamp":"2025-03-05 12:26:19.422 +01:00","level":"warn","msg":"Error while creating session for user access token","caller":"app/session.go:113","error":"createSessionForUserAccessToken: Invalid or missing token., resource \"UserAccessToken\" not found, id: token=56dm******************gjqgr"}

Additionally, when switch the Jitsi plugin (v2.0.1) to enabled, i encounter the same error after logout. The error repeats twice without any token specified:

{"timestamp":"2025-03-05 12:15:56.640 +01:00","level":"warn","msg":"Error while creating session for user access token","caller":"app/session.go:113","error":"createSessionForUserAccessToken: Invalid or missing token., resource \"UserAccessToken\" not found, id: token="}
{"timestamp":"2025-03-05 12:15:56.640 +01:00","level":"warn","msg":"Error while creating session for user access token","caller":"app/session.go:113","error":"createSessionForUserAccessToken: Invalid or missing token., resource \"UserAccessToken\" not found, id: token="}

Everything else seems to be functioning fine, but the error persists when logging out.
Has anyone encountered a similar issue? Could it be related to the migration or the plugins? Any advice would be greatly appreciated.

Hi @3csys! Thanks for sharing the detailed steps and error logs - this is really helpful in diagnosing the issue. It sounds like the user access token warning might be related to lingering session data or incompatibilities arising from the migration. You may want to review the PostgreSQL Migration Guide and ensure all configurations align with the updated database. Additionally, checking the Mattermost Server Upgrade Guide may help confirm if any steps were missed. If the issue persists, try temporarily disabling the Jitsi plugin to narrow down its impact. Hope this helps!

Hi John Combs,
thanks for your response.
I reviewed the procedures again, and i believe i applied everything correctly. So, I repeated the migration, starting again from version 9.0.0 and executing each step carefully.

Step 1: MySQL 5.7.36 to PostgreSQL 15.12
Everything seems fine since I didn’t encounter any errors during the process.
However, after logging out with an admin account and with all plugins enabled and updated, I get the following error related to the token used by the admin user:

{"timestamp":"2025-03-07 10:30:34.128 +01:00","level":"warn","msg":"Error while creating session for user access token","caller":"app/session.go:113","error":"createSessionForUserAccessToken: Invalid or missing token., resource \"UserAccessToken\" not found, id: token=8dtw******************g3na"}

Step 2: Mattermost 9.0.0 to Mattermost 9.11.9 ESR
I performed the upgrade following the official documentation, started Mattermost, but I encountered the same issue even before reaching version 10.5.1.
After logging out with an admin account and with all plugins enabled and updated, I get the same error again:

{"timestamp":"2025-03-07 10:30:34.128 +01:00","level":"warn","msg":"Error while creating session for user access token","caller":"app/session.go:113","error":"createSessionForUserAccessToken: Invalid or missing token., resource \"UserAccessToken\" not found, id: token=xcq***************eo"}
{"timestamp":"2025-03-07 10:30:35.307 +01:00","level":"warn","msg":"Error while creating session for user access token","caller":"app/session.go:113","error":"createSessionForUserAccessToken: Invalid or missing token., resource \"UserAccessToken\" not found, id: token="}
{"timestamp":"2025-03-07 10:30:35.361 +01:00","level":"warn","msg":"Error while creating session for user access token","caller":"app/session.go:113","error":"createSessionForUserAccessToken: Invalid or missing token., resource \"UserAccessToken\" not found, id: token="}

However, if this message is not critical, I will proceed with the upgrade anyway.

Do you have any insights on this issue?

Thanks!

Thank you for the follow-up and for carefully retracing your steps. Based on the new details, it seems the issue might be arising from how user access tokens are being handled post-migration. It’s possible that token data or configuration is not syncing correctly between MySQL and PostgreSQL during the migration process. Since the error doesn’t seem to affect functionality, it may be safe to proceed with the upgrade, but keeping an eye out for future updates or related fixes in upcoming versions is recommended. Let us know how it goes!

Hi John,

I will proceed with the upgrade as planned and will monitor the situation closely.
Thank you for your insights and support.

Best regards,
Antonello.

1 Like