[SOLVED] 7.0.5 CE to 7.1.2 CE Upgrade Gives WebDAV 502 Error

7.0.5 CE to 7.1.2 CE Upgrade Gives WebDAV 502

I just upgraded a working 7.0.5 CE Ubuntu 18/Nginx server to 7.1.2 CE. Everything works except WebDAV which gives a 502 - Bad Gateway - in a browser and “Could not connect to server” by a previously working WebDAV client.

In the process of the upgrade I removed the WebDAV fastcgi location in Nginx (“After Seafile 7.1.x, Seafdav does not support Fastcgi, only Wsgi.”) and replaced it with the sample code found in the upgrade notes.

location /seafdav {

    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_set_header   X-Forwarded-Proto $scheme;
    proxy_read_timeout  1200s;

    client_max_body_size 0;

    access_log      /var/log/nginx/seafdav.access.log seafileformat;
    error_log       /var/log/nginx/seafdav.error.log;


This obviously did not work. Comparing and substituting the similar seafdav block found in the CE Manual also did not work.

Seafile’s configuration file seafdav.conf reads (toggled fastcgi false):

enabled = true
port = 8080
host =
fastcgi = false
share_name = /seafdav

I was using port 8080 previously so no changes in ports have taken place or were required.

Presently I am not seeing anything using port 8080 (netstat -tulpen) when I start the server.

As an example, when I try to access the WebDAV server using a browser the error log shows:

2020/03/22 18:47:13 [error] 1269#1269: *159 connect() failed (111: Connection refused) while connecting to upstream, client:, server: host.ddns.net, request: “GET /seafdav HTTP/2.0”, upstream: “”, host: “host.ddns.net

Similarly, the access log shows for the same event: - - [22/Mar/2020:18:47:13 -0600] “GET /seafdav HTTP/2.0” 502 166 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:74.0) Gecko/20100101 Firefox/74.0”

I’m at a loss to explain this failure despite going through all the posts on WebDAV, 7.1 upgrades and 502 errors.

Does anyone have a suggestion on where to look next?

Is it possible the WSGI itself is somehow the issue? If so, how do I check that?


The Seafile Controller log has this recurring entry regarding the seafdav process and pid. It appears that seafdav never launches. No seafdav.pid file appears in the pids folder.

[03/22/20 22:33:05] seafile-controller.c(414): pid file /home/seafile/seafile-server/pids/seafdav.pid does not exist
[03/22/20 22:33:05] seafile-controller.c(446): seafdav need restart…
[03/22/20 22:33:05] seafile-controller.c(79): spawn_process: /usr/bin/python3 -m wsgidav.server.server_cli --server gunicorn --root / --log-file /home/seafile/seafile-server/logs/seafdav.log --pid /home/seafile/seafile-server/pids/seafdav.pid --port 8080 --host
[03/22/20 22:33:05] seafile-controller.c(94): spawned /usr/bin/python3, pid 8840


WsgiDAV (3.0.2)

-Thank you

Looking back over all the posts on WebDAV 502 errors I decided to check that all the software dependencies were met for the upgrade to 7.1.2.

The Manual specifically calls out

pip3 install --timeout=3600 Pillow pylibmc captcha jinja2 sqlalchemy psd-tools django-pylibmc django-simple-captcha python3-ldap

For those who come after it might be worth mentioning that pip3 might need to be installed in your system too.

sudo apt install python3-pip

You can check if it’s installed and its version using:

pip3 -V

@Jonathan warns against installing WSGI manually (‘pip3 install wsgidav’) but you can check for it using

pip3 list

I made the mistake of installing wsgidav from the command line, however. Once I ran

pip3 install --timeout=3600 Pillow pylibmc captcha jinja2 sqlalchemy psd-tools
django-pylibmc django-simple-captcha python3-ldap

a second time, as suggested in the Manual, the problem corrected and I finally got WebDAV to run. It seems to be working again.

As a side note, I received no errors or warnings about software dependencies from the upgrade script when updating to 7.1.2.