Seahub broken after update to 7.0.4

Hello everyone!

I have a problem with my Seafile server. It’s running an old version (5.0.4) and I want to upgrade it to the latest (7.0.4). Unfortunately, while both Seafile and Seahub seem to start okay, i get a 504 gateway timeout error when opening it in my browser.

I followed the manual on updating the server closely, stopped Seafile and Seahub and ran all the update scripts pertaining to my server version, then restarted Seafile and Seahub. Here is the output of the update scripts:

-------------------------------------------------------------
This script would upgrade your seafile server from 5.0 to 5.1
Press [ENTER] to contiune
-------------------------------------------------------------
 
 
Updating seafile/seahub database ...
 
[INFO] You are using MySQL
[INFO] updating seafile database...
[INFO] updating seahub database...
Done
 
migrating avatars ...
 
Done
 
updating /home/haiwen/seafile-server-latest symbolic link to /home/haiwen/seafile-server-7.0.4 ...
 
 
 
-----------------------------------------------------------------
Upgraded your seafile server successfully.
-----------------------------------------------------------------
 
 
-------------------------------------------------------------
This script would upgrade your seafile server from 5.1 to 6.0
Press [ENTER] to contiune
-------------------------------------------------------------
 
 
Updating seafile/seahub database ...
 
[INFO] You are using MySQL
[INFO] updating seahub database...
Done
 
migrating avatars ...
 
Done
 
updating /home/haiwen/seafile-server-latest symbolic link to /home/haiwen/seafile-server-7.0.4 ...
 
 
 
-----------------------------------------------------------------
Upgraded your seafile server successfully.
-----------------------------------------------------------------
 
 
-------------------------------------------------------------
This script would upgrade your seafile server from 6.0 to 6.1
Press [ENTER] to contiune
-------------------------------------------------------------
 
 
Updating seafile/seahub database ...
 
[INFO] You are using MySQL
[INFO] updating seahub database...
Done
 
migrating avatars ...
 
Done
 
updating /home/haiwen/seafile-server-latest symbolic link to /home/haiwen/seafile-server-7.0.4 ...
 
 
 
-----------------------------------------------------------------
Upgraded your seafile server successfully.
-----------------------------------------------------------------
 
 
-------------------------------------------------------------
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...
[INFO] updating seahub database...
Done
 
migrating avatars ...
 
Done
 
updating /home/haiwen/seafile-server-latest symbolic link to /home/haiwen/seafile-server-7.0.4 ...
 
 
 
-----------------------------------------------------------------
Upgraded your seafile server successfully.
-----------------------------------------------------------------
 
 
-------------------------------------------------------------
This script would upgrade your seafile server from 6.2 to 6.3
Press [ENTER] to contiune
-------------------------------------------------------------
 
 
Updating seafile/seahub database ...
 
[INFO] You are using MySQL
[INFO] updating ccnet database...
[INFO] updating seafile database...
[INFO] updating seahub database...
Done
 
migrating avatars ...
 
Done
 
updating /home/haiwen/seafile-server-latest symbolic link to /home/haiwen/seafile-server-7.0.4 ...
 
 
 
-----------------------------------------------------------------
Upgraded your seafile server successfully.
-----------------------------------------------------------------
 
 
-------------------------------------------------------------
This script would upgrade your seafile server from 6.3 to 7.0
Press [ENTER] to contiune
-------------------------------------------------------------
 
 
Updating seafile/seahub database ...
 
