"HTTP 500 - Internal Server Error" on login of LDAP user in OC7
If an LDAP user tries to log in an OC7 server, they get an "HTTP 500 - Internal Server Error". If a non LDAP user tries to log in, it is logged well.
Steps to reproduce
- Configure OC7 server for connecting to an LDAP-based user directory
- Send the following request (with credentials of LDAP user): curl -k --user 'user:pass' -i -X PROPFIND https://server/owncloud/remote.php/webdav/ -H 'Depth: 1' A HTTP 500 error is retourned
- Send the following request (with credentials of a non LDAP user): curl -k --user 'user:pass' -i -X PROPFIND https://server/owncloud/remote.php/webdav/ -H 'Depth: 1' Authentication is correct.
Note: The <?xml version="1.0" encoding="utf-8" ?><D:propfind xmlns:D="<D:allprop/></D:propfind>' data is not sent because it is optional.
Expected behaviour
The LDAP user should be able to log in without error.
Actual behaviour
"HTTP 500 error" is returned.
cc @MTRichards
cc @blizz @rperezb
Notice this is failing through the WebDAV interface, but not though the Web UI.
@blizzz
@jabarros Please use the issue template: https://raw.github.com/owncloud/core/master/issue_template.md
Is that OC 7.0.3 RC 1 ? Please also post the server logs.
@PVince81 Yes, it is an ownCloud Enterprise Edition 7.0.3 RC1 (testing) The owncloud logs show nothing new with the request. We can not access the web server logs.
@PVince81 In order to give you a bit more information, with method HEAD is failing too: curl -k --user 'user:pass' -i -X HEAD https://server/owncloud/remote.php/webdav/ As 'user' we are using the displayName, that it is enable as valid in ownCloud server.
@jabarros cannot reproduce, works fine for me on current both stable7 and 7.0.3 RC 1.
As "user" you must not use the display name, but a valid login name, typically an LDAP username as present in the "uid" attribute (or "samaccountname" on AD).
Hi, @blizzz . The problem is, in our configuration:
- the uid (*) is not working to log-in, both through WebDAV nor through the Web UI .
- we explicitly enabled the display name to log-in in the LDAP settings, and it is working through the Web UI, but failing for that two requests (that are used from the mobile apps).
(*) We are assuming the uid matches the value shown in the first column of the list of users in OC, and maybe we are wrong, but that's the only identifier we had access to, since the LDAP server is out of our scope.
Maybe this is not the best repository for this issue? cc @rperezb, @MTRichards
For the record,
- opening the WebDAV URL on the browser while being logged in results in a 504, Bad Gateway, after loading for a while. Nothing seems to be reported in the log, as far as i can tell from the admin page.
- being not logged in the WebDAV URL via browser asks for credentials, but dies in a 500 immediately afterwards.
Okay, i tried with my setup and 7.0.3 RC1 as well as current stable7 from git. Although I do not get a 500, i nevertheless cannot login with LDAP users through webdav.
$ cadaver http://zara.owncloud.bzoc/stable7/remote.php/webdav/
Authentication required for ownCloud on server `zara.owncloud.bzoc':
Username: alice
Password:
Could not access /stable7/remote.php/webdav/ (not WebDAV-enabled?):
Did not find a collection resource.
Connection to `zara.owncloud.bzoc' closed.
Something is definitely at odds here, I'd call it a blocker for now. @craigpg
That's what I see in my log
{"reqId":"5447883d0b886","app":"webdav","message":"Sabre\\DAV\\Exception\\NotAuthenticated: No basic authentication headers were found","level":0,"time":"2014-10-22T10:34:37+00:00","method":"OPTIONS","url":"\/stable7\/remote.php\/webdav\/"}
{"reqId":"5447883d0b886","app":"webdav","message":"Exception: #1 \/home\/blizzz\/owncloud\/dev\/stable7\/lib\/private\/connector\/sabre\/auth.php(78): OC_Connector_Sabre_Auth->auth(Object(OC_Connector_Sabre_Server), 'ownCloud')","level":0,"time":"2014-10-22T10:34:37+00:00","method":"OPTIONS","url":"\/stable7\/remote.php\/webdav\/"}
{"reqId":"5447883d0b886","app":"webdav","message":"Exception: #2 \/home\/blizzz\/owncloud\/dev\/stable7\/3rdparty\/sabre\/dav\/lib\/Sabre\/DAV\/Auth\/Plugin.php(108): OC_Connector_Sabre_Auth->authenticate(Object(OC_Connector_Sabre_Server), 'ownCloud')","level":0,"time":"2014-10-22T10:34:37+00:00","method":"OPTIONS","url":"\/stable7\/remote.php\/webdav\/"}
{"reqId":"5447883d0b886","app":"webdav","message":"Exception: #3 [internal function]: Sabre\\DAV\\Auth\\Plugin->beforeMethod('OPTIONS', '')","level":0,"time":"2014-10-22T10:34:37+00:00","method":"OPTIONS","url":"\/stable7\/remote.php\/webdav\/"}
{"reqId":"5447883d0b886","app":"webdav","message":"Exception: #4 \/home\/blizzz\/owncloud\/dev\/stable7\/3rdparty\/sabre\/dav\/lib\/Sabre\/DAV\/Server.php(433): call_user_func_array(Array, Array)","level":0,"time":"2014-10-22T10:34:37+00:00","method":"OPTIONS","url":"\/stable7\/remote.php\/webdav\/"}
{"reqId":"5447883d0b886","app":"webdav","message":"Exception: #5 \/home\/blizzz\/owncloud\/dev\/stable7\/3rdparty\/sabre\/dav\/lib\/Sabre\/DAV\/Server.php(455): Sabre\\DAV\\Server->broadcastEvent('beforeMethod', Array)","level":0,"time":"2014-10-22T10:34:37+00:00","method":"OPTIONS","url":"\/stable7\/remote.php\/webdav\/"}
{"reqId":"5447883d0b886","app":"webdav","message":"Exception: #6 \/home\/blizzz\/owncloud\/dev\/stable7\/3rdparty\/sabre\/dav\/lib\/Sabre\/DAV\/Server.php(214): Sabre\\DAV\\Server->invokeMethod('OPTIONS', '')","level":0,"time":"2014-10-22T10:34:37+00:00","method":"OPTIONS","url":"\/stable7\/remote.php\/webdav\/"}
{"reqId":"5447883d0b886","app":"webdav","message":"Exception: #7 \/home\/blizzz\/owncloud\/dev\/stable7\/apps\/files\/appinfo\/remote.php(60): Sabre\\DAV\\Server->exec()","level":0,"time":"2014-10-22T10:34:37+00:00","method":"OPTIONS","url":"\/stable7\/remote.php\/webdav\/"}
{"reqId":"5447883d0b886","app":"webdav","message":"Exception: #8 \/home\/blizzz\/owncloud\/dev\/stable7\/remote.php(52): require_once('\/home\/blizzz\/ow...')","level":0,"time":"2014-10-22T10:34:37+00:00","method":"OPTIONS","url":"\/stable7\/remote.php\/webdav\/"}
{"reqId":"5447883d0b886","app":"webdav","message":"Exception: #9 {main}","level":0,"time":"2014-10-22T10:34:37+00:00","method":"OPTIONS","url":"\/stable7\/remote.php\/webdav\/"}
The log above are not the root of the evil, i am getting them with local users, too, but there login works. continues to investigate
Have a solution, PR coming
fix is here: https://github.com/owncloud/core/pull/11702