Radicale
Radicale copied to clipboard
Radicale fails when uploading a photo in a vcard
Hey!
Thanks for your work on radicale, the concept is awesome!
But I can’t get picture sync to work. I tried with multiple clients. (Evolution, Thunderbird (2 different plugins), Davdroid) This error was caused by a davdroid client:
Oct 08 22:58:36 charon.olymp.space radicale[7746]: [7f177c42a700] WARNING: Bad PUT request on '/maralorn/6effc8cc-5904-d0ab-0a36-b0e9b100ce19/d3d37a7d-b527-4839-a04d-c86bfaf51c15.vcf': Failed to store item 'd3d37a7d-b527-4839-a04d-c86bfaf51c15.vcf' in collection 'maralorn/6effc8cc-5904-d0ab-0a36-b0e9b100ce19': 'bytes' object has no attribute 'encode'
I get this everytime a client trys to PUT a VCARD with a profile picture.
Im running nixos 2017.09 with radicale 2.1.6 and python3-3.6.2. The changelog does not look like this would be better in radicale 2.1.8.
Any ideas what is going wrong?
(I can get the Pictures to the server by manually rsyncing vcards, but then the server does not synchronize them back to the clients.)
Regards, maralorn
could not be reproduced. sync to the server and from the server to the client works. I am running radicale 2.1.8. and Thunderbird 52.3.0
maybe something on your server side
Most likely something on my server side. But the error message looks like a python error. If it is not a bug in the code it would be a wrong library version. Or even a python2/python3 issue. It all seems very unlikely.
@cdpd Which plugin do you use with thunderbird?
I will try if I can get radicale 2.1.8 installed.
I am using python 3.6.1 and Thunderbird SoGO Connector 31.0.3
Just checkout ee3fb71f7db7477e87bf0ab7a900dfbad2500d54 (Version 2.1.6) and test it in Docker. It didn't work, but without any errors - the tested config & image is minimal but I used the same with 2.1.8 and it works, so your problem will probably be fixed if you update to 2.1.8.
Good luck
Any ideas what is going wrong?
Start radicale with the --debug
argument and try to upload an example VCARD with picture.
Post the logging output here. (I'm only interested in the content of the VCARD and the full stack trace.)
I also had this problem with z-push and after I changed backend/carddav.php from: $data .= 'PHOTO;ENCODING=BASE64;TYPE=JPEG:'."\n\t".substr(chunk_split($message->picture, 50, "\n\t"), 0, -1); to $data .= 'PHOTO;ENCODING=b;TYPE=JPEG:'."\n\t".substr(chunk_split($message->picture, 50, "\n\t"), 0, -1);
my problem was solved. I have noticed that some clients are using encoding=base64 while others are using encoding=b maybe that is the problem with above clients. I have notice the same behavior with for example outlookcaldavsynchronizer.
I have the same issue.
@Unrud Here is debuging log for the time period I synced my contacts (and calendar, sorry for that noise). Contact syncing fails with the same error as in the OP: radicale.log
(I modified the log slightly in an attempt to hide some personal information about the contact. I hope I didn't break the VCARD otherwise.)
Any ideas how to fix or work around?
EDIT: I synced with Davdroid if it matters.
Upgrading vobject from 0.9.3 to 0.9.5 fixed this issue for me.
This is still an issue, even with vobject 0.9.5 having radicale 2.1.8. Changing 'BASE64' to 'b' solves the problem. Maybe still a vobject issue?
The following change fixed my issue. From what I understand, this is a vobject issue. https://github.com/Kozea/Radicale/issues/1238#issuecomment-1352530048