Seafile 7.0.2, seafdav bug "No module named seahub_settings."

I tried building Seafile Server 7.0.2 and I ran into some issues.

  1. lists “django-picklefield” as a requirement. Unfortunately, the download from pip (v2.0) fails, something seems to be broken on their side. Is it possible to add picklefield’s version number in constance’s Or mention it in the manual?

  2. “seafdav/wsgidav/addons/seafile/” seems to require SQLalchemy at runtime. Without it, seafdav will be restarted over and over again by the controller without actually working. And worse, it doesn’t log anything to seafdav.log, making it hard to troubleshoot.
    Maybe include that dependency into the documentation as well?

  3. When SQLalchemy is installed, the seafdav.log works, it says: “Failed to init seahub db: No module named seahub_settings.” It’s imported in line 24

--- seafdav/wsgidav/addons/seafile/ 2019-06-18 16:53:28.761890959 +0200
+++ seafdav/wsgidav/addons/seafile/     2019-06-18 16:54:20.801890939 +0200
@@ -1,4 +1,8 @@
 from urllib import quote_plus
+import os
+import sys
+central_conf_dir = os.environ.get('SEAFILE_CENTRAL_CONF_DIR', '')

 from sqlalchemy import create_engine
 from sqlalchemy.event import contains as has_event_listener, listen as add_event_listener
@@ -24,7 +28,13 @@
         return None

 def create_seahub_db_engine():
-    import seahub_settings
+    try:
+        if os.path.exists(central_conf_dir):
+            sys.path.insert(0, central_conf_dir)
+        import seahub_settings
+    except ImportError:
+        pass
+    #import seahub_settings
     db_infos = seahub_settings.DATABASES['default']
     #import local_settings
     #db_infos = local_settings.DATABASES['default']

I’m not sure if this is the right way to deal with the problem, the code is copied from seahub’s Also, I didn’t look into the sqlite-part of that code since I don’t use sqlite.
Shouldn’t seafdav be started by seahub somehow, thus not requiring to load conf/ at all? Maybe I’m still missing a dependency?

On a side note: when I patched seafdav and then build the server using “seafile-server/scripts/build/”, the patch gets removed. So I had to re-apply it in seafile-server-7.0.2/seahub/thirdpart/wsgidav/addons/seafile/ Is that a mistake or by design? And how to avoid it?

Any thoughts or explainations are highly welcome, especially on #3.
It seems to work fine (test szenario).



Same for me about the “Init seahub database… Failed to init seahub db: No module named seahub_settings.” error. But I don’t have SQLalchemy.

Okay, I’ve had time to test this against the prebuild binary ( from the download section.
seafdav.log also says “Failed to init seahub db: No module named seahub_settings.” here.
Adding the code from my fist post to seahub/thirdpart/wsgidav/addons/seafile/ also makes that error go away and SeafDAV works.

@Jeff_Jeff did you install the prebuild binary or a self-compiled version? Can you test if the modifications above fixes seahub’s issues for you as well? (Please don’t try that on a production server)


Thanks for your return. I’ve installed the official package on a debian server. Updated from version 6.0.9 (by following the instructions as well).
Your modifications didn’t work for me (after restarting, of course). Same error again. I don’t know what to try!

Same problem with 7.0.3 server. @dennis modification fixes error in log, but webdav still does not work, there is HTTP 500 error.

[2019-08-06 23:12:53,304]: Init seahub database…
[2019-08-06 23:12:53,307]: Failed to init seahub db: No module named seahub_settings.
me too