Seafdav not working

I’m having problems accessing the seafile via webdav.
“Sorry, but the requested page could not be found.”

It was working and for some reason it isn’t working anymore and I can’t figure out why.

I’m in Arch Linux with seafile-pro-server_6.2.9_x86-64.tar.gz installed mannually as in the manual.
I use mysql and Apache with SSL.

Here’s my logs and configuration files.

$ tail -f ccnet.log
[03/20/18 21:28:07] ../common/session.c(409): Accepted a local client

$ tail -f controller.log

[03/20/18 21:28:44] seafile-controller.c(575): pid file /srv/seafile/cal/pids/seafdav.pid does not exist
[03/20/18 21:28:44] seafile-controller.c(606): seafdav need restart...
[03/20/18 21:28:44] 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 8080 --host localhost
[03/20/18 21:28:44] seafile-controller.c(102): spawned /usr/bin/python2.7, pid 24101

$ vi ccnet.conf

[General]
USER_NAME = xxxxx
ID = XXXXXXXXXXXXXXXXXXXXXXXXXXX
NAME = xxxxx
SERVICE_URL = https://xxxxx.xxxx.xxx

[Client]
PORT = 13419

[Database]
ENGINE = mysql
HOST = 127.0.0.1
PORT = 3306
USER = seafile
PASSWD = xxxxxxxxxx
DB = ccnet-db
CONNECTION_CHARSET = utf8

$ vi seahub_settings.py

# -*- coding: utf-8 -*-
SECRET_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXXX"

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'seahub-db',
        'USER': 'seafile',
        'PASSWORD': 'XXXXXXXXXX',
        'HOST': '127.0.0.1',
        'PORT': '3306'
    }
}

FILE_SERVER_ROOT = 'https://xxxxx.xxxx.xxx/seafhttp'

EMAIL_USE_TLS = True
EMAIL_HOST = 'xxxx.xxxx.xxx'
EMAIL_HOST_USER = 'xxx@xxxx.xxx'
EMAIL_HOST_PASSWORD = 'xxxxxxxxxxx'
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = "xxxx@xxxxx.xxx"
SERVER_EMAIL = "xxxx@xxxxx.xxx"

ENABLE_RESUMABLE_FILEUPLOAD = True

$ vi seafdav.conf

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

$ vi /etc/httpd/conf/extra/httpd-vhosts.conf

<VirtualHost *:443>

  ServerName xxxx.xxxx.xxx
  DocumentRoot /etc/httpd

  SSLEngine On
  SSLCertificateFile /etc/httpd/conf/cacert_seafile.pem
  SSLCertificateKeyFile /etc/httpd/conf/privkey_seafile.pem

  Alias /media  /srv/seafile/cal/seafile-server-latest/seahub/media

  <Location /media>
    Require all granted
  </Location>

  RewriteEngine On

  #
  # seafile fileserver
  #
  ProxyPass /seafhttp http://127.0.0.1:8082
  ProxyPassReverse /seafhttp http://127.0.0.1:8082
  RewriteRule ^/seafhttp - [QSA,L]

  #
  # WebDAV
  # We use http proxy, since SeafDAV is incompatible with FCGI proxy in Apache 2.4.
  #
  ProxyPass /seafdav http://127.0.0.1:8080/seafdav
  ProxyPassReverse /seafdav http://127.0.0.1:8080/seafdav

  #
  # seahub
  #
  SetEnvIf Request_URI . proxy-fcgi-pathinfo=unescape
  SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
  ProxyPass / fcgi://127.0.0.1:8000/

</VirtualHost>

Don’t know if this helps:

/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 8080 --host localhost

/usr/bin/python2.7: No module named wsgidav.server

It appears that command line creates a log file for seafdav in /srv/seafile/cal/logs. Can you post that log here?

Also, can you run “prgrep -f seafdav” and let me know the results?

1 Like

I think the python module isn’t there anymore. May a fake upgrade could help.

@bionade24

The strange thing is, though, in his error logs, it does spawn seafdav, or at least spawns something. I want to see if it really is spawning seafdav.

1 Like

It does not create a log for seafdav :frowning:

$ tail -f logs/controller.log

[04/09/18 21:20:59] 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 8080 --host localhost
[04/09/18 21:20:59] seafile-controller.c(102): spawned /usr/bin/python2.7, pid 16230
[04/09/18 21:21:09] seafile-controller.c(575): pid file /srv/seafile/cal/pids/seafdav.pid does not exist
[04/09/18 21:21:09] seafile-controller.c(606): seafdav need restart...
[04/09/18 21:21:09] 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 8080 --host localhost
[04/09/18 21:21:09] seafile-controller.c(102): spawned /usr/bin/python2.7, pid 16252
[04/09/18 21:21:19] seafile-controller.c(575): pid file /srv/seafile/cal/pids/seafdav.pid does not exist
[04/09/18 21:21:19] seafile-controller.c(606): seafdav need restart...
[04/09/18 21:21:19] 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 8080 --host localhost
[04/09/18 21:21:19] seafile-controller.c(102): spawned /usr/bin/python2.7, pid 16259

$ ls -ltr /srv/seafile/cal/logs/seafdav.log
ls: cannot access '/srv/seafile/cal/logs/seafdav.log': No such file or directory

$ ps -ef | grep seafdav
seafile 16295 16154 0 21:21 pts/0 00:00:00 grep seafdav

Fake upgrade in what way?

So, it’s not spawning seafdav after all. Or it is and then it is terminating quickly afterward. It does assign a PID, but it’s not actually running. Most Seafile scripts do a pgrep after starting a process in order to verify that it actually started. In this case, you are getting a success message… Are there any logs in /srv/seafile/cal/logs?

I’ll dig into the code and see what I can find. In the meantime, check to see if seafdav.pid exists under the pids folder… If it does, rename it to something like seafdav.bad. Then, try again. If it runs, obviously, it’s fixed. If not, check to see if the PID file was recreated.

No logs or pids for seafdav :frowning:

$ ls logs/

-rw-r--r-- 1 seafile nogroup       0 Jun  6  2017 elasticsearch_index_search_slowlog.log
-rw-r--r-- 1 seafile nogroup       0 Jun  6  2017 elasticsearch_index_indexing_slowlog.log
-rw-r--r-- 1 seafile nogroup       0 Jun 23  2017 elasticsearch_deprecation.log
-rw-r--r-- 1 seafile nogroup  415632 Mar 12 23:52 seafevents.log.2018-03-06
-rw-r--r-- 1 seafile nogroup  472206 Mar 19 23:53 seafevents.log.2018-03-13
-rw-r--r-- 1 seafile nogroup  438867 Mar 26 23:52 seafevents.log.2018-03-20
-rw-r--r-- 1 seafile nogroup 1006040 Apr  1 23:59 elasticsearch.log.2018-04-01
-rw-r--r-- 1 seafile nogroup  441178 Apr  2 23:52 seafevents.log.2018-03-27
-rw-r--r-- 1 seafile nogroup 1022356 Apr  2 23:59 elasticsearch.log.2018-04-02
-rw-r--r-- 1 seafile nogroup 1008396 Apr  4 23:59 elasticsearch.log.2018-04-03
-rw-r--r-- 1 seafile nogroup 1020872 Apr  5 23:59 elasticsearch.log.2018-04-05
-rw-r--r-- 1 seafile nogroup 1020872 Apr  5 23:59 elasticsearch.log.2018-04-04
-rw-r--r-- 1 seafile nogroup 1922117 Apr  6 23:59 elasticsearch.log.2018-04-06
-rw-r--r-- 1 seafile nogroup 1016894 Apr  7 23:59 elasticsearch.log.2018-04-07
-rw-r--r-- 1 seafile seafile  131613 Apr  8 12:12 seahub_django_request.log
-rw-r--r-- 1 seafile nogroup 1071890 Apr  8 23:59 elasticsearch.log.2018-04-08
-rw-r--r-- 1 seafile seafile  555135 Apr  9 21:18 seahub.log
-rw-r--r-- 1 seafile nogroup  459604 Apr  9 23:50 seafevents.log.2018-04-03
-rw-r--r-- 1 seafile nogroup 1060957 Apr  9 23:59 elasticsearch.log.2018-04-09
-rw-r--r-- 1 seafile seafile  106100 Apr 10 05:20 seahub_email_sender.log
-rw-r--r-- 1 seafile seafile 4112209 Apr 10 05:22 ccnet.log
-rw-r--r-- 1 seafile nogroup   14476 Apr 10 05:30 seafevents.log
-rw-r--r-- 1 seafile seafile  402894 Apr 10 05:30 index.log
-rw-r--r-- 1 seafile seafile 5750954 Apr 10 05:35 seafile.log
-rw-r--r-- 1 seafile seafile 1562647 Apr 10 05:35 controller.log
-rw-r--r-- 1 seafile nogroup  236277 Apr 10 05:35 elasticsearch.log

$ ls -ltr pids/

-rw-r--r-- 1 seafile nogroup 6 Apr  9 21:19 ccnet.pid
-rw-r--r-- 1 seafile nogroup 6 Apr  9 21:20 seaf-server.pid
-rw-r--r-- 1 seafile nogroup 5 Apr  9 21:20 seafevents.pid
-rw-r--r-- 1 seafile nogroup 5 Apr  9 21:20 elasticsearch.pid

