After upgrading all core and contrib code, disabling non-core modules & themes, I'm getting this during the upgrade process:
WD php: DatabaseSchemaObjectExistsException: Table role_permission already exists. in DatabaseSchema->createTable() (line 652 of [error]
mysitepath/includes/database/schema.inc).

How to proceed?

By the way, my site has been upgraded from d5 to d6 and now to d7.

Comments

zigmoo’s picture

After deleting the role_permission table, I get:
DatabaseSchemaObjectExistsException: Cannot add index system_list to table system: index already exists. in DatabaseSchema_mysql->addIndex() (line 432 of /mydrupalpath/includes/database/mysql/schema.inc)

catch’s picture

Category: bug » support
Priority: Major » Normal

It looks like you're re-trying an update that has already run and failed. This isn't supported and you'll need to restore a backup of the D5 or D6 site then run the update again from there.

zigmoo’s picture

Thanks Catch!

Yes, you're correct. Somehow, what I thought to be my pristine transitional d6 db had been affected by user error: me running the d7-update.php against it.

My REAL error, was forgetting that on a hosted server like mine, mysql_dump is configured to generate dump files that do not DROP THE DATABASE and re-create it, since permissions get in the way. So, I was repeatedly loading my d6 production db (which had no improper tables) dump into my transitional d6 db, all the while NOT CLEARING OUT THE BAD TABLES in the transitional db first!

I finally included this in my scripted update code to drop all tables before I loaded fresh-from-production data:
db=transition_db_name
echo "DROPPING ALL TABLES from target database: '${db}'…"
mysql -u myuser -pmypass ${db} -e "show tables" | grep -v Tables_in | grep -v "+" | gawk '{print "drop table " $1 ";"}' | mysql -u myuser -pmypass $db

My upgrade began to work nicely after this!

dww’s picture

Component: update.module » database update system

I know it's confusing, but "update.module" is for the part of core (added in 6.x) that checks for available updates to your modules and themes (now called the "Update manager" since it can also install/update your code). You're talking about update.php, which is the "database update system" component...

digibrill’s picture

Hi, I have the same problem after many DB reversions and direct copies of the core D7 files. What can it be? What more information do you need? I am going from a successful D6 update to 6.22 from 6.19, but the upgrade has been throwing this error.

digibrill’s picture

Now I am getting this.

Uncaught exception thrown in session handler.

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ssid' in 'where clause': SELECT 1 AS expression FROM {sessions} sessions WHERE ( (sid = :db_condition_placeholder_0) AND (ssid = :db_condition_placeholder_1) ) FOR UPDATE; Array ( [:db_condition_placeholder_0] => nbbk0i6h0f10ltn7qq0c4q74k3 [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 206 of C:\wamp\www\includes\session.inc).

abe’s picture

I too have this error when upgrading from Drupal 6.26 to latest v-7.15.

Searching for this error in drupal.org indicates that this error is common to upgrades, and so far I haven't a solution. I have tried following the instructions from upgrade.txt, even removing all modules and just retaining settings.php file in my D7 site... and problem persists.

Does anyone have a solution for this?

Thanks.

gdd’s picture

Issue summary: View changes

removing server-specific info

diriy’s picture

Version: 7.8 » 7.42
Issue summary: View changes

the issue is still unsolved.
I have the same and no answer. Current core version is 7.42. What should I do in order to avoid this errors?

Version: 7.42 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.