Failed to connect via webdav after 6.3.12 update


#1

Hi,

after upgrading Seafile to 6.3.12 pro I’m not able to connect via webdav anymore!?

Client says: Could not authenticate to server: rejected Basic challenge

Server says in seafdav.log: Failed to login: ‘NoneType’ object is not callable

What has changed in the new version? Worked before…
[Edit]: After downgrade to 6.3.11 it works again! So it definitely has to do with 6.3.12.

Thanks and best regards,
Jochen


#2

Can you post the complete exception trace back from seafdav.log?


#3

Hello @Jonathan,

do you mean the whole seafdav.log?
That’s the complete log, nothing ‘interesting’:

[2019-02-23 10:18:55,662]: Failed to login: ‘NoneType’ object is not callable
[2019-02-23 10:23:31,852]: Failed to login: ‘NoneType’ object is not callable
[2019-02-23 10:36:11,149]: Failed to login: ‘NoneType’ object is not callable
[2019-02-23 10:43:58,568]: Failed to login: ‘NoneType’ object is not callable
[2019-02-23 10:47:47,883]: Failed to login: ‘NoneType’ object is not callable
[2019-02-23 10:54:16,800]: Failed to login: ‘NoneType’ object is not callable
[2019-02-23 10:58:45,099]: Failed to login: ‘NoneType’ object is not callable
[2019-02-23 11:01:20,242]: Failed to login: ‘NoneType’ object is not callable
[2019-02-23 11:01:45,903]: Failed to login: ‘NoneType’ object is not callable
[2019-02-23 11:14:22,201]: Failed to login: ‘NoneType’ object is not callable
[2019-02-23 21:22:37,691]: Failed to login: ‘NoneType’ object is not callable

Just one entry with every failed login. Nothing more.
In between, I went back to 6.3.11. There the mount/login was successful and there is no entry in seafdav.log.

What else could I check/post?

Thanks in advance,
Jochen


#4

Hi @Jochen,
Did you configure your seahub database in seahub_settings.py? or you use webdav only?
since this update of webdav depends on seahub database, you have to config it correctly.


#5

Hi @haikuo,

thanks for your answer!

I’m using the sync via Desktop Client from my windows laptop and additionally webdav access from one of my linux servers via davfs2.

Didn’t read anything in the changelog of 6.3.12, that I would have to adopt something!? What should I configure in seahub_settings.py?
This is my seahub_settings.py, did I miss something?

-- coding: utf-8 --

SECRET_KEY = “…”

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

#############

MEMCACHED

#############

CACHES = {
‘default’: {
‘BACKEND’: ‘django_pylibmc.memcached.PyLibMCCache’,
‘LOCATION’: ‘127.0.0.1:11211’,
}
}

FILE_SERVER_ROOT = ‘https://URL-to-my-seafile-server.de/seafhttp

###################

USER MANAGEMENT

###################

Enable or disable registration on web. Default is False.

ENABLE_SIGNUP = False

Activate or deactivate user when registration complete. Default is True.

If set to False, new users need to be activated by admin in admin panel.

ACTIVATE_AFTER_REGISTRATION = False

Whether to send email when a system admin adding a new member. Default is True.

SEND_EMAIL_ON_ADDING_SYSTEM_MEMBER = True

Whether to send email when a system admin resetting a user’s password. Default is True.

SEND_EMAIL_ON_RESETTING_USER_PASSWD = True

Remember days for login. Default is 7

LOGIN_REMEMBER_DAYS = 7

Attempt limit before showing a captcha when login.

LOGIN_ATTEMPT_LIMIT = 3

deactivate user account when login attempts exceed limit

Since version 5.1.2 or pro 5.1.3

FREEZE_USER_ON_LOGIN_FAILED = False

mininum length for user’s password

USER_PASSWORD_MIN_LENGTH = 8

LEVEL based on four types of input:

num, upper letter, lower letter, other symbols

‘3’ means password must have at least 3 types of the above.

USER_PASSWORD_STRENGTH_LEVEL = 3

default False, only check USER_PASSWORD_MIN_LENGTH

when True, check password strength level, STRONG(or above) is allowed

USER_STRONG_PASSWORD_REQUIRED = True

Force user to change password when admin add/reset a user.

Added in 5.1.1, deafults to True.

FORCE_PASSWORD_CHANGE = True

Age of cookie, in seconds (default: 2 weeks).

SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2

Whether a user’s session cookie expires when the Web browser is closed.

SESSION_EXPIRE_AT_BROWSER_CLOSE = False

Whether to save the session data on every request. Default is False

SESSION_SAVE_EVERY_REQUEST = False

###################

LIBRARY OPTIONS

###################

mininum length for password of encrypted library

REPO_PASSWORD_MIN_LENGTH = 8

mininum length for password for share link (since version 4.4)

SHARE_LINK_PASSWORD_MIN_LENGTH = 8

Disable sync with any folder. Default is False

NOTE: since version 4.2.4

DISABLE_SYNC_WITH_ANY_FOLDER = False

Enable or disable library history setting

ENABLE_REPO_HISTORY_SETTING = True

Enable or disable normal user to create organization libraries

Since version 5.0.5

ENABLE_USER_CREATE_ORG_REPO = True

#######################

ONLINE FILE PREVIEW

#######################

Whether to use pdf.js to view pdf files online. Default is True, you can turn it off.

NOTE: since version 1.4.

USE_PDFJS = True

Online preview maximum file size, defaults to 50M.

Note, this option controls files that can be previewed online, like pictures, txt, pdf.

In pro edition, for preview doc/ppt/excel/pdf, there is another option max-size

in seafevents.conf that controls the limit of files that can be previewed.

FILE_PREVIEW_MAX_SIZE = 50 * 1024 * 1024

Enable or disable thumbnails

NOTE: since version 4.0.2

ENABLE_THUMBNAIL = True

Absolute filesystem path to the directory that will hold thumbnail files.

THUMBNAIL_ROOT = ‘/opt/seafile/seahub-data/thumbnail/thumb/’

##########

E-Mail

##########

EMAIL_USE_TLS = True
EMAIL_HOST = ‘smtp.gmail.com
EMAIL_HOST_USER = ‘…@gmail.com
EMAIL_HOST_PASSWORD = ‘…’
EMAIL_PORT = ‘587’
#DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
DEFAULT_FROM_EMAIL = ‘…@gmail.com
SERVER_EMAIL = ‘EMAIL_HOST_USER’

Change the sender and reply to of email (only affects email sending for file share links:

Replace default from email with user’s email or not, defaults to False

REPLACE_FROM_EMAIL = True

Set reply-to header to user’s email or not, defaults to False. For details,

please refer to http://www.w3.org/Protocols/rfc822/

ADD_REPLY_TO_HEADER = True

###################

FURTHER OPTIONS

###################

Disable settings via Web interface in system admin->settings

Default is True

Since 5.1.3

ENABLE_SETTINGS_VIA_WEB = True

Choices can be found here:

http://en.wikipedia.org/wiki/List_of_tz_zones_by_name

although not all choices may be available on all operating systems.

If running in a Windows environment this must be set to the same as your

system time zone.

TIME_ZONE = ‘Europe/Berlin’

Language code for this installation. All choices can be found here:

http://www.i18nguy.com/unicode/language-identifiers.html

Default language for sending emails.

LANGUAGE_CODE = ‘en’

Set this to your website/company’s name. This is contained in email notifications and welcome message when user login for the first time.

SITE_NAME = ‘Seafile’

Browser tab’s title

SITE_TITLE = ‘Rupp-Seafile’

If you don’t want to run seahub website on your site’s root path, set this option to your preferred path.

e.g. setting it to ‘/seahub/’ would run seahub on http://example.com/seahub/.

SITE_ROOT = ‘/’

Max number of files when user upload file/folder.

Since version 6.0.4

MAX_NUMBER_OF_FILES_FOR_FILEUPLOAD = 5000

Enable Resumable Fileupload for WebGUI:

ENABLE_RESUMABLE_FILEUPLOAD = True

###############

PRO OPTIONS

###############

Whether to show the used traffic in user’s profile popup dialog. Default is True

SHOW_TRAFFIC = True

Allow administrator to view user’s file in UNENCRYPTED libraries

through Libraries page in System Admin. Default is False.

ENABLE_SYS_ADMIN_VIEW_REPO = True

For un-login users, providing an email before downloading or uploading on shared link page.

Since version 5.1.4

ENABLE_SHARE_LINK_AUDIT = True

Check virus after upload files to shared upload links. Defaults to False.

Since version 6.0

ENABLE_UPLOAD_LINK_VIRUS_CHECK = True

Enable system admin add T&C, all users need to accept terms before using. Defaults to False.

Since version 6.0

ENABLE_TERMS_AND_CONDITIONS = True

Enable two factor authentication for accounts. Defaults to False.

Since version 6.0

ENABLE_TWO_FACTOR_AUTH = False

Enable user select a template when he/she creates library.

When user select a template, Seafile will create folders releated to the pattern automaticly.

Since version 6.0

LIBRARY_TEMPLATES = {
‘Technology’: [’/Develop/Python’, ‘/Test’],
‘Finance’: [’/Current assets’, ‘/Fixed assets/Computer’]
}

Thanks in advance and best regards,
Jochen


#7

So you can do sync via Desktop client but can’t login with webdav?

You can try to edit code file:
/opt/seafile/seafile-server-latest/seahub/thirdpart/wsgidav/addons/seafile/domain_controller.py
add code

_logger.warning(‘session is %s’, self.session_cls)

after line 54 between
‘ccnet_email = None’
and
‘session = self.session_cls()’

then restart seafile and login with webdav, see what print in seafdav.log, or you can add more logs in this file if you know about python coding.


#8

Correct. Destop sync works both with Windows and MacOS up to 6.3.12, WebDAV worked up to 6.3.11 but is broken in 6.3.12.

I’ve upgraded to 6.3.12 again and added the line in domain_controller.py as you said. But the information given in saefdav.log is not much more helpful, isn’t it?

root@seafile:/opt/seafile/logs# tail -f seafdav.log
[2019-02-26 10:39:23,444]:  session is None
[2019-02-26 10:39:23,445]:  Failed to login: 'NoneType' object is not callable

I’m not familiar with python so I don’t know, what more I could check/debug …

Thanks for any other hints!
Jochen


#9

The problem is seafdav can’t connect to seahub database, maybe something is wrong with your python environment, you can try to copy seahub_settings.py to /opt/seafile/seafile-server-latest/seahub/thirdpart/wsgidav/addons/seafile/ and restart again


#10

Thank you for your answer @haikuo
I’ve tried that but still the same problem…!

What else could I test?

Thanks and best regards,
Jochen


#11

Alright… try to add code

self.session_cls = seahub_db.init_db_session_class()

after line 54 (after ‘ccnet_email = None’), more logs will be printed.


#12

Hi @haikuo ,

thanks for your patience! I’ve added the line to domain_controller.py, restarted seafile and tired to login but there are still just the two lines in seafdav.log as mentioned above…!?

Cheers,
Jochen


#13

OK, it’s time to unlock the final power! Give me your email address and I’ll send you a file named seahub_db.py to replace the one under /opt/seafile/seafile-server-latest/seahub/thirdpart/wsgidav/addons/seafile/ , remember to make a backup before replace it.


#14

I have same Problem, but with an new installation, not upgrade.
Same Error “Failed to login: ‘NoneType’ object is not callable” nothing more.
Everything works fine so far, except Webdav


#15

The temporary solution is to comment line 55 and line 86 in /opt/seafile/seafile-server-latest/seahub/thirdpart/wsgidav/addons/seafile/domain_controller.py by ‘#’, and the code should look like


#session = self.session_cls()

#session.close()

@lenusch @Jochen


#16

wow it works.! Thanks alot.


#17

No problem, here. I upgraded my test server on Scientific Linux 7.6 to Pro 6.3.12 and still can connect via webdav. Next week I will upgrade our production servers.


#18

on other Server its not working :frowning: Kinda freaking out


#19

Our Seafile cluster is upgraded to 6.3.12 and I still can connect via wedav.


#20

congrats. Here its not working since last few Updates.