I have a couple of questions for you.

Are you running fastcgi?
Where are you getting this error message? /usr/bin/python2.7: No module named wsgidav.server

I’ve dug through the code and found where that command to start seafdav is located, but something looks odd.

Oh, and one other thing… Port 8080… Is it possible that port 8080 is being used by something else? You may try using a different port by reconfiguring Apache and changing the port number in seafdav.conf.

Upgrade from 6.2.5 to 6.2.5

No fastcgi.

$ cat conf/seafdav.conf

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

I’m getting the error when executing mannualy the command.
I caught that command here:

$ tail -f logs/controller.log

[04/09/18 21:21:19] 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 8080 --host localhost
[04/09/18 21:21:19] seafile-controller.c(102): spawned /usr/bin/python2.7, pid 16259

I tried a different port, although 8080 was not in use (I think).

Same problem though.

$ tail -f controller.log

[04/10/18 21:33:53] 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/10/18 21:33:53] seafile-controller.c(102): spawned /usr/bin/python2.7, pid 26535
[04/10/18 21:34:03] seafile-controller.c(575): pid file /srv/seafile/cal/pids/seafdav.pid does not exist
[04/10/18 21:34:03] seafile-controller.c(606): seafdav need restart...

I retried the minor upgrade (I’m in a 6.2.9 coming from 6.2.8, but no change.

upgrade/minor-upgrade.sh

This is my full list from the first version I installed in the current machine until now.

seafile-pro-server_6.0.13_x86-64.tar.gz
seafile-pro-server_6.1.1_x86-64.tar.gz
seafile-pro-server_6.1.4_x86-64.tar.gz
seafile-pro-server_6.1.7_x86-64.tar.gz
seafile-pro-server_6.1.8_x86-64.tar.gz
seafile-pro-server_6.1.9_x86-64.tar.gz
seafile-pro-server_6.2.2_x86-64.tar.gz
seafile-pro-server_6.2.3_x86-64.tar.gz
seafile-pro-server_6.2.4_x86-64.tar.gz
seafile-pro-server_6.2.7_x86-64.tar.gz
seafile-pro-server_6.2.8_x86-64.tar.gz
seafile-pro-server_6.2.9_x86-64.tar.gz

I’m not certain if wsgidav is an addon for Python or not, but I know it interfaces with Python. Can you run this command and see if it is in the included list for Python? Unfortunately, I don’t use webdav, so my setup is not configured for it.

pip list --format columns

It seems to exist.

$ pip list --format columns

Package           Version         
----------------- ----------------
appdirs           1.4.3           
asn1crypto        0.24.0          
Beaker            1.8.1           
boto              2.48.0          
cffi              1.11.5          
cryptography      2.2.2           
defusedxml        0.5.0           
idna              2.6             
Mako              1.0.7           
MarkupSafe        1.0             
notify2           0.3.1           
packaging         16.8            
pip               9.0.1           
ply               3.11            
pyasn1            0.4.2           
pycparser         2.18            
pyOpenSSL         17.5.0          
pyparsing         2.2.0           
python-libtorrent 1.1.6           
Reflector         2018.3.3.22.1.34
setuptools        39.0.1          
six               1.11.0          
team              1.0             
urllib3           1.22            
WsgiDAV           2.2.4

Can you try reinstalling wsgidav, or updating it? According to that error message when you do it manually, it doesn’t exist, and wsgidav.server belongs to wsgidav package. So, updating it in Python may work.

Same problem :frowning:

Not easy…

$ pip install --upgrade WsgiDAV

Collecting WsgiDAV
  Downloading WsgiDAV-2.3.0-py2.py3-none-any.whl (140kB)
    100% |████████████████████████████████| 143kB 1.3MB/s 
Requirement already up-to-date: defusedxml in /usr/lib/python3.6/site-packages (from WsgiDAV)
Installing collected packages: WsgiDAV
  Found existing installation: WsgiDAV 2.2.4
    Uninstalling WsgiDAV-2.2.4:
      Successfully uninstalled WsgiDAV-2.2.4
Successfully installed WsgiDAV-2.3.0

$ /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

/usr/bin/python2.7: No module named wsgidav.server

Hum! python2.7 vs. python 3.6?

Don’t know how to solve it though.

$ ls /usr/lib/python3.6/site-packages/wsgidav/
addons dav_error.py (.....)

$ ls /usr/lib/python2.7/site-packages/wsgidav/
ls: cannot access '/usr/lib/python2.7/site-packages/wsgidav/': No such file or directory