@tsteur opened this Issue on November 25th 2020 Member

see https://forum.matomo.org/t/error-upgrading-db-while-upgrading-to-4-0-0-b1/39478

  • /opt/matomo/core/Updates/4.0.0-b1.php:
    Error trying to execute the migration 'ALTER TABLE matomo_session CHANGE id id VARCHAR(191);'.
    The error was: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'AQBqYXZhLnV0aWwuVHJlZU1h8AEBAW9yZy5hcGFjaGUuY29tbW9ucy5iZWFud...' for key 'PRIMARY'
@tsteur commented on November 25th 2020 Member

Maybe as a workaround we could delete all expired sessions from the table first? This should minimise the risk.

Overall the risk of this happening is quite low because session Ids are usually much shorter unless maybe customised with https://www.php.net/manual/en/session.configuration.php#ini.session.sid-length and the chance of two similar IDs for the first 190 char is quite low. It's actually so low there must have been some other issue there.

Actually better workaround be to update each SessionID... since we now hash the sessionID, we could iterate over each session and update the ID in the table maybe before running this update. The hash would be for sure less than 190 character and maybe it keeps their session alive as a bonus point?

@Findus23 commented on November 26th 2020 Member
This Issue was closed on November 26th 2020
Powered by GitHub Issue Mirror