Infiniroot Blog: We sometimes write, too.

Of course we cannot always share details about our work with customers, but nevertheless it is nice to show our technical achievements and share some of our implemented solutions.

Solve Seahub start problems after Seafile upgrade from 6.2 to 7.0

Published on November 18th 2020


After Seafile was upgraded from 6.2 to 7.0.5, Seahub (the web-interface for Seafile) would not start anymore. In all previous versions, the way to start Seafile and Seahub was the following procedure.

As seafile user launch:

seafile@seafile:~$ /path/to/seafile/seafile.sh start
seafile@seafile:~$ /path/to/seafile/seahub.sh start-fastcgi

Since the upgrade to 7.0.5 Seahub would not start anymore and fail with the following error:

seafile@seafile:~$ /path/to/seafile/seahub.sh start-fastcgi

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub (fastcgi) at 127.0.0.1:8000 ...

Warning: File comment has changed since version 6.3, while table `base_filecomment` is not migrated yet, please consider migrate it according to v6.3.0 release note, otherwise the file comment feature will not work correctly.

Unknown command: 'runfcgi'
Type 'manage.py help' for usage.
Error:Seahub failed to start.

The warning mistakenly leads to believe that there was a problem due to the upgrade, although all the upgrade scripts were executed successfully.

Seahub no longer runs in FastCGI mode

The reason is actually that Seahub no longer supports to be run as a fastcgi application. A hint can be found in Seahub's public repository in issue #4197 and an "official" information can be found in the updated Seafile documentation for Nginx, where it states:

If you are using [FastCGI](http://en.wikipedia.org/wiki/FastCGI), which is not recommended [...]

In previous versions, all documentation always mentioned to run Seahub in FastCGI mode.

Adjust Nginx config and start Seahub without FastCGI

Obviously this requires changes in the Nginx config. The fastcgi parameters for the / location are gone and need to be replaced by proxy parameters:

    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;


        client_max_body_size 0;

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

The /seafhttp location configuration remains the same (always has been using proxy_pass).

After this, Seahub can be started without the fastcgi parameter:

seafile@seafile:~$ /path/to/seafile/seahub.sh start

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub at port 8000 ...

Seahub is started

Done.

Upgrade issues with Seafile 7.1

Running into issues after upgrading Seafile to 7.1? Read the follow-up article Seafile upgrade and Seahub start errors after upgrading from Seafile 7.0 to 7.1.

Hosted Seafile server in Switzerland

If you are looking for hosted Seafile server in Switzerland, check out the Private File Cloud Server offer at Infiniroot!