jobisoft / DAV-4-TbSync

Mozilla Public License 2.0
161 stars 26 forks source link

Synology: XML error when server sends large (response-) XML (HTTPS only) #59

Closed danielbierstedt closed 5 years ago

danielbierstedt commented 5 years ago

Your environment

Synology NAS with built in CardDAV server

TbSync version: 0.7.22 DAV-4-TbSync version: Provider für CalDAV & CardDAV 0.10 Thunderbird version: 60.3.3

[ ] Yes, I have installed the latest available (beta) version from

Expected behavior

Contacts synced

Actual behavior

Throws XML error when syncing a contact with a profile pic

Steps to reproduce

...

To help resolving your issue, enable debug logging (TbSync Account Manager -> Help) and send me the debug.log via e-mail (use the title of your issue as subject of the email). Done

grobian commented 1 year ago

Just to add some onto this. I recently discovered I had this problem using Baïkal (SabreDav) via PHP fpm and nginx's fastcgi. (Nothing Synology related here.) It turns out that Apple's tools ignore the broken off XML, and somehow seem to be able to parse whatever was received, so I never noticed, as it looked ok.

Now I did run into this problem while attempting to use my contacts in Thunderbird. I found in SabreDAV's documentation that PHP's output buffering should be off:

output_buffering=off

In my setup it was set to the "development" or "production" value 4096. Once I set it it to off and restarted php-fpm, things started to work without issues. nginx warns it has to use a tempfile, but that's ok, no more errors now and the contacts can be read properly. (Actually, Apple's tools now are able to read the full contact and update them, so this was a real server-side fix.)

Hope this information is useful for others running into this error.