Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Upgrading SilverStripe

Ask questions about upgrading SilverStripe to the latest version.

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

Problem with Index RecordID_Version


Reply

6 Posts   1333 Views

Avatar
Prot

1 August 2010 at 2:36am (Last edited: 1 August 2010 2:57am), Community Member, 3 Posts

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.

Avatar
prawnstar

5 August 2010 at 11:11am (Last edited: 5 August 2010 2:56pm), Community Member, 116 Posts

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 [url=http://www.silverstripe.org/general-questions/show/285080#post285080]here[/url] 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

Avatar
prawnstar

5 August 2010 at 3:53pm Community Member, 116 Posts

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

Avatar
purplespider

24 August 2010 at 12:22am (Last edited: 24 August 2010 12:23am), Community Member, 81 Posts

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?

Avatar
squared99

24 August 2010 at 2:07pm Community Member, 12 Posts

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

Avatar
Willr

24 August 2010 at 9:14pm Forum Moderator, 5511 Posts

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.