core icon indicating copy to clipboard operation
core copied to clipboard

No basic authentication headers were found

Open tmoehle opened this issue 11 years ago • 24 comments

Hey guys,

since I updated my Ubuntu 14.04 php packages on February 18 my Owncloud 8.0 installation throws a lot of basic authentication errors again. I know, this is a well discussed issue and I already had fixed this error a while ago in Owncloud 6 (https://forum.owncloud.org/viewtopic.php?f=26&t=19491) by adding a line to my fcgid.conf.

The Owncloud client has no trouble connecting to the server, but many users complain about their Apple Contacts App not being able to connect anymore and my roundcube carddav plugin is not showing any contacts either. Trying the same URLs in Firefox, I'm getting basic authentication requests and the login works fine, but obviously many other clients and users on my site have problems connecting with their webdav or carddav applications.

Here is one example of thousands of errors like this in my owncloud.log:

{
    "reqId": "7389b32a608fc1f35d0f63fb805b9466",
    "remoteAddr": "176.94.144.XXX",
    "app": "webdav",
    "message": {
        "Exception": {
            "Message": "No basic authentication headers were found",
            "Code": 0,
            "Trace": {
                "#0": [
                    "/var/www/cloud/public/lib/private/connector/sabre/auth.php(123):",
                    "Sabre\\DAV\\Auth\\Backend\\AbstractBasic->authenticate(Object(OC_Connector_Sabre_Server), 'ownClo ud')"
                ],
                "#1": [
                    "/var/www/cloud/public/lib/private/connector/sabre/auth.php(103):",
                    "OC_Connector_Sabre_Auth->auth(Object(OC_Connector_Sabre_Server), 'ownCloud')"
                ],
                "#2": [
                    "/var/ww",
                    "w/cloud/public/3rdparty/sabre/dav/lib/Sabre/DAV/Auth/Plugin.php(108): OC_Connector_Sabre_Auth->authenticate(Object(OC_Connector_Sabre_Server), 'ownCloud')"
                ],
                "#3": [
                    "[intern",
                    "al function]: Sabre\\DAV\\Auth\\Plugin->beforeMethod('PROPFIND', '')"
                ],
                "#4": [
                    "/var/www/cloud/public/3rdparty/sabre/dav/lib/Sabre/DAV/Server.php(433):",
                    "call_user_fu nc_array(Array, Array)"
                ],
                "#5": [
                    "/var/www/cloud/public/3rdparty/sabre/dav/lib/Sabre/DAV/Server.php(455):",
                    "Sabre\\DAV\\Server->broadcastEvent('beforeMethod', Array)"
                ],
                "": [
                    "#6",
                    "/var/www/cloud/public/3rdparty/sabre/dav/lib/Sabre/DAV/Server.php(214): Sabre\\DAV\\Server->invokeMethod('PROPFIND', '')"
                ],
                "#7": [
                    "/var/www/cloud/publ",
                    "ic/apps/files/appinfo/remote.php(61): Sabre\\DAV\\Server->exec()"
                ],
                "#8": [
                    "/var/www/cloud/public/remote.php(54):",
                    "require_once('/var/www/cloud/...')"
                ],
                "#9": [
                    "{main}",
                    ""
                ]
            },
            "File": "/var/www/cloud/public/3rdparty/sabre/dav/lib/Sabre/DAV/Auth/Backend/AbstractBasic.php",
            "Line": 73
        }
    },
    "level": 0,
    "time": "2015-02-18T10:55:27+00:0 0",
    "method": "PROPFIND",
    "url": "/remote.php/webdav"
}

Am I the only one having this issue or do you have any idea on how to fix this?

Thanks

tmoehle avatar Feb 25 '15 16:02 tmoehle

I am getting same error messages in my instance.

Tribalize avatar Feb 25 '15 21:02 Tribalize

Same here. Cannot connect with my Android app. Also caldav sync doesnt work.

rootiam avatar Feb 26 '15 16:02 rootiam

So, i wrote a little php script, just to check if basic authentication works on that vhost in this specific configuration with mod_fcgid and php and had no problems on that end. So I guess my webserver is working correctly and handing the authentication data correctly over to Owncloud.

I'm now trying to find out where the data gets lost or misinterpreted within Owncloud, so any help here would be much appreciated.

tmoehle avatar Feb 28 '15 07:02 tmoehle

OC 8.0.4 Ubuntu 14.04 Apache 24 MySQL PHP 5.5.9-1ubuntu4

Same here: Get this error log when trying to start the internal Pictures-App. Picture-App doesnt display the overview. Viewing pictures from Files-App works.

Huster-at-github avatar Mar 01 '15 16:03 Huster-at-github

@LukasReschke maybe you have any idea?

nickvergessen avatar Mar 02 '15 16:03 nickvergessen

I have the same messages. OS: CentOS7 OC: owncloud-8.0.0-27.1.noarch Message: Mar 17 12:18:32 system ownCloud[15743]: {webdav} Exception: {"Message":"No basic authentication headers were found","Code":0,"Trace":"#0 /var/www/html/owncloud/lib/private/connector/sabre/auth.php(123): Sabre\DAV\Auth\Backend\AbstractBasic->authenticate(Object(OC_Connector_Sabre_Server), 'ownCloud')\n#1 /var/www/html/owncloud/lib/private/connector/sabre/auth.php(103): OC_Connector_Sabre_Auth->auth(Object(OC_Connector_Sabre_Server), 'ownCloud')\n#2 /var/www/html/owncloud/3rdparty/sabre/dav/lib/Sabre/DAV/Auth/Plugin.php(108): OC_Connector_Sabre_Auth->authenticate(Object(OC_Connector_Sabre_Server), 'ownCloud')\n#3 [internal function]: Sabre\DAV\Auth\Plugin->beforeMethod('PROPFIND', '')\n#4 /var/www/html/owncloud/3rdparty/sabre/dav/lib/Sabre/DAV/Server.php(433): call_user_func_array(Array, Array)\n#5 /var/www/html/owncloud/3rdparty/sabre/dav/lib/Sabre/DAV/Server.php(455): Sabre\DAV\Server->broadcastEvent('beforeMethod', Array)\n#6 /var/www/html/owncloud/3rdparty/sabre/dav/lib/Sabre/DAV/Server.php(214): Sabre\DAV\Server->invokeMethod('PROPFIND', '')\n#7 /var/www/html/owncloud/apps/files/appinfo/remote.php(61): Sabre\DAV\Server->exec()\n#8 /var/www/html/owncloud/remote.php(54): require_once('/var/www/html/o...')\n#9 {main}","File":"/var/www/html/owncloud/3rdparty/sabre/dav/lib/Sabre/DAV/Auth/Backend/AbstractBasic.php","Line":73}

tuxmaster avatar Mar 17 '15 11:03 tuxmaster

@PVince81 I guess we should log this exception with a different log level - it simply can happen that clients try to access the server without authentication headers - not really an issue.

Objections?

DeepDiver1975 avatar Mar 17 '15 11:03 DeepDiver1975

I'm getting that error using definitely the right credentials. There seems to be a problem handing the authentication headers over from the remote.php to sabredav.

tmoehle avatar Mar 17 '15 11:03 tmoehle

Yes, it is expected that the error appears in some cases due to the way how basic auth works: curl first sends a request, receives 401 that tells what auth method to use, then sends a second request with the credentials.

PVince81 avatar Mar 17 '15 11:03 PVince81

But shouldn't clients be able to connect on that second request? Because I've got a lot of clients that are unable to connect since I updated Owncloud to version 8.

tmoehle avatar Mar 17 '15 11:03 tmoehle

From what I see in the code, it is already logged only on DEBUG level. And also your output shows that you have "loglevel: 0".

PVince81 avatar Mar 17 '15 11:03 PVince81

Yes, clients should be able to connect on the second request. If they cannot then it is another issue, or let's say the issue is not about the logged messages, but about the failure to connect on the second try.

You are mentioning CardDAV, so possible something specific to the contacts app.

PVince81 avatar Mar 17 '15 11:03 PVince81

What do you guys get with curl when doing this: curl -D - -X PROPFIND -k https://user:password@yourhost/owncloud/remote.php/carddav/ and curl -D - -X PROPFIND -k https://user:password@yourhost/owncloud/remote.php/caldav/

On my 8.0.2 instance both work properly.

PVince81 avatar Mar 17 '15 11:03 PVince81

Indeed, that seems to work:

<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:card="urn:ietf:params:xml:ns:carddav"><d:response><d:href>/remote.php/carddav/</d:href><d:propstat><d:prop><d:getlastmodified>Tue, 17 Mar 2015 11:46:10 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/carddav/principals/</d:href><d:propstat><d:prop><d:getlastmodified>Tue, 17 Mar 2015 11:46:10 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/carddav/addressbooks/</d:href><d:propstat><d:prop><d:getlastmodified>Tue, 17 Mar 2015 11:46:10 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>

and

<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/"><d:response><d:href>/remote.php/caldav/</d:href><d:propstat><d:prop><d:getlastmodified>Tue, 17 Mar 2015 11:46:53 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/caldav/principals/</d:href><d:propstat><d:prop><d:getlastmodified>Tue, 17 Mar 2015 11:46:53 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/caldav/calendars/</d:href><d:propstat><d:prop><d:getlastmodified>Tue, 17 Mar 2015 11:46:53 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>

I had problems with Apple Contacts and Calendars on the Mac and this CardDAV Plugin for Roundcube (https://github.com/blind-coder/rcmcarddav). I'll update to 8.02 and then I'll look into that again.

tmoehle avatar Mar 17 '15 11:03 tmoehle

@DeepDiver1975 @PVince81 any reason we log this at all? i'm not sure

karlitschek avatar Mar 17 '15 12:03 karlitschek

We are logging all exceptions on the webdav interface - great help on debugging/support cases.

Some of them are kind of expected exceptions and these are logged in debug mode only.

DeepDiver1975 avatar Mar 17 '15 12:03 DeepDiver1975

Just another data point, I'm seeing the same issue ("No basic authentication headers were found") and it's resulting in the same behaviour (unable to update or edit contacts in Address Book in Mac OS X or iOS). Calendars are working perfectly, this seems to only be affecting Contacts for me.

OwnCloud 8.0.2 on CentOS 7, PostgreSQL 9.2.10, Apache 2.4.6, PHP 5.4.16.

VirtualWolf avatar Apr 23 '15 01:04 VirtualWolf

There is nothing wrong in logging these exception -> close

For all of you who have explicit error scenarios - please open issues in the corresponding repos - THX a alot

DeepDiver1975 avatar Apr 23 '15 09:04 DeepDiver1975

Also with a bit of luck the Sabre 2.1 upgrade that comes with 8.1 (and the matching calendar/contact) apps might solve some connectivity issues

PVince81 avatar Apr 23 '15 10:04 PVince81

Hi there, after upgrading to owncloud 8.1 on my ubuntu-trusty-server (standard installation which comes from official ubuntu repository on opensuse) one month ago, I am not able to see all calendar entries on iOS 8.4. They are there in the web front-end and in the MacOS calendar application, but not on iOS. When I try to update them on my iPhone (by first de-selecting and then re-selecting the specific calendar on which some events are missing), the owncloud log mentions a few of the issues mentioned above:

Exception: {"Message":"HTTP\/1.1 401 No basic authentication headers were found","Code":0,"Trace":"
#0 \/var\/www\/owncloud\/lib\/private\/connector\/sabre\/auth.php(149): Sabre\\DAV\\Auth\\Backend\\AbstractBasic->authenticate(Object(Sabre\\DAV\\Server), 'ownCloud')\n
#1 \/var\/www\/owncloud\/lib\/private\/connector\/sabre\/auth.php(122): OC\\Connector\\Sabre\\Auth->auth(Object(Sabre\\DAV\\Server), 'ownCloud')\n
#2 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Auth\/Plugin.php(118): OC\\Connector\\Sabre\\Auth->authenticate(Object(Sabre\\DAV\\Server), 'ownCloud')\n
#3 [internal function]: Sabre\\DAV\\Auth\\Plugin->beforeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n
#4 \/var\/www\/owncloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n
#5 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(456): Sabre\\Event\\EventEmitter->emit('beforeMethod', Array)\n
#6 \/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n
#7 \/var\/www\/owncloud\/apps\/calendar\/appinfo\/remote.php(57): Sabre\\DAV\\Server->exec()\n
#8 \/var\/www\/owncloud\/remote.php(132): require_once('\/var\/www\/ownclo...')\n
#9 {main}","File":"\/var\/www\/owncloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Auth\/Backend\/AbstractBasic.php","Line":70}

With the curl command above

curl -D - -X PROPFIND -k https://user:password@yourhost/remote.php/caldav/

I receive a reply with the following xml content:

<?xml version="1.0" encoding="utf-8"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/">
<d:response><d:href>/remote.php/caldav/</d:href><d:propstat><d:prop><d:getlastmodified>Sun, 02 Aug 2015 14:12:19 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/caldav/principals/</d:href><d:propstat><d:prop><d:getlastmodified>Sun, 02 Aug 2015 14:12:19 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/remote.php/caldav/calendars/</d:href><d:propstat><d:prop><d:getlastmodified>Sun, 02 Aug 2015 14:12:19 GMT</d:getlastmodified><d:resourcetype><d:collection/></d:resourcetype></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>

Any chance how I can do further debugging / solving the problem? I also deleted the CalDav account from my iPhone and added it again - same effect...

sophonet avatar Aug 02 '15 14:08 sophonet