Upgrade 6.1.2 to 6.2.2 fail Mysql

HI,

if i want to upgrade i got follow error.

cloud@MTMCloud:~/MTMCloud/seafile-server-6.2.2$ upgrade/upgrade_6.1_6.2.sh


This script would upgrade your seafile server from 6.1 to 6.2
Press [ENTER] to contiune

Updating seafile/seahub database …

[INFO] You are using MySQL
[INFO] updating ccnet database…
[ERROR] Failed to execute sql: Duplicate column name ‘reference_id’

Failed to upgrade your database

Greetings Mario

I also got this error message while running the upgrade_6.1_6.2.sh. Now I have no idea if seahub.db got upgraded properly or not. In the seafile-server directory v6.1.0-server.tar.gz is present but there is no sign of any v6.2.* (but I suppose there should be).

That means that you already executed the script earlier, therefore “duplicate”.
@Captain_Rage from which release did you upgraded?

From 6.1.2 First the was on sqlite i got an error too. Then i migrate to mysql with the hope that there the update works.

Did the upgrade from Sqlite to MySQL work? I upgraded from 6.1 to 6.2 and i’m currently using Sqlite.
While running 6.2 I tried to switch from Sqlite to MySQL but I encounter the same error.

The migration breaks with “Duplicate column name ‘reference_id’”

yes it worked, i can start the server normaly with 6.1.2

I’ve got the same error, so what to do now? How to solve this issue?

Did you executed the script twice?

yes, i needed to, because i got another SQl error before: which said something like “no such table: sysadmin_extra_userloginlog”.
So i created it like this Seafile server 6.2.0 beta is ready for testing!

Ok, in this case just go to the mysql script and comment the lines that you already had done.

worked for me. cheers

(I commented out the queries in ccnet.sql )

1 Like

Sorry for the late reply. It was either seafile-server version 6.1.1 → 6.2.0, 6.2.0 → 6.2.1 or 6.2.1 → 6.2.2. I might just have rerun the update script uncesdecarily. I created a backup of seahub.db however, and reverted it later. Now I have to assume it got upgraded properly. You can ignore this sidetrack.
Still, I haven’t had much time to try to solve the “502 Bad Gateway” error. I will try to catch up on how it’s going for the others now.

1 Like

Hi there,

I was having the same problem with the upgrade.
I commented out all the line in ccnet.sql.
But I was having after some warning:
/media/RAID5/seafile/seafile-server-6.2.2/upgrade/db_update_helper.py:327: Warning: Table ‘revision_tag_tags’ already exists
cursor.execute(sql)
/media/RAID5/seafile/seafile-server-6.2.2/upgrade/db_update_helper.py:327: Warning: Table ‘revision_tag_revisiontags’ already exists
cursor.execute(sql)
/media/RAID5/seafile/seafile-server-6.2.2/upgrade/db_update_helper.py:327: Warning: Table ‘share_extrasharepermission’ already exists
cursor.execute(sql)
/media/RAID5/seafile/seafile-server-6.2.2/upgrade/db_update_helper.py:327: Warning: Table ‘share_extragroupssharepermission’ already exists
cursor.execute(sql)
/media/RAID5/seafile/seafile-server-6.2.2/upgrade/db_update_helper.py:327: Warning: Table ‘tags_fileuuidmap’ already exists
cursor.execute(sql)
/media/RAID5/seafile/seafile-server-6.2.2/upgrade/db_update_helper.py:327: Warning: Table ‘tags_tags’ already exists
cursor.execute(sql)
/media/RAID5/seafile/seafile-server-6.2.2/upgrade/db_update_helper.py:327: Warning: Table ‘tags_filetag’ already exists
cursor.execute(sql)
/media/RAID5/seafile/seafile-server-6.2.2/upgrade/db_update_helper.py:327: Warning: Table ‘role_permissions_adminrole’ already exists
cursor.execute(sql)
Done

Is there a problem with this?

Best

@Cedric_BELPAIRE when and where do you get this error?

I encountered the same problem when upgrading from 6.1.2 to 6.2.2:
[INFO] updating ccnet database…
[ERROR] Failed to execute sql: Duplicate column name ‘reference_id’
So I have commented all the lines in ccnet.sql and after executing the upgrade script I have these warnings.
But Seafile server is running.
I don’t know if some problems may occurs in the futur.
That’s why I tell you the question before.

Best.

You have commented ccnet.sql but not the seahub.sql. If you look inside seahub.sql you will see that from here come your problem:

CREATE TABLE IF NOT EXISTS `revision_tag_tags` (                                                              
      `id` int(11) NOT NULL AUTO_INCREMENT,                                                                   
      `name` varchar(255) NOT NULL,                                                                           
      PRIMARY KEY (`id`),                                                                                     
      UNIQUE KEY `name` (`name`)                                                                              
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `revision_tag_revisiontags` (                                                      
      `id` int(11) NOT NULL AUTO_INCREMENT,                                                                   
      `repo_id` varchar(36) NOT NULL,                                                                         
      `path` longtext NOT NULL,                                                                               
      `revision_id` varchar(255) NOT NULL,                                                                    
      `tag_id` int(11) NOT NULL,

Thanks, how to check that Database integrity is OK for the new version?

Best.

Its easy, you will get errors on seahub logfiles

Thanks I will check it.
Best.