ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE2.1.4 > 2.2 update error Duplicate key name 'last_activity_idx'

June 22, 2011 2:48pm

Subscribe [11]
  • #1 / Jun 22, 2011 2:48pm

    Rob Allen

    3114 posts

    Hi all

    Just been upgrading my EE dev site from 2.14 to 2.2. After I processed the survey I got an error.

    A Database Error Occurred
    Error Number: 1061
    Duplicate key name ‘last_activity_idx’
    CREATE INDEX last_activity_idx on exp_sessions(last_activity)
    Filename: updates/ud_220.php
    Line Number: 82

    It seems to have upgraded to 2.15 fine. I tried restarting the upgrade but still encounter the error after the licence agreement page.

  • #2 / Jun 22, 2011 4:36pm

    Bransin

    157 posts

    I’m experiencing the same after the terms and agreement. Upgrade is a no go. Jumping from version 2.1.5 to 2.2

    Error Number: 1061

    Duplicate key name ‘last_activity_idx’

    CREATE INDEX last_activity_idx on exp_sessions(last_activity)

    Filename: updates/ud_220.php

    Line Number: 82

  • #3 / Jun 22, 2011 4:55pm

    Bransin

    157 posts

    deleted the existing last_activity_idx index on the exp_sessions - then received

    Error Number: 1060
    Duplicate column name ‘salt’
    ALTER TABLE `exp_members` ADD `salt` VARCHAR(128) DEFAULT ‘’ NOT NULL
    Filename: updates/ud_220.php
    Line Number: 153

    deleted the salt column, then received

    Error Number: 1060
    Duplicate column name ‘remember_me’
    ALTER TABLE `exp_members` ADD `remember_me` VARCHAR(32) DEFAULT ‘’ NOT NULL
    Filename: updates/ud_220.php
    Line Number: 166

    deleted remember_me

    Error Number: 1060
    Duplicate column name ‘caption’
    ALTER TABLE `exp_files` ADD `caption` text
    Filename: updates/ud_220.php
    Line Number: 182

    deleted caption

    Error Number: 1146
    Table ‘my_database.exp_comments’ doesn’t exist
    CREATE INDEX comment_date_idx on exp_comments(comment_date)
    Filename: updates/ud_220.php
    Line Number: 193

    NOOOOOOOOOOO!

  • #4 / Jun 22, 2011 5:10pm

    Bransin

    157 posts

    I didn’t have the comment module installed, so I reverted back and installed it.

    Went through the same thing again with deleting the existing last_activity_idx index.

    Now a new error.

    Fatal error: Call to undefined method stdClass::all_userdata() in /var/www/system/codeigniter/system/libraries/Profiler.php on line 507

  • #5 / Jun 22, 2011 5:36pm

    Brandon Jones

    5500 posts

    That’s curious. Are you following the revised update instructions? It sounds like the updater may be running twice for some reason. Can you try the update with a different browser to see if the behavior is the same?

  • #6 / Jun 22, 2011 5:46pm

    Bransin

    157 posts

    Good news.

    I freshed the page with the PHP error and it sent me right through. Weird. Running 2.2!

  • #7 / Jun 22, 2011 6:02pm

    Rob Allen

    3114 posts

    The comments module isn’t installed on my dev site, whether it is or not shouldn’t really make any difference?

    - have tested in different browsers with the same result
    - am using new update instructions including running from root/admin.php (that’s sneaky!)
    - tried removing ‘last_activity_idx’, update then regenerates it and it follows the same errors as Bransin

    Looks like a fresh install jobby for me? I did’t backup the db by choice as it’s just a test playground though this error doesn’t bode well for live sites even if there is a backup.

  • #8 / Jun 22, 2011 6:04pm

    Rob Allen

    3114 posts

    PS if this update does require the Comments module to be installed surely that should be flagged up in the wizard before the upgrade takes place?

  • #9 / Jun 22, 2011 6:27pm

    Brandon Jones

    5500 posts

    Hi bluedreamer,

    There was an issue with the installer application included with 2.2 earlier today; can you re-download the package and try a fresh installation of that?

  • #10 / Jun 22, 2011 6:52pm

    Rob Allen

    3114 posts

    Downloaded latest about 5 mins ago but still getting the same error :(

  • #11 / Jun 23, 2011 12:13am

    thanhv

    7 posts

    I ran into this problem at work today as well on my wamp environment… first it was errors about duplicate indexes, then it was duplicate columns, then back to indexes… so once i compiled a list of all the errors… i wrote this in mysql:

    ALTER TABLE exp_sessions DROP INDEX last_activity_idx;
    ALTER TABLE exp_members DROP salt;
    ALTER TABLE exp_members DROP remember_me;
    ALTER TABLE exp_files DROP caption;
    ALTER TABLE exp_comments DROP INDEX comment_date_idx;
    ALTER TABLE exp_template_groups DROP INDEX group_name_idx;
    ALTER TABLE exp_template_groups DROP INDEX group_order_idx;

    I ended up with an error with Structure (v3.0.3):

    A Database Error Occurred
    Error Number: 1064
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
    
    SELECT entry_id FROM exp_structure_listings WHERE site_id =
    Filename: C:\wamp\www\control\codeigniter\system\database\DB_driver.php
    Line Number: 330

    At this point, I had to edit sql.structure.php and replaced $this->site_id with 1

    then the errors about duplicate indexes and columns stopped and i ended up with:

    Fatal error: Call to undefined method stdClass::all_userdata() in C:\wamp\www\control\codeigniter\system\libraries\Profiler.php on line 507

    After a refresh, that error was gone and i was on 2.2.0

  • #12 / Jun 23, 2011 5:20pm

    Rob Allen

    3114 posts

    I gave up and did a fresh install 😊

  • #13 / Jun 23, 2011 6:39pm

    Paw Paw

    43 posts

    I’m getting this error too from 2.13 ->2.2

  • #14 / Jun 24, 2011 6:19am

    Lyubov Berezina

    42 posts

    I’m getting this error too from 2.13 ->2.2

    Same here :(

  • #15 / Jun 24, 2011 6:33am

    karlosb

    43 posts

    Not sure if this will help, but its worth checking as this worked for me:

    I had an existing 2.1.3 install.

    The following tables existed in my 2.1.3 install MySQL database:

    exp_files
    exp_files_categories
    exp_files_dimensions
    exp_files_watermarks

    These tables *** do not *** exist in another 2.1.3 install I have for another site.

    I actually deleted these tables and started the upgrade process from scratch and it worked!!! No Database errors!

    Disclaimer: I’m not saying this will work for everyone. But it worked for me.
    If you try it don’t forget to back-up your MySQL database before-hand! 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases