Page unavailable

Hi,

I have a some misfunction since I upgraded to 6.1.
My server is under Ubuntu 14.04 and 6.0.9 before upgrade.
I use minorupgrade script and remeber that I forgot to stop seafile before.
Now when creating user the windows didn’t close and didn’t send email.
When removing user I have Page unavailable.
I try to stop the server and launch upgrade script but with error.

If I try to launch upgrade_6.0_6.1 script I have this message:
[ERROR] Failed to execute sql: Duplicate column name ‘permission’

How can i do now to retrieve a clean database?

For information:
File “/media/RAID5/seafile/seafile-server-6.1.1/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/utils.py”, line 64, in execute
return self.cursor.execute(sql, params)
File “/media/RAID5/seafile/seafile-server-6.1.1/seahub/thirdpart/Django-1.8.18-py2.7.egg/django/db/backends/mysql/base.py”, line 124, in execute
return self.cursor.execute(query, args)
File “/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py”, line 174, in execute
self.errorhandler(self, exc, value)
File “/usr/lib/python2.7/dist-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
raise errorclass, errorvalue
ProgrammingError: (1146, “Table ‘seahub-db.admin_log_adminlog’ doesn’t exist”)
2017-07-16 11:46:32,837 [WARNING] django.request:170 get_response Not Found: /favicon.ico

Best

Hi @Cedric_BELPAIRE,

this was correct to use the upgrade script 6.0->6.1. When you execute twice, you’ll get the "duplicate column name 'permision'" issue, because this column is already present in your database. Don’t worry about it. After this upgrade, you don’t need to run the “minor_upgrade” anymore. Minor upgrades are when you update from 6.1.x to 6.1.y or 6.1.z.

Starting from 6.1.0 you should installed before some dependencies to run Seafile. Please refer to this link to see which one. The link is for the ARM architecture but it is the same regarding dependencies. I think this could be the issue that you are suffering now.

Hi !

Many thanks for your answer.
I try to install Pillow and now it is:
sudo pip list | grep -i pillow
Pillow (4.2.1)
python-requests is installed too.
But the problem persist I always have this in Django log:
ProgrammingError: (1146, “Table ‘seahub-db.admin_log_adminlog’ doesn’t exist”)
So it’s seems that a table is missing in the database.

Let me know if something is possible to do the upgrade?

Best,

Cédric;

In which release are you now? have you checked the new symlink created?

Ok, it looks like that the upgrade was not completely performed:

root@hiperborea /home/seafile/seafile-server-6.1.1/upgrade # grep -R adminlog .
./sql/6.1.0/sqlite3/seahub.sql:CREATE TABLE "admin_log_adminlog" ("id" integer NOT NULL PRIMARY KEY AUTOINCREMENT, "email" varchar(254) NOT NULL, "operation" varchar(255) NOT NULL, "detail" text NOT NULL, "datetime" datetime NOT NULL);
./sql/6.1.0/sqlite3/seahub.sql:CREATE INDEX "admin_log_adminlog_0c83f57c" ON "admin_log_adminlog" ("email");
./sql/6.1.0/sqlite3/seahub.sql:CREATE INDEX "admin_log_adminlog_f7235a61" ON "admin_log_adminlog" ("operation");
./sql/6.1.0/mysql/seahub.sql:CREATE TABLE IF NOT EXISTS `admin_log_adminlog` (
./sql/6.1.0/mysql/seahub.sql:  KEY `admin_log_adminlog_0c83f57c` (`email`),
./sql/6.1.0/mysql/seahub.sql:  KEY `admin_log_adminlog_f7235a61` (`operation`)

stop seafile server and upgrade accordingly

I’m in version 6.1.1
Yes the symlink is ok.

I already do this:
[ERROR] Failed to execute sql: Duplicate column name ‘permission’

you should got to 6.0.9 and execute the minor upgrade, therefore you will have the symlink linked to 6.0.9 and not to 6.1.1. Later execute the 6.0->6.1 upgrade script and post the whole error message. Probably it is necessary to manipulate the upgrade script to only upgrade some databases/entries which are not already updated.

Yes I’ve seen that seahub-db is only modify
perhaps I have to do it into mysql?

I have always the error:
[ERROR] Failed to execute sql: Duplicate column name ‘permission’

Here is the show tables results:
±------------------------------------------+
| Tables_in_seahub-db |
±------------------------------------------+
| api2_token |
| api2_tokenv2 |
| avatar_avatar |
| avatar_groupavatar |
| base_clientlogintoken |
| base_commandslastcheck |
| base_devicetoken |
| base_dirfileslastmodifiedinfo |
| base_filecomment |
| base_filecontributors |
| base_filediscuss |
| base_filelastmodifiedinfo |
| base_groupenabledmodule |
| base_innerpubmsg |
| base_innerpubmsgreply |
| base_userenabledmodule |
| base_userlastlogin |
| base_userstarredfiles |
| base_uuidobjidmap |
| captcha_captchastore |
| constance_config |
| contacts_contact |
| django_content_type |
| django_session |
| group_groupmessage |
| group_messageattachment |
| group_messagereply |
| group_publicgroup |
| invitations_invitation |
| message_usermessage |
| message_usermsgattachment |
| message_usermsglastcheck |
| notifications_notification |
| notifications_usernotification |
| options_useroptions |
| organizations_orgmemberquota |
| profile_detailedprofile |
| profile_profile |
| registration_registrationprofile |
| share_anonymousshare |
| share_fileshare |
| share_orgfileshare |
| share_privatefiledirshare |
| share_uploadlinkshare |
| termsandconditions_termsandconditions |
| termsandconditions_usertermsandconditions |
| two_factor_phonedevice |
| two_factor_staticdevice |
| two_factor_statictoken |
| two_factor_totpdevice |
| wiki_groupwiki |
| wiki_personalwiki

check this:

root@hiperborea /home/seafile/seafile-server-6.1.1/upgrade/sql/6.1.0/mysql # cat seahub.sql
ALTER TABLE `share_fileshare` MODIFY token varchar(100);
ALTER TABLE `share_fileshare` ADD COLUMN `permission` varchar(50) NOT NULL DEFAULT 'view_download';
ALTER TABLE `share_uploadlinkshare` MODIFY token varchar(100);

CREATE TABLE IF NOT EXISTS `institutions_institutionquota` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `quota` bigint(20) NOT NULL,
  `institution_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `i_institution_id_2ca7c89373390e2c_fk_institutions_institution_id` (`institution_id`),
  CONSTRAINT `i_institution_id_2ca7c89373390e2c_fk_institutions_institution_id` FOREIGN KEY (`institution_id`) REFERENCES `institutions_institution` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `admin_log_adminlog` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `email` varchar(254) NOT NULL,
  `operation` varchar(255) NOT NULL,
  `detail` longtext NOT NULL,
  `datetime` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `admin_log_adminlog_0c83f57c` (`email`),
  KEY `admin_log_adminlog_f7235a61` (`operation`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

what you don’t have in your database, you should execute it. Usually is the script doing this.

mysql> ALTER TABLE share_fileshare ADD COLUMN permission varchar(50) NOT NULL DEFAULT ‘view_download’;
ERROR 1060 (42S21): Duplicate column name ‘permission’

mysql> DESCRIBE share_fileshare;
±------------±-------------±-----±----±--------------±---------------+
| Field | Type | Null | Key | Default | Extra |
±------------±-------------±-----±----±--------------±---------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| username | varchar(255) | NO | MUL | NULL | |
| repo_id | varchar(36) | NO | MUL | NULL | |
| path | longtext | NO | | NULL | |
| token | varchar(100) | YES | UNI | NULL | |
| ctime | datetime | NO | | NULL | |
| view_cnt | int(11) | NO | | NULL | |
| s_type | varchar(2) | NO | MUL | NULL | |
| password | varchar(128) | YES | | NULL | |
| expire_date | datetime | YES | | NULL | |
| permission | varchar(50) | NO | | view_download | |
±------------±-------------±-----±----±--------------±---------------+

go ahead with the others as well. The one that is repeated, doesn’t matter thus this is already in the database.

mysql> CREATE TABLE IF NOT EXISTS institutions_institutionquota (
-> id int(11) NOT NULL AUTO_INCREMENT,
-> quota bigint(20) NOT NULL,
-> institution_id int(11) NOT NULL,
-> PRIMARY KEY (id),
-> KEY i_institution_id_2ca7c89373390e2c_fk_institutions_institution_id (institution_id),
-> CONSTRAINT i_institution_id_2ca7c89373390e2c_fk_institutions_institution_id FOREIGN KEY (institution_id) REFERENCES institutions_institution (id)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ERROR 1005 (HY000): Can’t create table ‘seahub-db.institutions_institutionquota’ (errno: 150)

mysql> CREATE TABLE IF NOT EXISTS admin_log_adminlog (
-> id int(11) NOT NULL AUTO_INCREMENT,
-> email varchar(254) NOT NULL,
-> operation varchar(255) NOT NULL,
-> detail longtext NOT NULL,
-> datetime datetime NOT NULL,
-> PRIMARY KEY (id),
-> KEY admin_log_adminlog_0c83f57c (email),
-> KEY admin_log_adminlog_f7235a61 (operation)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.06 sec)

I would #comment the seahub.sql lines in this way, one by one until the upgrade script ends properly:

root@hiperborea /home/seafile/seafile-server-6.1.1/upgrade/sql/6.1.0/mysql # cat seahub.sql

#ALTER TABLE `share_fileshare` MODIFY token varchar(100);
#ALTER TABLE `share_fileshare` ADD COLUMN `permission` varchar(50) NOT NULL DEFAULT 'view_download';
#ALTER TABLE `share_uploadlinkshare` MODIFY token varchar(100);
...