Error while upgrading

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TimES
    Junior Member
    • Jul 2025
    • 3

    #1

    Error while upgrading

    Hi all,
    I have received the following error while running an upgrade:

    ALERT: Rebuild database error: An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '84' for key 'tablespaces.PRIMARY'

    How can I solve that issue?

    Many thanks in advance
    Tim
  • lazovic
    Super Moderator
    • Jan 2022
    • 1109

    #2
    Hi TimES,

    The similar error was discussed here: https://forum.espocrm.com/forum/gene...database-error.

    Comment

    • TimES
      Junior Member
      • Jul 2025
      • 3

      #3
      Originally posted by lazovic
      Hi TimES,

      The similar error was discussed here: https://forum.espocrm.com/forum/gene...database-error.
      Thanks lazovic,
      I had a look into that thread before. However, the difference is that in the error I receive, it's pointing to table 'tablespaces' which is - I assume - either a system generated or a temporary table while rebuilding.
      I also tried a hard rebuild with failing in the same error.

      Any ideas?

      Many thanks and regards
      Tim

      Comment

      • TimES
        Junior Member
        • Jul 2025
        • 3

        #4
        Originally posted by TimES

        Thanks lazovic,
        I had a look into that thread before. However, the difference is that in the error I receive, it's pointing to table 'tablespaces' which is - I assume - either a system generated or a temporary table while rebuilding.
        I also tried a hard rebuild with failing in the same error.

        Any ideas?

        Many thanks and regards
        Tim

        Hi all,

        just an update as I found the root cause and solution for this particular issue:

        Root Cause

        It appears to be a bug in Aurora MySQL 3.05.2, where internal metadata related to tablespaces becomes inconsistent, causing duplicate key errors during operations like TRUNCATE, CREATE TABLE, or schema rebuilds (as in EspoCRM upgrades).

        Solutions
        1. Upgrade Aurora MySQL to version 3.06.0 or later - This version includes a fix for the bug
        2. Workaround (if on Aurora)
          AWS support has suggested:
          • Restart the writer instance twice to clear the cache.
          • If that fails, restore the snapshot and change the Aurora version to 3.06.0.


        Best regards
        Tim

        Comment

        Working...