[INFO] You are using MySQL
[INFO] updating ccnet database...
[INFO] updating seafile database...
[INFO] updating seahub database...
[WARNING] Failed to execute sql: (1146, "Table 'seahub-db.TotalStorageStat' doesn't exist")
[WARNING] Failed to execute sql: (1146, "Table 'seahub-db.TotalStorageStat' doesn't exist")
[WARNING] Failed to execute sql: (1146, "Table 'seahub-db.TotalStorageStat' doesn't exist")
[WARNING] Failed to execute sql: (1146, "Table 'seahub-db.TotalStorageStat' doesn't exist")
[WARNING] Failed to execute sql: (1146, "Table 'seahub-db.FileOpsStat' doesn't exist")
[WARNING] Failed to execute sql: (1146, "Table 'seahub-db.FileOpsStat' doesn't exist")
[WARNING] Failed to execute sql: (1146, "Table 'seahub-db.UserActivityStat' doesn't exist")
[WARNING] Failed to execute sql: (1146, "Table 'seahub-db.UserActivityStat' doesn't exist")
[WARNING] Failed to execute sql: (1146, "Table 'seahub-db.UserActivityStat' doesn't exist")
[WARNING] Failed to execute sql: (1146, "Table 'seahub-db.UserActivityStat' doesn't exist")
[WARNING] Failed to execute sql: (1146, "Table 'seahub-db.UserActivityStat' doesn't exist")
[WARNING] Failed to execute sql: (1051, "Unknown table 'seahub-db.UserTrafficStat'")
[WARNING] Failed to execute sql: (1091, "Can't DROP 'profile_profile_contact_email_0975e4bf_uniq'; check that column/key exists")
Done
 
migrating avatars ...
 
Done
 
updating /home/haiwen/seafile-server-latest symbolic link to /home/haiwen/seafile-server-7.0.4 ...
 
 
 
-----------------------------------------------------------------
Upgraded your seafile server successfully.
-----------------------------------------------------------------

hi
there have been a lot of changes between version 5 and version 7 of Seafile.
and from version 6. 2 you have to switch to WSGI mode

 6.2

From 6.2, It is recommended to use WSGI mode for communication between Seahub and Nginx/Apache. Two steps are needed if you'd like to switch to WSGI mode:

1. Change the config file of Nginx/Apache.
2. Restart Seahub with  `./seahub.sh start`  instead of  `./seahub.sh start-fastcgi`

The configuration of Nginx is as following:

```
location / {
         proxy_pass         http://127.0.0.1:8000;
         proxy_set_header   Host $host;
         proxy_set_header   X-Real-IP $remote_addr;
         proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header   X-Forwarded-Host $server_name;
         proxy_read_timeout  1200s;

         # used for view/edit office file via Office Online Server
         client_max_body_size 0;

         access_log      /var/log/nginx/seahub.access.log;
         error_log       /var/log/nginx/seahub.error.log;
    }
```

The configuration of Apache is as following:

```
    # seahub
    SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
    ProxyPass / http://127.0.0.1:8000/
    ProxyPassReverse / http://127.0.0.1:8000/
```

you also have to modify the boot script file to disable fastCGI

/etc/init.d/your -script
.....
# Change the value of fastcgi to true if fastcgi is to be used
fastcgi=false
# Set the port of fastcgi, default is 8000. Change it if you need different.
fastcgi_port=8000
.....

did you make this switch to WSGI mode ?

1 Like

@Cisco is right, there are many important changes, that needs your attention. A good start is to check the Seafile ChangeLogfile for Raspberry Pi, since I made some comments which every release you have to consider. The nginx changes, the seafile comments, etc…

1 Like

I got the same problem

Thank you for all the replies.

Which Apache config file should I add the WSGI lines to, and in which section? I tried adding them to /etc/apache2/apache2.conf and it doesn’t seem to have any effect. I also changed the fastcgi line /etc/init.d/seafile-server to false and even rebooted the machine to be sure everything is restarted and all I get is the same 504 gateway timeout I’ve been getting before.

I also updated all my apt packages and installed certifi idna packages using pip (as recommended in release notes).

You can look here

https://download.seafile.com/published/seafile-manual/deploy/deploy_with_apache.md

How to configure apache.

Okay, I’ve configured Apache according to that guide and also made some modifications to ccnet.conf, but I still get the 504 gateway timeout error in my browser. Is there anything else I can try?

1 Like