Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No basic authentication headers were found #14510

Closed
tmoehle opened this issue Feb 25, 2015 · 24 comments
Closed

No basic authentication headers were found #14510

tmoehle opened this issue Feb 25, 2015 · 24 comments
Labels
Milestone

Comments

@tmoehle
Copy link

tmoehle commented Feb 25, 2015

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

@Tribalize
Copy link

I am getting same error messages in my instance.

@rootiam
Copy link

rootiam commented Feb 26, 2015

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

@tmoehle
Copy link
Author

tmoehle commented Feb 28, 2015

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.

@Huster-at-github
Copy link

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.

@nickvergessen nickvergessen added this to the 8.1-current milestone Mar 2, 2015
@nickvergessen
Copy link
Contributor

@LukasReschke maybe you have any idea?

@tuxmaster
Copy link

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}

@DeepDiver1975
Copy link
Member

@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?

@tmoehle
Copy link
Author

tmoehle commented Mar 17, 2015

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.

@PVince81
Copy link
Contributor

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.

@tmoehle
Copy link
Author

tmoehle commented Mar 17, 2015

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.

@PVince81
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

@tmoehle
Copy link
Author

tmoehle commented Mar 17, 2015

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.

@karlitschek
Copy link
Contributor

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

@DeepDiver1975
Copy link
Member

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.

@VirtualWolf
Copy link

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.

@DeepDiver1975
Copy link
Member

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

@PVince81
Copy link
Contributor

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

@sophonet
Copy link

sophonet commented Aug 2, 2015

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...

@cat25451
Copy link

Hi
I am using owncloud 8.1 and Kalendar from debian jessie and see this error in owncloud.log too.
Maybe this is a hint that helps:
As I use german language the name of my private calendar is wirtten "persönlich" and in the URL this is written as "https://.../pers%C3%B6nlich"
If I use another calender like "Schulferien" synchronisation takes place.

@nickvergessen
Copy link
Contributor

I reported your issue to the calendar tracker: owncloud/calendar#894

@sophonet
Copy link

My original problem (reported a few posts above) w.r.t. iOS 8.4 and owncloud 8.0.1 has actually gone after applying a patch as posted on owncloud/calendar#857

@dblaichinger
Copy link

Hi,

I had the same issue, where the sync of my calendar didn't work since upgrading to owncloud 8.
Even an upgrade to the current 8.1.1. didn't solve this issue.
However, after adding the following line to my Apache vhost file, everything is working fine again.

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

Suggested here: #18194

@lock lock bot locked as resolved and limited conversation to collaborators Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests