Open nurtext opened 9 years ago
Traced down the error:
[2015-09-05T12:47:45+00:00] "Error while sending QUERY packet. PID=8159" vendor/sabre/dav/lib/CardDAV/Backend/PDO.php:538
Occurs when trying to import 132 contacts from my local address book. Will investigate further…
@nurtext I don't know this plugin very well so far. Maybe @evert can help?
Maybe all that's missing is whitelisting a few paths with the pathFilter
(see: http://sabre.io/dav/property-storage/).
Wanted to look into this, but on OS X 10.11 I couldn't set up a CardDAV account for katana at all. Contacts.app always tries to do PROPFINDs on /
, /principals/
and /.well-known/carddav
and doesn't prefix /server.php
. Also couldn't make it work with BusyContacts. Maybe on 10.11 the only way is to set up proper URL rewriting.
@DominikTo Hmm, ok, it requires more work then.
@DominikTo did you try setting it up with the full principal url?
@evert Yup, tried that, but on 10.11 Contacts.app always requests /
, /principals/
and /.well-known/carddav
regardless, which results in 405s (I think those are generated by Apache itself). That seems to cause the problem with Contacts.app.
But BusyContacts also doesn't properly bootstrap the account - with BusyContacts however I don't see any failed requests. It just stops and shows an "Unable to connect alert".
One thing I noticed is that BusyContacts tries to figure out addressbook-home-set
on /server.php/principals/
(which isn't included in the response). Looks a bit like BusyContacts has trouble to find /server.php/principals/admin
to request the addressbook-home-set
there.
@Hywan Setting up the pathFilter would be a quick fix - if I could test with a client. :-)
Did you try an extra slash behind admin? Can make all the difference (for both clients).
Also for both of them we might want to consider reporting bugs, because this might burn us in the future too...
Full principal URL with a /
at the end indeed helped with BusyContacts. Thanks! :+1:
BTT: Seems one of my vCards was faulty. I now have all vCards imported and "Me card" feature works using the code from my PR. Is it going to be merged?
Interesting that it's working for @nurtext. For me -at least with BusyContacts- setting the me-card doesn't result in anything getting stored in the property storage. Even with a pathFilter
that just returns true
for every path.
Request
PROPPATCH /server.php/addressbooks/admin/ HTTP/1.1
Host: sabre-katana.local
Content-Type: text/xml; charset=UTF-8
Accept-Encoding: gzip, deflate
Content-Length: 535
Connection: keep-alive
Accept: */*
User-Agent: BusyContacts-1.0.5
Authorization: Basic foo
Cache-Control: no-cache
Accept-Language: en-us
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<d:propertyupdate xmlns:d="DAV:" xmlns:a="urn:ietf:params:xml:ns:carddav" xmlns:b="http://calendarserver.org/ns/">
<d:set>
<d:prop>
<b:me-card>
<d:href>/server.php/addressbooks/admin/126668e3-8706-4a94-8b1c-c49749846de8/70C331B4-7D9F-428B-9D40-777BA2A4BD3A.vcf</d:href>
</b:me-card>
<a:principal-address>
<d:href>/server.php/addressbooks/admin/126668e3-8706-4a94-8b1c-c49749846de8/70C331B4-7D9F-428B-9D40-777BA2A4BD3A.vcf</d:href>
</a:principal-address>
</d:prop>
</d:set>
</d:propertyupdate>
Response
HTTP/1.1 207 Multi-Status
Date: Mon, 07 Sep 2015 13:36:17 GMT
Server: Apache/2.4.16 (Unix) PHP/5.5.27
X-Powered-By: PHP/5.5.27
X-Sabre-Version: 3.0.1
Vary: Brief,Prefer
Content-Length: 453
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/xml; charset=utf-8
<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:card="urn:ietf:params:xml:ns:carddav" xmlns:cal="urn:ietf:params:xml:ns:caldav" xmlns:cs="http://calendarserver.org/ns/">
<d:response>
<d:href>/server.php/addressbooks/admin</d:href>
<d:propstat>
<d:prop>
<cs:me-card/>
<card:principal-address/>
</d:prop>
<d:status>HTTP/1.1 200 OK</d:status>
</d:propstat>
</d:response>
</d:multistatus>
It should either have been set in propertystorage, or pathfilter would have caused it to return a 403. Are you looking at the right table and database @DominikTo ?
Haha, yes. ;-) But no 403. Will check later by always returning false from the pathFilter.
Interesting: That "Error while sending QUERY packet" message seems to be an error with large MySQL inserts. Will try to raise max_allowed_packet
. Seems none of my vCards was faulty but had large images embedded.
God I hate mysql for stuff like that :/
Yes, me too. But at least it has nothing to do with Katana itself, which is a good thing actually :)
@nurtext It can be related to sabre/katana because our schemas can not be well-designed :-/.
This will take a bit longer to integrate, because there's problems with sabre/katana's schema. Once #292 is integrated, this can be integrated too.
Allows "Me card" feature on OS X Address book. Sadly not closing #289, sync still fails: