After upgrading from 6.2 to 7 I ran update.php and got

DatabaseSchemaObjectExistsException: Table role_permission already exists. in DatabaseSchema->createTable() (line 630 of MySite/public_html/includes/database/schema.inc).

The website encountered an unexpected error. Please try again later.

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] => a69f0d6c547eeb42adad76c477888932 [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 204 of MySite/public_html/includes/session.inc).

Hm .. maybe the database hadn't been finished its update yet?
So I waited for about a quarter of an hour and ran update.php again and got

DatabaseSchemaObjectExistsException: Cannot add index system_list to table system: index already exists. in DatabaseSchema_mysql->addIndex() (line 433 of MySite/public_html/includes/database/mysql/schema.inc).

The website encountered an unexpected error. Please try again later.

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] => a69f0d6c547eeb42adad76c477888932 [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 204 of MySite/public_html/includes/session.inc).

As there is another problem mentioned in this forum that got no replies I did a rollback to 6.2 and the site is running.
Although not version 7, which I regret. I have a couple of Drupal sites to maintain, and don't dare to try an upgrade with the more heavier sites.
Do any of your guys have an idea what might have got wrong?

Comments

isherwood’s picture

I get this upon running /update.php on a fairly simple site.

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] => 4e8d7d6df813958dcffa949e8b946797 [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 204 of /var/www/domains/cabuhs.net/docs/dev4/includes/session.inc).

rwdPhysics’s picture

I am getting a similar error on my 6.20 to 7.0 upgrade.

Only thing unique is that I have this copy of drupal runing in a _dev/ directory off the root of the main site and have pointed to a dev environment database in the settings.php file as well as adding $base_url = 'http://www.sitesactualname.org/_dev';

Error running update.php for the first time:

Error message
DatabaseSchemaObjectExistsException: Table role_permission already exists. in DatabaseSchema->createTable() (line 630 of /home/content/57/3521157/html/_dev/includes/database/schema.inc).
The website encountered an unexpected error. Please try again later.
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] => us8qo82dtl29902kcurptsmkk2 [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 204 of /home/content/57/3521157/html/_dev/includes/session.inc).

I then ran update again and got the following error:

DatabaseSchemaObjectExistsException: Cannot add index system_list to table system: index already exists. in DatabaseSchema_mysql->addIndex() (line 433 of /home/content/57/3521157/html/_dev/includes/database/mysql/schema.inc).
The website encountered an unexpected error. Please try again later.
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] => us8qo82dtl29902kcurptsmkk2 [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 204 of /home/content/57/3521157/html/_dev/includes/session.inc).

I'm not an advanced user, I wish I could offer more diagnostic information..

UPDATE***
After trying the upgrade multiple times, even on the production site on the root, with the same errors, I've decided to give up and do a fresh install of D7 and rebuild my 50ish pages. Fortunately the site wasn't officially launched and no comments or blogs had started yet. I still believe Drupal is the best option and am very thankful to everyone working on the project. Cheers.

Heine’s picture

Did you first follow the instructions in UPGRADE.txt, then ran update.php again?

If so, did the first run of update.php complete succesfully or not? If you need to try again because of a problem during the update, you must reimport the Drupal 6 database again. Update.php cannot reliably restart from a failed db.

ep_nl’s picture

But of course I followed the instructions. I printed them and then perfromed and ack'ed each separate step. :)
The error came straight away at first run of update.php.

I had the site restored from backup, then tried it again, which didn't help.
I restored the backup for a second time and that's the present state, 6.20.
Didn't dare to go over it again.

clarkservices’s picture

I get the exact same errors. I have since restored my live site to 6.20 and created a duplicate site and database to work with while trying to figure this out. So far I have 4 trys and 4 fails... I am no drupal expert so I am trying different things like deleting made up roles I had to see if that made any difference...no luck. I have tried uninstalling all non core modules...still fails with same errors. Clearing the cache in performance...still fails.

Reading through the info on drupal makes me belive I have something installed that isn't clearing from the database...a theme...a module...or who knows what.

I'll keep this thread posted with any uplifting news.

clarkservices’s picture

I am working to try to figure this out for my site. I am also getting this error along with what you have listed:

Notice: date_default_timezone_set() [function.date-default-timezone-set]: Timezone ID '-18000' is invalid in drupal_session_initialize() (line 262 of /path/to/site/includes/session.inc).

Just noticed this evening that when I try to run update.php on my 6.20 test site it doesn't complete nor does it give any errors. It just sits on the screen saying updating (site.com/update.php?op=start&id=33)...so maybe my 6.20 site is already messed.

***update***
got my 6.20 site to make it through update.php, but it didn't help when I tried to update to 7.0...same old errors.

clarkservices’s picture

I had success today upgrading my site, however I still have a lot of issues to resolve before being ready to transfer over to my production site.

I believe the problem I was having was database inconsistencies. I downloaded the schema module and went through my database to repair ALL problems it pointed out. Once I had a clean database the upgrade proceeded as normal. Something was weird at first with the Garland theme after the upgrade. Everything was in one column. I unchecked secondary menu and used the default for logo and favicon and it cleared itself up for some reason.

So far the main thing that didn't migrate was my classified ads (contributed module). I may read through the article pointed out in the UPGRADE.txt document to see if I can figure out how to migrate the contributed module to drupal 7 then try the upgrade again...hopefully that way I won't loose all of the ads. If that is too much trouble I will probably just rebuild the ads manually...not looking forward to that.

clarkservices’s picture

I have tried all different ways to get 6.20 to upgrade to 7.0 with my site and the only way I can even get through the update.php is by going in and deleting the tables role_permissions and date_format_type. Once I do that I make it through the update process but get this huge list of module errors...

The following updates returned messages
user module
Update #7000
• User passwords rehashed to improve security

Update #7002
• Migrated user time zones

taxonomy module
Update #7001
• Failed: DatabaseSchemaObjectExistsException: Cannot rename term_data to taxonomy_term_data: table taxonomy_term_data already exists. in DatabaseSchema_mysql->renameTable() (line 303 of .../includes/database/mysql/schema.inc).

node module
Update #7001
• Failed: DatabaseSchemaObjectExistsException: Cannot rename node_revisions to node_revision: table node_revision already exists. in DatabaseSchema_mysql->renameTable() (line 303 of .../includes/database/mysql/schema.inc).

filter module
Update #7000
• Failed: DatabaseSchemaObjectExistsException: Cannot rename filter_formats to filter_format: table filter_format already exists. in DatabaseSchema_mysql->renameTable() (line 303 of .../includes/database/mysql/schema.inc).

comment module
Update #7002
• Failed: DatabaseSchemaObjectExistsException: Cannot rename comments to comment: table comment already exists. in DatabaseSchema_mysql->renameTable() (line 303 of ../includes/database/mysql/schema.inc).

block module
Update #7002
• Failed: DatabaseSchemaObjectExistsException: Cannot rename blocks to block: table block already exists. in DatabaseSchema_mysql->renameTable() (line 303 of ../includes/database/mysql/schema.inc).

system module
Update #7002
• Failed: DatabaseSchemaObjectExistsException: Table blocked_ips already exists. in DatabaseSchema->createTable() (line 630 of ../includes/database/schema.inc).

contact module
Update #7002
• Failed: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'module' in 'where clause': SELECT 1 AS expression FROM {role_permission} role_permission WHERE ( (rid = :db_condition_placeholder_0) AND (permission = :db_condition_placeholder_1) AND (module = :db_condition_placeholder_2) ) FOR UPDATE; Array ( [:db_condition_placeholder_0] => 2 [:db_condition_placeholder_1] => access user contact forms [:db_condition_placeholder_2] => contact ) in contact_update_7002() (line 128 of ../modules/contact/contact.install).

poll module
Update #7001
• Failed: DatabaseSchemaObjectExistsException: Cannot rename poll_votes to poll_vote: table poll_vote already exists. in DatabaseSchema_mysql->renameTable() (line 303 of ../includes/database/mysql/schema.inc).

forum module
Update #7001
• Failed: DatabaseSchemaObjectExistsException: Table forum_index already exists. in DatabaseSchema->createTable() (line 630 of ../includes/database/schema.inc).

profile module
Update #7001
• Failed: DatabaseSchemaObjectExistsException: Cannot rename profile_fields to profile_field: table profile_field already exists. in DatabaseSchema_mysql->renameTable() (line 303 of ../includes/database/mysql/schema.inc).

tracker module
Update #7000
• Failed: DatabaseSchemaObjectExistsException: Table tracker_node already exists. in DatabaseSchema->createTable() (line 630 of ../includes/database/schema.inc).

after update errors:

• Warning: Cannot modify header information - headers already sent by (output started at ../includes/common.inc:2561) in drupal_send_headers() (line 1040 of ../includes/bootstrap.inc).
• PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'expiration' in 'where clause': DELETE FROM {flood} WHERE (expiration < :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] => 1300273928 ) in system_cron() (line 2972 of ../modules/system/system.module).

hershel’s picture

For role_permissions table issue see: http://drupal.org/node/1009552#comment-4212412

clarkservices’s picture

For me, this issue is probably a database related issue. I downloaded schema for 6.20 and listed out all of the missing tables in my database...I had 66. dropped all that was missing, and managed to make it through the update with no errors, however there are still issues. Apparently I dropped some tables that were needed, like maybe the block...etc.

When I tried to go to Administration-->structure-->blocks, i get the PDO exception again. Not sure If I will be able to fix a database error...Am I stuck with 6.20 from now on?

slimandslam’s picture

+1 I am getting the same error.

J

shawsolution’s picture

Website is giving the following

The website encountered an unexpected error. Please try again later.
Uncaught exception thrown in session handler.

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column &#039;ssid&#039; in &#039;where clause&#039;: 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] =&gt; bda03645e4d868dfadb131a3287ceca4 [:db_condition_placeholder_1] =&gt; ) in _drupal_session_write() (line 204 of /homepages/12/d246879356/htdocs/wsb4947423801/includes/session.inc).

I've tried three times now to upgrade the site. The latest occasion I am certain everything was done perfectly. The only amend has been enabling php5 within the .htcaccess file.

The only item I can think of in my custom modules which might affect the ssid column is Oauth.

Any assistance is greatly appreciated.

shawsolution’s picture

I went through the modules directory and identified the following modules which were not Drupal 7 Compatible.

  • Autoload
  • CSS Gzip
  • JavaScript Aggregator
  • Lightbox2
  • OAuth
  • Twitter

    I rolled back the installed and uninstalled them in the admin menu. I then deleted them from the file system. After this, I removed the 6.20 files and coped the drupal 7 files back across.

    Still getting the following errror.

    
    
    The website encountered an unexpected error. Please try again later.
    Uncaught exception thrown in session handler.
    
    PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column &#039;ssid&#039; in &#039;where clause&#039;: 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] =&gt; bda03645e4d868dfadb131a3287ceca4 [:db_condition_placeholder_1] =&gt; ) in _drupal_session_write() (line 204 of ../includes/session.inc).
    
    

    Going to the root URL returns "The website encountered an unexpected error. Please try again later."

    Going to install install.php returns the following:

    Drupal already installed
    To start over, you must empty your existing database.
    To install to a different database, edit the appropriate settings.php file in the sites folder.
    To upgrade an existing installation, proceed to the update script.
    View your existing site.

  • edg’s picture

    Any ideas how to resolve this error message?

    cvpsmith’s picture

    I've tried several upgrades, and I'm having the exact same issue every time. I've followed Upgrade.txt to the letter. Has ANYONE found a solution for this yet? Apparently, this issue is quite common.

    I'm getting the feeling that D7 is not ready for prime-time...

    Heine’s picture

    The missing ssid column is the consequence of an error early in the Update process. As such it is a symptom that could potentially have many causes.

    In order to solve this we need to know

    - about your system (MySQL, PHP version, use of APC)
    - exactly how the upgrade was attempted,
    - all the error messages seen
    - on what pages the messages appeared
    - if there are any errors in the PHP error log at the time of the update attempt.

    The fastest way to a cause and thus a solution would be for a (core) developer to reproduce . You can help by sending your site's code + database to a (core) developer for debugging.

    I'm willing to attempt this. You can find me on #drupal-contribute.

    shawsolution’s picture

    Heine,

    Thanks, the details are as follows;

    Drupal 6.2
    MySQL: 5.0.91
    PHP: 5.2.17
    I've not enabled APC and I doubt my hosting provider has without my request.

    The update was done exactly as per upgrade.txt with the results as above in my two posts. I've tried it a couple of times, so if tehre was a mistake it would have been caught.

    All user facing error messages listed above in my posts along with location seen.

    I've not got the error logs, as its been about a month and a half since i've attempted this,

    Seb

    Uber_Tiny’s picture

    I get the following:

    DatabaseSchemaObjectExistsException: Cannot add index system_list to table system: index already exists. in DatabaseSchema_mysql->addIndex() (line 433 of /home4/geforcet/public_html/drupaltest/includes/database/mysql/schema.inc).

    I tried to install drupal 7.0 in a test directory using my database from 6.2 and it gave this error immediately when trying to run the update.php. I have yet to find a definitive answer to this issue even on drupals website.

    Is there any way to get the database working right?

    Mishka3366’s picture

    MySQL database 5.1.54
    PHP 5.2.17

    Followed instructions precisely. Was able to restore from backup. Can't upgrade; would be willing to create a new install but can't import CiviCRM data. Which is my sole reason for having the site.

    hershel’s picture

    Why can't you import CiviCRM data? Actually the CiviCRM database (or civicrm_ tables if they're in the same DB as Drupal) are 100% portable. See here: http://wiki.civicrm.org/confluence/display/CRMDOC40/Moving+an+Existing+I...

    a.luiz.n’s picture

    Subscribe

    shawsolution’s picture

    Hi,

    I tried an update again, full normal steps in the upgrade.txt and got an additional error. in addition to the one above, i'm now getting the column not found error, as well as still getting the ssid. Any help appreciated.

    Otherwise, is there an easy way to export my content into a format I can import into a fresh drupal 7 site?

    Error
    Error message
    PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'source' in 'field list': SELECT source FROM {url_alias} WHERE alias = :alias AND language IN (:language, :language_none) ORDER BY language ASC, pid DESC; Array ( [:alias] => node [:language] => en [:language_none] => und ) in drupal_lookup_path() (line 176 of ../includes/path.inc).
    The website encountered an unexpected error. Please try again later.
    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] => 2867f0aaf218ea5746308d800d383e41 [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 203 of ../includes/session.inc).

    shawsolution’s picture

    I've still not managed an upgrade, but I do seem to have found the cause/fix for this issue.

    The issue is the Locale module, which is 'core' which is also why people disabling all the contrib modules doesn't achieve anything.

    During the disabling of the other modules. Disable Locale. Then UNINSTALL locale. Just disabling is not enough.

    Once it is uninstalled, I proceeded with the upgrade successfully. (well, actually, I discovered at some point my DB had not been restored during an upgrade attempt so it is a horrible mix of D6 and D7 tables.....It works in D6 but throws up new errors on D7) but this error is fixed, and if i manually drop tables, i progress, but that a whole different issue.

    a.luiz.n’s picture

    I know it's not the same error, but try this: http://drupal.org/node/1008352#comment-4662854

    It worked for me.

    jeffheaton’s picture

    I get the same error as well. Seems to be a rampant error from this thread. Has anyone found a solution?

    DatabaseSchemaObjectExistsException: Cannot add index system_list to table system: index already exists. in DatabaseSchema_mysql->addIndex() (line 432 of /var/www/alt/dev1/includes/database/mysql/schema.inc).
    The website encountered an unexpected error. Please try again later.
    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] => 3mrp3mgilnjtgc7subapg0ool0 [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 203 of /var/www/alt/dev1/includes/session.inc).

    Frank Ralf’s picture

    Seems to be the same error as reported in the Drupal Core issue queue:
    Database Errors trying to upgrade D6 site to D7

    elmig’s picture

    +1 - same error

    pedrosp’s picture

    Solved.
    Try removing non-standard lines on settings.php for the migration.
    And check several times if settings.php is writable (777) , this status changed during the process

    abe’s picture

    I have gone through this thread and unfortunately, I have not found a reply that fixed my error. Is there a solution out there for migrating content of a d6 site to d7?

    pwhite’s picture

    On the url_alias table in d6 I changed the src and dst fields to varchar - the upgrade would then run successfully.

    Hetta’s picture

    The schema module points out all errors in the D6 database. Fixing those (by adding indexes and/or changing fields to conform to what drupal expects) takes care of various database errors.

    Install schema in D6, fix everything it tells you is not as drupal expects it to be, and THEN try the upgrade.
    http://drupal.org/project/schema

    Piece of cake.