DB Upgrade from 6.2.5 to 6.3.1 failed

Hello

While upgrading Seafile Community Server from 6.2.5 to 6.3.1 the following error occurred:

    Updating seafile/seahub database ...

        [INFO] You are using MySQL
        [INFO] updating ccnet database...
        [INFO] updating seafile database...
        [INFO] updating seahub database...
        [INFO] updating seafevents database...
        Traceback (most recent call last):
          File "/home/seafile/HomeCloud/seafile-server-6.3.1/upgrade/db_update_helper.py", line 392, in <module>
            main()
          File "/home/seafile/HomeCloud/seafile-server-6.3.1/upgrade/db_update_helper.py", line 387, in main
            db_updater.update_db()
          File "/home/seafile/HomeCloud/seafile-server-6.3.1/upgrade/db_update_helper.py", line 124, in update_db
            self.update_seafevents_sql(seafevents_sql)
          File "/home/seafile/HomeCloud/seafile-server-6.3.1/upgrade/db_update_helper.py", line 321, in update_seafevents_sql
            self.apply_sqls(self.seahub_db_info, seahub_sql)
        NameError: global name 'seahub_sql' is not defined

     Failed to upgrade your database

I found the relevant part in the code file db_update_helper.py, around line 321:

 def update_seafevents_sql(self, seafevents_sql):
        if self.is_pro(self.seahub_db_info):
            Utils.info('updating seafevents database...')
            self.apply_sqls(self.seahub_db_info, seahub_sql)

You use ‘seahub_sql’, although ‘seafevents_sql’ has been given as a parameter.

My question is now:
Is there a way for me to bring my server back into a working state?
Or will I need to play back a backup of my database?

This would be great to know.

Thank you
Best Regards

Okay, I replayed my backup, because I need the system up and running.
After fixing the bug in the code mentioned above, I gave it another shot and retried an upgrade.
Then I got the following error:

[INFO] You are using MySQL
[INFO] updating ccnet database...
[INFO] updating seafile database...
[INFO] updating seahub database...
[INFO] updating seafevents database...
[ERROR] Failed to execute sql: Duplicate key name 'ix_event_timestamp'

This is for you as a feedback, I will stop upgrading here and stay with 6.2.5.

Thank you anyway, your product is still a great tool to work with.

Best regards

Normally these statements will not be executed. Have you ever run the pro edition then switched back to community edition?

Hello Daniel

Thank you for your fast response.
Yes, I have run the pro edition with 3 users, but switched back to community edition.
The machine I run the Seafile server on was upgraded to Ubuntu 18.04 and I wanted to reduce the amount of necessary software (to avoid compatibility issues). So I switched back to community edition and removed java runtime environment from the server. The features of community edition are enough for me.

Do you see a possibility how I can fix this?
Community server on 6.2.5 works fine, so this has not to be fixed soon.

Thank you in advance.

The next release will fix the issue and make upgrade possible.