Seafdav not working

Ok, a little further this time :slight_smile:
Still not working thouh.

$ pip2 install --upgrade WsgiDAV

> Collecting WsgiDAV
>   Using cached WsgiDAV-2.3.0-py2.py3-none-any.whl
> Collecting defusedxml (from WsgiDAV)
>   Downloading defusedxml-0.5.0-py2.py3-none-any.whl
> Installing collected packages: defusedxml, WsgiDAV
> Successfully installed WsgiDAV-2.3.0 defusedxml-0.5.0

$ pip2 list --format columns

Package           Version
----------------- -------
appdirs           1.4.3  
asn1crypto        0.24.0 
attrs             17.4.0 
Automat           0.6.0  
Babel             2.5.3  
bcrypt            3.1.4  
Beaker            1.8.1  
cffi              1.11.5 
chardet           3.0.4  
Cheetah           2.4.4  
click             6.7    
constantly        15.1.0 
cryptography      2.2.2  
defusedxml        0.5.0  
duplicity         0.7.17 
ecdsa             0.13   
enum34            1.1.6  
fasteners         0.14.1 
flup              1.0.2  
hyperlink         18.0.0 
idna              2.6    
incremental       17.5.0 
ipaddress         1.0.19 
lockfile          0.12.2 
lxml              4.2.1  
Mako              1.0.7  
Markdown          2.6.11 
MarkupSafe        1.0    
mercurial         4.5.3  
monotonic         1.4    
MySQL-python      1.2.5  
olefile           0.45.1 
packaging         16.8   
paramiko          2.4.1  
Pillow            5.0.0  
pip               9.0.3  
ply               3.11   
pyasn1            0.4.2  
pyasn1-modules    0.2.1  
pycairo           1.16.3 
pycparser         2.18   
pycrypto          2.6.1  
PyNaCl            1.2.1  
pyOpenSSL         17.5.0 
pyparsing         2.2.0  
python-dateutil   2.7.2  
python-ldap       3.0.0  
python-libtorrent 1.1.6  
python-memcached  1.58   
pytz              2018.3 
pyxdg             0.25   
requests          2.18.4 
sabyenc           3.3.2  
service-identity  17.0.0 
setuptools        39.0.1 
simplejson        3.13.2 
six               1.11.0 
team              1.0    
Twisted           17.9.0 
urllib3           1.22   
virtualenv        15.1.0 
web.py            0.37   
WsgiDAV           2.3.0  
yenc              0.4.0  
zope.interface    4.4.3  

$ ls /usr/lib/python2.7/site-packages/wsgidav/

addons dav_error.pyc (.......)

$ tail -f controller.log

[04/12/18 05:30:23] seafile-controller.c(87): spawn_process: /usr/bin/python2.7 -m wsgidav.server.run_server --log-file /srv/seafile/cal/logs/seafdav.log --pid /srv/seafile/cal/pids/seafdav.pid --port 8083 --host localhost
[04/12/18 05:30:23] seafile-controller.c(102): spawned /usr/bin/python2.7, pid 3191
[04/12/18 05:30:33] seafile-controller.c(575): pid file /srv/seafile/cal/pids/seafdav.pid does not exist
[04/12/18 05:30:33] seafile-controller.c(606): seafdav need restart...

$ /usr/bin/python2.7 -m wsgidav.server.run_server --log-file /srv/seafile/cal/logs/seafdav.log --pid /srv/seafile/cal/pids/seafdav.pid --port 8083 --host localhost

usage: wsgidav [-h] [-p PORT] [-H HOST] [-r ROOT_PATH]
               [--server {cheroot,cherrypy-wsgiserver,ext-wsgiutils,flup-fcgi,flup-fcgi-fork,paste,wsgiref}]
               [--ssl-adapter {builtin,pyopenssl}] [-v] [-q] [-c CONFIG_FILE]
               [--no-config] [-V]
wsgidav: error: unrecognized arguments: --log-file /srv/seafile/cal/logs/seafdav.log --pid /srv/seafile/cal/pids/seafdav.pid

Oh no, now I’m nowing it! It’s the same problem I often have with yaourt. Somewhere in the script a the command is python. On a normal server OS, e.g. Debian and CentOS, python 2.7 will appear. But on Arch python 3.6 will appear. You have to make something with the alias command and put itin your .bashrc.

We are one step closer… But, if I can recall correctly, you can’t use Python arguments and script arguments at the same time from the command line. The arguments for Python have to be parsed into a file. I think it’s called sys.argv, but I don’t remember right off hand.

