Seafdav does not work (seafdav.pid problem)

Hey,

I want to use the Webdav component of the Seafile server…
My seafile is located at seafile.example.com
seafile.example.com/seafdav causes Bad Gateway
Looks like there is a problem with the seafdav.pid file…
I already restarted the whole VServer some times and upgraded seafile server to latest version (6.2.3)

seafdav config:
[WEBDAV]
enabled = true
port = 8080
fastcgi = true
share_name = /seafdav

nginx config (only seafdav location):

   location /seafdav {
     fastcgi_pass    127.0.0.1:8080;
     fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
     fastcgi_param   PATH_INFO           $fastcgi_script_name;
     fastcgi_param   SERVER_PROTOCOL     $server_protocol;
     fastcgi_param   QUERY_STRING        $query_string;
     fastcgi_param   REQUEST_METHOD      $request_method;
     fastcgi_param   CONTENT_TYPE        $content_type;
     fastcgi_param   CONTENT_LENGTH      $content_length;
     fastcgi_param   SERVER_ADDR         $server_addr;
     fastcgi_param   SERVER_PORT         $server_port;
     fastcgi_param   SERVER_NAME         $server_name;
     fastcgi_param   HTTPS               on;
     fastcgi_param   HTTP_SCHEME         https;

     client_max_body_size 0;
     proxy_connect_timeout  36000s;
     proxy_read_timeout  36000s;
     proxy_send_timeout  36000s;
     send_timeout  36000s;

     # This option is only available for Nginx >= 1.8.0. See more details below.
     proxy_request_buffering off;

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

seafdav.error log:

2017/12/23 12:29:56 [error] 4751#4751: 7 connect() failed (111: Connection refused) while connecting to upstream, client: 89.245.254.203, server: seafile., request: $
2017/12/23 12:34:33 [error] 4751#4751: *156 upstream sent unsupported FastCGI protocol version: 72 while reading response header from upstream, client: 89.245.254.203,$
2017/12/23 12:34:34 [error] 4751#4751: *156 upstream sent unsupported FastCGI protocol version: 72 while reading response header from upstream, client: 89.245.254.203,$
2017/12/23 12:41:21 [error] 4750#4750: *459 upstream sent unsupported FastCGI protocol version: 72 while reading response header from upstream, client: 89.245.254.203,$
2017/12/23 12:47:43 [error] 4750#4750: *621 upstream sent unsupported FastCGI protocol version: 72 while reading response header from upstream, client: 89.245.254.203,$
2017/12/23 12:56:47 [error] 4750#4750: *828 upstream sent unsupported FastCGI protocol version: 72 while reading response header from upstream, client: 89.245.254.203,$
2017/12/23 12:58:21 [error] 4750#4750: *869 upstream sent unsupported FastCGI protocol version: 72 while reading response header from upstream, client: 89.245.254.203,$

controller log:
[12/23/17 13:00:37] seafile-controller.c(396): pid file /root/haiwen/pids/seafdav.pid does not exist
[12/23/17 13:00:37] seafile-controller.c(422): seafdav need restart…
[12/23/17 13:00:37] seafile-controller.c(73): spawn_process: /usr/bin/python2.7 -m wsgidav.server.run_server runfcgi --log-file /root/haiwen/logs/seafdav.log --pid /ro$
[12/23/17 13:00:37] seafile-controller.c(88): spawned /usr/bin/python2.7, pid 21433
[12/23/17 13:00:47] seafile-controller.c(396): pid file /root/haiwen/pids/seafdav.pid does not exist
[12/23/17 13:00:47] seafile-controller.c(422): seafdav need restart…
[12/23/17 13:00:47] seafile-controller.c(73): spawn_process: /usr/bin/python2.7 -m wsgidav.server.run_server runfcgi --log-file /root/haiwen/logs/seafdav.log --pid /ro$
[12/23/17 13:00:47] seafile-controller.c(88): spawned /usr/bin/python2.7, pid 21528
[12/23/17 13:00:57] seafile-controller.c(396): pid file /root/haiwen/pids/seafdav.pid does not exist
[12/23/17 13:00:57] seafile-controller.c(422): seafdav need restart…
[12/23/17 13:00:57] seafile-controller.c(73): spawn_process: /usr/bin/python2.7 -m wsgidav.server.run_server runfcgi --log-file /root/haiwen/logs/seafdav.log --pid /ro$
[12/23/17 13:00:57] seafile-controller.c(88): spawned /usr/bin/python2.7, pid 21626
[12/23/17 13:01:07] seafile-controller.c(396): pid file /root/haiwen/pids/seafdav.pid does not exist
[12/23/17 13:01:07] seafile-controller.c(422): seafdav need restart…
[12/23/17 13:01:07] seafile-controller.c(73): spawn_process: /usr/bin/python2.7 -m wsgidav.server.run_server runfcgi --log-file /root/haiwen/logs/seafdav.log --pid /ro$
[12/23/17 13:01:07] seafile-controller.c(88): spawned /usr/bin/python2.7, pid 21729
[12/23/17 13:01:17] seafile-controller.c(396): pid file /root/haiwen/pids/seafdav.pid does not exist
[12/23/17 13:01:17] seafile-controller.c(422): seafdav need restart…
[12/23/17 13:01:17] seafile-controller.c(73): spawn_process: /usr/bin/python2.7 -m wsgidav.server.run_server runfcgi --log-file /root/haiwen/logs/seafdav.log --pid /ro$
[12/23/17 13:01:17] seafile-controller.c(88): spawned /usr/bin/python2.7, pid 21802
[12/23/17 13:01:27] seafile-controller.c(396): pid file /root/haiwen/pids/seafdav.pid does not exist
[12/23/17 13:01:27] seafile-controller.c(422): seafdav need restart…
[12/23/17 13:01:27] seafile-controller.c(73): spawn_process: /usr/bin/python2.7 -m wsgidav.server.run_server runfcgi --log-file /root/haiwen/logs/seafdav.log --pid /ro$
[12/23/17 13:01:27] seafile-controller.c(88): spawned /usr/bin/python2.7, pid 21913
[12/23/17 13:01:37] seafile-controller.c(396): pid file /root/haiwen/pids/seafdav.pid does not exist
[12/23/17 13:01:37] seafile-controller.c(422): seafdav need restart…
[12/23/17 13:01:37] seafile-controller.c(73): spawn_process: /usr/bin/python2.7 -m wsgidav.server.run_server runfcgi --log-file /root/haiwen/logs/seafdav.log --pid /ro$
[12/23/17 13:01:37] seafile-controller.c(88): spawned /usr/bin/python2.7, pid 21987

Greetings

I´ve the same issue. It´s also not clear wether to use SeafDav with FastCGI or WSGI.

Seems that this problem is unsolvable…

@CertifiedG and @das_apfel check out this forum link and if you need further help I can post my nginx configuration. On my side seafdav with wsgi working fine with 6.2.3. Froehes neues :wink:

1 Like

Danke, dir auchn frohes Neues.

The issue is actually not related to Nginx but Seafile itself and sadly I´m not aware of any config file variables in order to be able to raise the logging verbosity.
Current log files don´t tell anything … other than it´s restarting the service.

WSGI works just fine. CE manual contains the config.

I have the same problem after upgrading to seafile-server_7.0.5_x86-64.tar.gz coming from seafile-server-6.3.4 (where I hadn’t any webdav problems) - is this problem maybe version specific?

I suppose your WebDAV server does not run. Can you check with
netstat -tulpn
if therer is a service listening on the port you configured in your seafdav.conf?
If there isn’t, post your seafdav.conf here as well as the seafdav.log.
Please also check this: Shutdown your Seafile Server and check the pids folder at ~/pids. If there is still a pids file for seafdav, then delete it, startup your Seafile Server and test WebDAV access.

My fault, following your advice I notied SeafDav is working just fine. I somehow mixed the problem with fuse problems I have and during my investigation for "Unknown erorr" and "Server error" status syncing libraries since Seafile Server CE 7.0.5? I found this topic.

However: I still have the log error Failed to init seahub db: No module named seahub_settings. but maybe this is more related to Seafile 7.0.2, seafdav bug "No module named seahub_settings." - #5 by shady2k.

I am experiencing the same issue on 6.3.13. using standard seafdav.conf with wsgi or fcgi

netstat -tlpn not showing any python process listening on Port 8080

Don’t see any seafdav.log either (makes sense, if the process has never been started)

Anybody have an idea how to debug this? Can someone tell me how to set the correct environment to run

/usr/bin/python2.7 -m wsgidav.server.run_server runfcgi --log-file /data/seafile/logs/seafdav.log --pid /data/seafile/pids/seafdav.pid --port 8080 --host localhost

directly? Maybe that would produce more output than shown in the logs.

  • check the contain of logs/controller.log
  • post your conf/seafdav.conf file

controller.log

[05/14/20 07:27:13] seafile-controller.c(592): pid file /data/seafile/pids/seafdav.pid does not exist
[05/14/20 07:27:13] seafile-controller.c(629): seafdav need restart…
[05/14/20 07:27:13] seafile-controller.c(88): spawn_process: /usr/bin/python2.7 -m wsgidav.server.run_server runfcgi --log-file /data/seafile/logs/seafdav.log --pid /data/seafile/pids/seafdav.pid --port 8080 --host localhost
[05/14/20 07:27:13] seafile-controller.c(103): spawned /usr/bin/python2.7, pid 31583

seafdav.conf

[WEBDAV]
enabled = true
port = 8080
fastcgi = false
share_name = /seafdav

(tried both “fastcgi = true/false”)

Based on your controller.log, I would assume that WebDAV is started and
a.) you should find a seafdav.pid in the /pids folder and
b.) netstat -tulpn should show a python process listingin on port 8080

