upgrade from karmic to lucid breaks drupal tables - some fields must be manually changed to autoincrement

Bug #607045 reported by Bryce Harrington
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
drupal6 (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

Binary package hint: drupal6

I upgraded my webserver from karmic to lucid and drupal got upgraded from 5 to 6.

Unfortunately, this broke my blog; I could still view stories and contents, but inserting new ones was problematic. I could create one new blog entry, but this got entered as nid=0. Subsequent entries also tried to insert as nid=0 and failed as a duplicate entry. Same thing with adding comments or users. For example:

user warning: Duplicate entry '0' for key 'PRIMARY' query: INSERT INTO users (name, mail, timezone, pass, init, status, created) VALUES ('nigelbabu', '<email address hidden>', 19800, '57faa81edaf93dcd7839c05905f293d4', '<email address hidden>', 1, 1279502361) in /usr/share/drupal6/modules/user/user.module on line 327.
Error saving user account.

It turned out the problem was that the database tables after upgrade lacked the *id values as being set to autoincrement.

[Workaround]
select max(uid) from users;
> 368
alter table `users` AUTO_INCREMENT = 369;
alter table `users` change `uid` `uid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ;

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Per the Drupal upgrade instructions, I believe if you hit the update.php script, this won't occur, as it will do any schema updates necessary for a major upgrade.

The appropriate thing would be for the drupal installation process to inform you, the user, of the need to do just that.

Marking Triaged as I believe a developer can add this message fairly easily.

Marking Medium, as this will affect anybody upgrading from karmic to lucid.

Changed in drupal6 (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
status: Confirmed → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.