The problem is, the process is spawning. Then, it’s dying for some strange reason. At least this time, the error is different. Try to run seafdav, then check the controller log for the pid. Then, ps -auxww | grep

Example based on your last controller log you posted: ps -auxww | grep 3191

If that process is running, but the PID file can’t be found, then the problem lies with the file not being generated for some odd reason.

After several tries I caugth one execution, but the next second it was gone…

It is aborting for some reason but it’s not logging the error (?).

$ ps -ef | grep tail -1 controller.log | grep ", pid" | awk -F "pid " '{ print $2}'

seafile   5466  1535  0 21:32 ?        00:00:00 /usr/bin/python2.7 -m wsgidav.server.run_server --log-file /srv/seafile/cal/logs/seafdav.log --pid /srv/seafile/cal/pids/seafdav.pid --port 8083 --host localhost
seafile   5468   440  0 21:32 pts/0    00:00:00 grep 5466

$ ps -ef | grep tail -1 controller.log | grep ", pid" | awk -F "pid " '{ print $2}'

seafile 5484 440 0 21:32 pts/0 00:00:00 grep 5466

Check the system log for that time period and see if there is a clue as to why the process aborts.

Thanks for all your help.

I turned off webdav :frowning:

Will try again in a future version

I stopped using WebDav a while back, especially once SeaDrive was released.

I think it’s an typically Arch problem. I like Arch, too, but I would never use it for Server. You should change to another OS or put Seafile into a debian container.

Debian is also my vote. It’s been rock solid for me for several years now.

1 Like

Can I resurrect this thread?

I am having the same issue. I have also been upgrading to the latest version of Seafile and removing FCGI from my existing config, all so that I can get WebDAV to run (specifically, so I can point a number of iOS apps to use my privately hosted WebDAV rather than a public cloud service).

Reading through this thread, I was having the same issues, though I am running on Ubuntu. Having installed pip install --upgrade WsgiDAV I now have v2.3.0. I have changed the apache and seafdav.conf config files to use port 8089 as I know its not in use.

Restarting this, I now have:

$ ps -auxww | grep seafdav
user 31218 0.0 0.2 788284 19872 ? Sl 21:36 0:00 /usr/bin/python2.7 -m wsgidav.server.run_server --log-file /mnt/data/SeafileFiles/logs/seafdav.log --pid /mnt/data/SeafileFiles/pids/seafdav.pid --port 8089 --host 127.0.0.1
user 31534 0.0 0.0 12952 976 pts/0 S+ 21:52 0:00 grep --color=auto seafdav

However, nothing is being written to seafdav.log.

I am using the iOS Transmit app to test access to the WebDAV site. I presume I should be using the HTTPS option, host URL is my external Seafile website address and port is 443. I have tried my new 8089 port as well, which also fails.

Your problem is not the same as the original poster. He would run it and it would terminate nearly immediately after running it, and the PID would disappear from the process list. Yours appears to be running.

Are you getting errors anywhere? Are you using NGinx/Apache? What are the symptoms of your problem?

Did you change your seafdav.conf file to set fastcgi to false? What about your NGinx/Apache config? Do you see any fastcgi entries anywhere in there?

I just noticed that you are the same person from another thread… lol… So, I know a little more about your setup. So, we just need to find what behaviors you are getting with Seafdav.

My apologies if it is a different issue.

I am using Apache. The main Seafile server is running. I can log in via the browser and Mac app, and tested uploading and moving some files, so presuming all functionality is ok.

I get “Unable to connect to the server” error message using Documents on iOS and “Could not connect to server …” with iOS Transmit.

Contents of seafdav.conf;

[WEBDAV]
host = 127.0.0.1
enabled = true
port = 8089
fastcgi = false
share_name = /seafdav

In logs/seahub_django_request.log, I see these errors repeated:

2018-04-21 20:47:15,596 [WARNING] django.request:170 get_response Not Found: /seafdav/

Can you post your Apache config here, please?

Hi there,

I’ve been following this thread since it started. I’m having the exact same problem as @paapereira
I’ve been able to replicate everything done is this thread - controller.log says it spawns a pid but nothing is logged to seafdav.log. If anyone has any suggestions, I’ll be following this thread as I need WebDav support for my phone.

[04/21/18 21:49:19] seafile-controller.c(566): shutting down ccnet-server ...
[04/21/18 21:49:22] seafile-controller.c(154): starting ccnet-server ...
[04/21/18 21:49:22] seafile-controller.c(73): spawn_process: ccnet-server -F /var/www/html/conf -c /var/www/html/ccnet -f /var/www/html/logs/ccnet.log -d -P /var/www/html/pids/ccnet.pid
[04/21/18 21:49:22] seafile-controller.c(88): spawned ccnet-server, pid 4315
[04/21/18 21:49:23] seafile-controller.c(555): ccnet daemon connected.
[04/21/18 21:49:23] seafile-controller.c(186): starting seaf-server ...
[04/21/18 21:49:23] seafile-controller.c(73): spawn_process: seaf-server -F /var/www/html/conf -c /var/www/html/ccnet -d /backend/vault/seafile-data -l /var/www/html/logs/seafile.log -P /var/www/html/pids/seaf-server.pid
[04/21/18 21:49:23] seafile-controller.c(88): spawned seaf-server, pid 4319
[04/21/18 21:49:23] seafile-controller.c(528): seafdav not enabled.
[04/21/18 21:50:17] seafile-controller.c(566): shutting down ccnet-server ...
[04/21/18 21:50:21] seafile-controller.c(154): starting ccnet-server ...
[04/21/18 21:50:21] seafile-controller.c(73): spawn_process: ccnet-server -F /var/www/html/conf -c /var/www/html/ccnet -f /var/www/html/logs/ccnet.log -d -P /var/www/html/pids/ccnet.pid
[04/21/18 21:50:21] seafile-controller.c(88): spawned ccnet-server, pid 4401
[04/21/18 21:50:22] seafile-controller.c(555): ccnet daemon connected.
[04/21/18 21:50:22] seafile-controller.c(186): starting seaf-server ...
[04/21/18 21:50:22] seafile-controller.c(73): spawn_process: seaf-server -F /var/www/html/conf -c /var/www/html/ccnet -d /backend/vault/seafile-data -l /var/www/html/logs/seafile.log -P /var/www/html/pids/seaf-server.pid
[04/21/18 21:50:22] seafile-controller.c(88): spawned seaf-server, pid 4405
[04/21/18 21:50:22] seafile-controller.c(396): pid file /var/www/html/pids/seafdav.pid does not exist
[04/21/18 21:50:22] seafile-controller.c(73): spawn_process: /usr/bin/python2.7 -m wsgidav.server.run_server runfcgi --log-file /var/www/html/logs/seafdav.log --pid /var/www/html/pids/seafdav.pid --port 8080 --host localhost
[04/21/18 21:50:22] seafile-controller.c(88): spawned /usr/bin/python2.7, pid 4406

Which OS are you using? I think @paapereira’s problem is caused how Arch works with python.

Hey @bionade24
I’m running CentOS 7.4.1708.
I did read your reply above, and as it happens I’m running python 2.7.5. Unfortunately it seems to kill your CentOS py 2.7 theory :confused:

Can you post your nginx/Apache configs?

server{
    listen 80;
    server_name vault.ExcludedDomain.xyz;
    rewrite ^ https://$http_host$request_uri? permanent;
    proxy_set_header X-Forwarded-For $remote_addr;
    }
 server {
    listen 443 ssl http2;
    ssl on;
    ssl_certificate /etc/ssl/private/ssl-bundle.crt;
    ssl_certificate_key /etc/ssl/private/vault_ExcludedDomain_xyz.key;
    server_name vault.ExcludedDomain.xyz;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    add_header   Strict-Transport-Security "max-age=31536000; includeSubdomains";
    add_header   X-Content-Type-Options nosniff;
    add_header   X-Frame-Options DENY;
    ssl_session_cache shared:SSL:10m;
    ssl_ciphers  "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH !RC4";
    ssl_prefer_server_ciphers   on;

    fastcgi_param   HTTPS               on;
    fastcgi_param   HTTP_SCHEME         https;

  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;
  }

  location / {
        fastcgi_pass    127.0.0.1:8000;
        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   REMOTE_ADDR         $remote_addr;

        access_log      /var/log/nginx/seahub.access.log;
        error_log       /var/log/nginx/seahub.error.log;
        fastcgi_read_timeout 36000;
        client_max_body_size 0;
    }

    location /seafhttp {
        rewrite ^/seafhttp(.*)$ $1 break;
        proxy_pass http://127.0.0.1:8082;
        client_max_body_size 0;
        proxy_connect_timeout  36000s;
        proxy_read_timeout  36000s;
        proxy_send_timeout  36000s;
        send_timeout  36000s;
        proxy_request_buffering off;
    }

    location /media {
        root /var/www/html/seafile-server-latest/seahub;
    }

}

Ok, you have to change to proxy_pass and disable fastcgi. Then you could try it another time. https://manual.seafile.com/deploy/deploy_with_nginx.html

1 Like