I just started WebDAV on my server. This is relevant part from the controller log:

[05/14/20 10:27:09] seafile-controller.c(94): spawned seaf-server, pid 7979
[05/14/20 10:27:19] seafile-controller.c(414): pid file /home/seafile/pids/seafdav.pid does not exist
[05/14/20 10:27:19] seafile-controller.c(446): seafdav need restart…
[05/14/20 10:27:19] seafile-controller.c(79): spawn_process: /usr/bin/python3 -m wsgidav.server.server_cli --server gunicorn --root / --log-file /home/seafile/logs/seafdav.log --pid /home/seafile/pids/seafdav.pid --port 8888 --host 0.0.0.0
[05/14/20 10:27:19] seafile-controller.c(94): spawned /usr/bin/python3, pid 8029

There are some variances between yours an mine. Most of which can be explained by me using 7.1.3 on Python 3 and running WebDAV on port 8888 rather than 8080.

What strikes me odd is the bold part

Isn’t this the address WebDAV listens to? So only WebDAV requests from localhost is allowed?

Hi rdb,
thanks for looking into this!

i tried to alter the config to make the server listen on 0.0.0.0:8080

[WEBDAV]
enabled = true
port = 0.0.0.0:8080
fastcgi = false
share_name = /seafdav

the logfile suggests that the setting is accepted:

[05/14/20 08:45:48] seafile-controller.c(103): spawned /usr/bin/python2.7, pid 2315
[05/14/20 08:45:58] seafile-controller.c(592): pid file /data/seafile/pids/seafdav.pid does not exist
[05/14/20 08:45:58] seafile-controller.c(629): seafdav need restart…
[05/14/20 08:45:58] seafile-controller.c(88): spawn_process: /usr/bin/python2.7 -m wsgidav.server.run_server --log-file /data/seafile/logs/seafdav.log --pid /data/seafile/pids/seafdav.pid --port 8080 --host 0.0.0.0
[05/14/20 08:45:58] seafile-controller.c(103): spawned /usr/bin/python2.7, pid 2327
[05/14/20 08:46:08] seafile-controller.c(592): pid file /data/seafile/pids/seafdav.pid does not exist
[05/14/20 08:46:08] seafile-controller.c(629): seafdav need restart…
[05/14/20 08:46:08] seafile-controller.c(88): spawn_process: /usr/bin/python2.7 -m wsgidav.server.run_server --log-file /data/seafile/logs/seafdav.log --pid /data/seafile/pids/seafdav.pid --port 8080 --host 0.0.0.0
[05/14/20 08:46:08] seafile-controller.c(103): spawned /usr/bin/python2.7, pid 2332
[05/14/20 08:46:18] seafile-controller.c(592): pid file /data/seafile/pids/seafdav.pid does not exist
[05/14/20 08:46:18] seafile-controller.c(629): seafdav need restart…
[05/14/20 08:46:18] seafile-controller.c(88): spawn_process: /usr/bin/python2.7 -m wsgidav.server.run_server --log-file /data/seafile/logs/seafdav.log --pid /data/seafile/pids/seafdav.pid --port 8080 --host 0.0.0.0

but still netstat -tlpn not showing anything on port 8080 nor any pid file nor any logfile

How to run /usr/bin/python2.7 -m wsgidav.server.run_server runfcgi --log-file /data/seafile/logs/seafdav.log --pid /data/seafile/pids/seafdav.pid --port 8080 --host localhost directly from cli for debugging?

The thing is - from your controller.lgo

The process is started.

Do you find the process with top?

@rdb having “spawned” in the controller log file is not good. This means that the seafdav process is created again and again, which is confirmed by the @muellefr posted log files.

@muellefr I would double check that the seafdav.pid is writable by seafile user. By doubt, you could delete the pid file.

Absolutely! Sorry, I was mentally so stuck to the first post of the controller log (where there is no spawn every 10 seconds) that I totally overlooked it.

I checked the access rights on the pids folder. Everything seems to be writable by seafile-user. Also all other pid files are there. But seafdav.pid never gets created.

I could imagine this being a python problem. Maybe the best way would really be to run the server from cli, but I am lacking the ability to set the correct environment, to make the webdav-server find all the python modules.

part by part. Do you have the possibility to update Seafile to 7.0.5 (still python2.7) ? I think there were some issues with seafdav.

That’s not complicated, but check my earlier post.