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

Woops, something's gone wrong! The CardDAV server returned the http status code 500. #1017

Closed
mbiebl opened this issue Dec 6, 2017 · 10 comments
Assignees
Labels

Comments

@mbiebl
Copy link
Contributor

@mbiebl mbiebl commented Dec 6, 2017

I use sabre-dav in combination with z-push (http://z-push.org/).
Since the update of sabre-dav from 3.2.0 to 3.2.1, z-push is broken and I get error messages like the following in the z-push log:

06/12/2017 22:47:48 [ 5484] [ INFO] [unknown] ExportChangesDiff->InitializeExporter(): Found '1' changes for 'contacts'
06/12/2017 22:47:49 [ 5484] [ERROR] [unknown] BackendCardDAV->GetMessage - Error getting vcard 'a4de694e-60c3-4a50-b504-bd2641d3b2a4' in '7f7297f2': Woops, something's gone wrong! The CardDAV server returned the http status code 500.
06/12/2017 22:47:49 [ 5484] [ERROR] [unknown] BackendCardDAV->GetMessage(): vCard not found
06/12/2017 22:47:49 [ 5484] [WARN] [unknown] C:\src\z-push\src\lib\default\diffbackend\exportchangesdiff.php:163 Creating default object from empty value (2)

Running a git bisec points at 73065c3 as the first faulty commit. This was added for #889

@mbiebl
Copy link
Contributor Author

@mbiebl mbiebl commented Dec 6, 2017

@evert
Copy link
Member

@evert evert commented Dec 6, 2017

I think z-push specific questions are out of scope for this issue tracker, unless you can track down what the server actually sent back (other than a 500 status code, there should be a response body with more info)

@mbiebl
Copy link
Contributor Author

@mbiebl mbiebl commented Dec 6, 2017

@evert Are you suggesting this a z-push bug? So far all I can say it's a regression introduced by the update from 3.2.0 to 3.2.1 that's why I thought it's best to start filing that against sabre-dav.

That said, can you give me pointers how I can provide you with the information you asked for

@evert
Copy link
Member

@evert evert commented Dec 6, 2017

Are you suggesting this a z-push bug

Not necessarily, but if an issue is reported and it's in the form "I'm using tool X and I'm getting an error", I think the burden of proof is a bit on the reporter to make sure that all the information is provided. In the past there's been a lot of owncloud reports in this project for example, and the default stance there too has been: Go talk to owncloud first and let their devs figure out if it's a sabre/dav problem.

That said, can you give me pointers how I can provide you with the information you asked for

I would dig into z-push and figure out if you can extract more information from that tool. There's also a possibility that the actual error ended up in a php or webserver error log.

@mbiebl
Copy link
Contributor Author

@mbiebl mbiebl commented Dec 6, 2017

Request

OPTIONS /addressbooks/michael@test.example.com/ HTTP/1.1
Host: localhost:8090
Authorization: Basic bWljaGFlbEB0ZXN0LmV4YW1wbGUuY29tOmZvb2Jhcg==
User-Agent: Z-Push CardDAV/0.6.c
Accept: */*
Depth: infinity
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

PROPFIND /addressbooks/michael@test.example.com/ HTTP/1.1
Host: localhost:8090
Authorization: Basic bWljaGFlbEB0ZXN0LmV4YW1wbGUuY29tOmZvb2Jhcg==
User-Agent: Z-Push CardDAV/0.6.c
Accept: */*
Depth: 1
Content-Length: 0
Content-Type: application/x-www-form-urlencoded

REPORT /addressbooks/michael@test.example.com/c8b21f7ee29d32748fab947f118e94ad/ HTTP/1.1
Host: localhost:8090
Authorization: Basic bWljaGFlbEB0ZXN0LmV4YW1wbGUuY29tOmZvb2Jhcg==
User-Agent: Z-Push CardDAV/0.6.c
Accept: */*
Content-type: text/xml; charset=utf-8
Depth: infinity
Content-Length: 248

<?xml version="1.0" encoding="utf-8"?>
<D:sync-collection xmlns:D="DAV:">
    <D:sync-token></D:sync-token>
    <D:sync-level>1</D:sync-level>
    <D:prop>
        <D:getetag/>
        <D:getlastmodified/>
    </D:prop>
</D:sync-collection>REPORT /addressbooks/michael@test.example.com/b93b0ee90d8e00a7eb05f7c6ed5860b0/ HTTP/1.1
Host: localhost:8090
Authorization: Basic bWljaGFlbEB0ZXN0LmV4YW1wbGUuY29tOmZvb2Jhcg==
User-Agent: Z-Push CardDAV/0.6.c
Accept: */*
Content-type: text/xml; charset=utf-8
Depth: infinity
Content-Length: 248

<?xml version="1.0" encoding="utf-8"?>
<D:sync-collection xmlns:D="DAV:">
    <D:sync-token></D:sync-token>
    <D:sync-level>1</D:sync-level>
    <D:prop>
        <D:getetag/>
        <D:getlastmodified/>
    </D:prop>
</D:sync-collection>REPORT /addressbooks/michael@test.example.com/c8b21f7ee29d32748fab947f118e94ad/ HTTP/1.1
Host: localhost:8090
Authorization: Basic bWljaGFlbEB0ZXN0LmV4YW1wbGUuY29tOmZvb2Jhcg==
User-Agent: Z-Push CardDAV/0.6.c
Accept: */*
Content-type: text/xml; charset=utf-8
Depth: infinity
Content-Length: 443

<?xml version="1.0" encoding="utf-8" ?>
<C:addressbook-multiget xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:carddav">
    <D:prop>
        <D:getetag/>
        <D:getlastmodified/>
        <C:address-data>
            <C:allprop/>
        </C:address-data>
    </D:prop>
    <D:href>/addressbooks/michael@test.example.com/c8b21f7ee29d32748fab947f118e94ad/1cd01f0e-8dec-4c62-90ad-649eabc4a6de.vcf</D:href>
</C:addressbook-multiget>

Response

HTTP/1.1 200 OK
Allow: OPTIONS, GET, HEAD, DELETE, PROPFIND, PUT, PROPPATCH, COPY, MOVE, REPORT
Content-Length: 0
Content-Type: text/html; charset=UTF-8
Accept-Ranges: bytes
Server: Microsoft-IIS/7.5
X-Powered-By: PHP/7.1.8
X-Sabre-Version: 3.2.1
DAV: 1, 3, extended-mkcol, addressbook, access-control, calendarserver-principal-property-search
MS-Author-Via: DAV
X-Powered-By: ASP.NET
Date: Wed, 06 Dec 2017 22:48:06 GMT

HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset=utf-8
Vary: Brief,Prefer
Server: Microsoft-IIS/7.5
X-Powered-By: PHP/7.1.8
X-Sabre-Version: 3.2.1
DAV: 1, 3, extended-mkcol, addressbook, access-control, calendarserver-principal-property-search
X-Powered-By: ASP.NET
Date: Wed, 06 Dec 2017 22:48:06 GMT
Content-Length: 870

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:card="urn:ietf:params:xml:ns:carddav"><d:response><d:href>/addressbooks/michael@test.example.com/</d:href><d:propstat><d:prop><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>/addressbooks/michael@test.example.com/c8b21f7ee29d32748fab947f118e94ad/</d:href><d:propstat><d:prop><d:resourcetype><d:collection/><card:addressbook/></d:resourcetype></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response><d:response><d:href>/addressbooks/michael@test.example.com/b93b0ee90d8e00a7eb05f7c6ed5860b0/</d:href><d:propstat><d:prop><d:resourcetype><d:collection/><card:addressbook/></d:resourcetype></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-Powered-By: PHP/7.1.8
X-Sabre-Version: 3.2.1
X-Powered-By: ASP.NET
Date: Wed, 06 Dec 2017 22:48:06 GMT
Content-Length: 1414

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:card="urn:ietf:params:xml:ns:carddav">
 <d:response>
  <d:href>/addressbooks/michael@test.example.com/c8b21f7ee29d32748fab947f118e94ad/a15b0579-4a46-4717-ae6d-4ad7ff1c7a98.vcf</d:href>
  <d:propstat>
   <d:prop>
    <d:getetag>&quot;076947af3a2705469cdb835d2262ce43&quot;</d:getetag>
    <d:getlastmodified>Wed, 06 Dec 2017 22:42:04 GMT</d:getlastmodified>
   </d:prop>
   <d:status>HTTP/1.1 200 OK</d:status>
  </d:propstat>
 </d:response>
 <d:response>
  <d:href>/addressbooks/michael@test.example.com/c8b21f7ee29d32748fab947f118e94ad/00d5c6c0-54fd-402e-a06e-2f13b0ef4e18.vcf</d:href>
  <d:propstat>
   <d:prop>
    <d:getetag>&quot;3949d320757353788f9566f0b0f2f798&quot;</d:getetag>
    <d:getlastmodified>Wed, 06 Dec 2017 22:43:45 GMT</d:getlastmodified>
   </d:prop>
   <d:status>HTTP/1.1 200 OK</d:status>
  </d:propstat>
 </d:response>
 <d:response>
  <d:href>/addressbooks/michael@test.example.com/c8b21f7ee29d32748fab947f118e94ad/1cd01f0e-8dec-4c62-90ad-649eabc4a6de.vcf</d:href>
  <d:propstat>
   <d:prop>
    <d:getetag>&quot;62f10da2ecf44dd0d1686a90d521ebf1&quot;</d:getetag>
    <d:getlastmodified>Wed, 06 Dec 2017 22:47:27 GMT</d:getlastmodified>
   </d:prop>
   <d:status>HTTP/1.1 200 OK</d:status>
  </d:propstat>
 </d:response>
 <d:sync-token>http://sabre.io/ns/sync/115832</d:sync-token>
</d:multistatus>
HTTP/1.1 207 Multi-Status
Content-Type: application/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-Powered-By: PHP/7.1.8
X-Sabre-Version: 3.2.1
X-Powered-By: ASP.NET
Date: Wed, 06 Dec 2017 22:48:06 GMT
Content-Length: 206

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:card="urn:ietf:params:xml:ns:carddav">
 <d:sync-token>http://sabre.io/ns/sync/4118</d:sync-token>
</d:multistatus>
HTTP/1.1 500 Internal Server Error
Content-Type: application/xml; charset=utf-8
Server: Microsoft-IIS/7.5
X-Powered-By: PHP/7.1.8
X-Sabre-Version: 3.2.1
X-Powered-By: ASP.NET
Date: Wed, 06 Dec 2017 22:48:06 GMT
Content-Length: 248

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:sabredav-version>3.2.1</s:sabredav-version>
  <s:exception>ErrorException</s:exception>
  <s:message>Undefined index: name</s:message>
</d:error>
@mbiebl
Copy link
Contributor Author

@mbiebl mbiebl commented Dec 6, 2017

Adding a debug print at https://github.com/sabre-io/dav/blob/master/lib/CardDAV/Xml/Filter/AddressData.php#L55 I get the following for $elems:

(
    [0] => Array
        (
            [name] => {urn:ietf:params:xml:ns:carddav}allprop
            [value] =>
            [attributes] => Array
                (
                )

        )

)

Notice how there is no elems['attributes']['name'] but only a elems['name']

@mbiebl
Copy link
Contributor Author

@mbiebl mbiebl commented Dec 7, 2017

@mbiebl
Copy link
Contributor Author

@mbiebl mbiebl commented Jan 19, 2018

@DeepDiver1975 any idea what's going wrong there and how this can be fixed?

DeepDiver1975 added a commit that referenced this issue Jan 19, 2018
DeepDiver1975 added a commit that referenced this issue Jan 19, 2018
@DeepDiver1975
Copy link
Member

@DeepDiver1975 DeepDiver1975 commented Jan 19, 2018

@mbiebl please give this pull request a try: #1025

DeepDiver1975 added a commit that referenced this issue Jan 19, 2018
DeepDiver1975 added a commit that referenced this issue Jan 19, 2018
DeepDiver1975 added a commit that referenced this issue Jan 19, 2018
DeepDiver1975 added a commit that referenced this issue Jan 22, 2018
…05c2fa8023f913

Properly parse carddav address-data - fixes #1017
staabm added a commit that referenced this issue Jan 22, 2018
@HLeithner
Copy link

@HLeithner HLeithner commented Mar 23, 2018

@DeepDiver1975 j4i #1025 fixed this problem for me, thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants