stonemaster / docker-seafile-server

Provides ready to use seafile Docker installation using SQLite
Boost Software License 1.0
8 stars 5 forks source link

Upgrade from 6.0 to 6.2 fails #4

Closed stonemaster closed 6 years ago

stonemaster commented 6 years ago

Upgrade from a 6.0 container fails:

seafile              | Traceback (most recent call last):
seafile              |   File "/seafile/seafile-server-6.2.3/upgrade/db_update_helper.py", line 363, in <module>
seafile              | [INFO] You are using SQLite3
seafile              | [INFO] updating seahub database...
seafile              |     main()
seafile              |   File "/seafile/seafile-server-6.2.3/upgrade/db_update_helper.py", line 358, in main
seafile              |     db_updater.update_db()
seafile              |   File "/seafile/seafile-server-6.2.3/upgrade/db_update_helper.py", line 259, in update_db
seafile              |     super(SQLiteDBUpdater, self).update_db()
seafile              |   File "/seafile/seafile-server-6.2.3/upgrade/db_update_helper.py", line 120, in update_db
seafile              |     self.update_seahub_sql(seahub_sql)
seafile              |   File "/seafile/seafile-server-6.2.3/upgrade/db_update_helper.py", line 283, in update_seahub_sql
seafile              |     self.apply_sqls(self.seahub_db, sql_path)
seafile              |   File "/seafile/seafile-server-6.2.3/upgrade/db_update_helper.py", line 273, in apply_sqls
seafile              |     conn.execute(line)
seafile              | sqlite3.OperationalError: duplicate column name: permission

Looks like an upstream bug. Current workaround is to use the stonemaster/docker-seafile-server:6.0 container until this is resolved or re-upload data.

stonemaster commented 6 years ago

Unfortunately I dind't find a cause why this is happening. Couldn't reproduce it in a clean container. What I did is to start the container with bash as command line and executed the upgrade scripts in /seafile/seafile-server-latest/upgrade/ manually, while removing the offending lines in /seafile/seafile-server-latest/upgrade/sql/sqlite until everything passed. Then I changed the /data/seafile_version file's contents to 6.2 to prevent upgrade scripts with next start. Don't forget to run the following commands after the container starts with bash as entry point:

rm -rfv /seafile/seahub-data /seafile/seafile-data /seafile/seahub.db \
   /seafile/ccnet
ln -s /data/seahub-data /seafile
ln -s /data/seahub.db /seafile
ln -s /data/seafile-data /seafile
ln -s /data/ccnet /seafile/ccnet

This sets up the links to the host mount. Sorry about that. The current Travis build will tests upgrades in future.