Jump to:

1134 Posts in 1984 Topics by 403 members

Upgrading SilverStripe

SilverStripe Forums » Upgrading SilverStripe » Problem with Index RecordID_Version

Ask questions about upgrading SilverStripe to the latest version.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1272 Views
  • Prot
    Avatar
    Community Member
    3 Posts

    Problem with Index RecordID_Version Link to this post

    After upgrading to 2.4.1 when rebuilding the database every time I get for every one of my page types the following message:

    Index MenuPage_versions.RecordID_Version: changed to unique (RecordID, Version) (from unique (RecordID,Version))

    This happens not only the first run but every time.

    And when saving an existing page in the backend for the first time after the upgrade I get "Error saving content" and the following error in the log:

    [31-Jul-2010 04:16:42] Error at \sapphire\core\model\MySQLDatabase.php line 536: Couldn't run query:
    INSERT INTO "MenuPage_versions" ( .... , 150, 9)

    Duplicate entry '150-9' for key 'RecordID_Version' (http://fd2.deepthought/admin/EditForm)

    When saving it the second time (and all subsequent times) all works fine.

    I'm a little stuck, so any help would be appreciated.

  • prawnstar
    Avatar
    Community Member
    116 Posts

    Re: Problem with Index RecordID_Version Link to this post

    I'm having the same problem from a fresh download of 2.4.1

    I believe it happened after I deleted a controller, then rebuilt the database, then re-instated the controller and tried to rebuild the database again. Now I get the same error over and over.

    EDIT: Every page controller I add, now has the same errors, but pages I added previously don't. Notice the "HomePage" below is fine.

    I tried the suggestion here to rebuild the ClassNames. Which it worked on the Sitetree but not on the Sitetree_Live, see attached pic.

    Does anyone know if this changed in the 2.4.0 to 2.4.1 update?

    # ErrorPage
    # Index ErrorPage_versions.RecordID_Version: changed to unique (RecordID, Version) (from unique (RecordID,Version))
    # RedirectorPage
    # Index RedirectorPage_versions.RecordID_Version: changed to unique (RecordID, Version) (from unique (RecordID,Version))
    # VirtualPage
    # Index VirtualPage_versions.RecordID_Version: changed to unique (RecordID, Version) (from unique (RecordID,Version))
    # FootLink
    # Index FootLink_versions.RecordID_Version: changed to unique (RecordID, Version) (from unique (RecordID,Version))
    # Footer
    # HomePage
    # ThisPage
    # Index ThisPage_versions.RecordID_Version: changed to unique (RecordID, Version) (from unique (RecordID,Version))

    Chris.b

  • prawnstar
    Avatar
    Community Member
    116 Posts

    Re: Problem with Index RecordID_Version Link to this post

    just uploaded a fresh 2.4.0 (just the core files, i left mysite and themes and the database intact) and it solves the issue. well, it doesn't "solve" it, but I can use the sql commands from the previous post and now my errors are gone.

    bug?

    chris.b

  • purplespider
    Avatar
    Community Member
    80 Posts

    Re: Problem with Index RecordID_Version Link to this post

    I am having exactly the same problem, often when saving a page in the CMS it says error, but then works the second time. The error produced is:

    Error: Couldn't run query: INSERT INTO "Page_versions" ("[...]", "RecordID", "Version") VALUES ('0', '0', null, 2, 238) Duplicate entry '2-238' for key 2
    At line 536 in [...]/sapphire/core/model/MySQLDatabase.php

    And I also always get the "Index [...]_versions.RecordID_Version: changed to unique (RecordID, Version) (from unique (RecordID,Version))" when doing a dev/build.

    Has the 2.4.1 bug been identified yet?

  • squared99
    Avatar
    Community Member
    12 Posts

    Re: Problem with Index RecordID_Version Link to this post

    not sure if its identified, this was the only reference Ive found so far.

    But will just throw in my confirmation that I encountered a similar issue and had to revert to 2.4.0.
    Was throwing duplicate errors on product->writeToStage("Stage'); calls in the ecommerce module I use.

    After reverting to 2.4.0, the error was gone

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: Problem with Index RecordID_Version Link to this post

    Sounds like the same as the issue I had recently - http://open.silverstripe.org/ticket/5936.

    I put it down to workflow but something else could be triggering the same issue.

    1272 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.