-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Validation error in vCard: ENCODING=BASE64 is not valid for this document type #3366
Comments
Can you provide us with the vcard you are trying to import? |
I have this error too. Here a vCard that cannot be imported, resulting in the error above:
|
I use Z-Push and have the same problem when changing contacts with pictures. Is there any solution? |
cc @georgehrke |
Same problem when syncing from my BlackBerry Passport, using Vcard format 2.1 if I recall correctly. Gist : https://gist.github.com/Webbeh/4b544a82714136dc1962deef4cc03fe3 Can't, sadly, attach the VCard, because BlackBerry doesn't export them in the same way if you do it manually. EDIT: |
Works for me as well. Could we add this a offical fix? |
I had the same problem and Webbeh's solution is working for me as well. |
I understand that ENCODING=BASE64 is not valid in the official DAV specifications, but accepting it adds compatibility with poorly written implementations, and I don't think it would actually hurt to add it. |
I updated the GIST with the same error on 13.0.2.1. Fixed in the same way, adding "BASE64" as allowed encoding in Property.php for vCard v3. UPDATE : Same fix in 13.0.4 UPDATE 2 : |
Can this be merged? This is an annoying issue... |
Don't mind, I now see it's a 3rd party library. |
Bump! The issue |
sabre-io/vobject#415 (comment)
sabre-io/vobject#415 (comment)
What do you suggest? First this needs to be fixed in |
I suggested a PR for this to finally be resolved upstream, with a proper repairing of the vCard instead of a simple hack to allow the badly formatted one to pass. Hopefully this will be solved quite soon. |
This has now been resolved upstream, with the aforementioned PR. Sorry danielkesselberg, went for 1b :) |
That’s great, many thanks!
So how will Nextcloud be updated from an upstream update? Do you merge
updates in sabre and other libraries once in a while?
|
3rdparty? https://github.com/nextcloud/3rdparty/ this repository is linked to this repository as git submodule. Dependencies are updated there. I would go for 1a like i did here for the same dependency: https://github.com/nextcloud/3rdparty/pull/191/files (wget https://patch-diff.githubusercontent.com/raw/sabre-io/vobject/pull/441.patch, patch < 441.patch and commit changes to 3rdparty repository, setup a new pr) |
Wow still not merged |
Still a problem. I believe it is premature to drop vCard v2.1 support since android exports in v2.1 format to these days, as a result I can't sync or import contacts |
PR was merged and our version of sabre already contains the patch. Is there something left to do? |
Hi, please update to at least 23.0.12 and report back if it fixes the issue. Thank you! |
Steps to reproduce
Expected behaviour
All contacts will be imported with their respective images
Actual behaviour
Contacts containing
PHOTO;TYPE=JPEG;ENCODING=BASE64:/9j/4AA...
get rejected with a log entry like this:
`{"reqId":"cfFVmtgvP4awyLzSyMV3","remoteAddr":"10.8.0.6","app":"webdav","message":"Exception: {"Message":"HTTP\/1.1 415 Validation error in vCard: ENCODING=BASE64 is not valid for this document type.","Exception":"Sabre\\DAV\\Exception\\UnsupportedMediaType","Code":0,"Trace":"#0 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/CardDAV\/Plugin.php(316): Sabre\\CardDAV\\Plugin->validateVCard('BEGIN:VCARD\\r\\nVE...', false)\n#1 [internal function]: Sabre\\CardDAV\\Plugin->beforeCreateFile('addressbooks\/us...', 'BEGIN:VCARD\\r\\nVE...', Object(OCA\\DAV\\CardDAV\\AddressBook), false)\n#2 \/var\/www\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#3 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(1070): Sabre\\Event\\EventEmitter->emit('beforeCreateFil...', Array)\n#4 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(525): Sabre\\DAV\\Server->createFile('addressbooks\/us...', 'BEGIN:VCARD\\r\\nVE...', NULL)\n#5 [internal function]: Sabre\\DAV\\CorePlugin->httpPut(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#6 \/var\/www\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#7 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(479): Sabre\\Event\\EventEmitter->emit('method:PUT', Array)\n#8 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(254): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#9 \/var\/www\/nextcloud\/apps\/dav\/lib\/Server.php(227): Sabre\\DAV\\Server->exec()\n#10 \/var\/www\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php(30): OCA\\DAV\\Server->exec()\n#11 \/var\/www\/nextcloud\/remote.php(165): require_once('\/var\/www\/nextcl...')\n#12 {main}","File":"\/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/CardDAV\/Plugin.php","Line":397,"User":"beccon"}","level":4,"time":"2017-02-03T17:32:56+00:00","method":"PUT","url":"/nextcloud/remote.php/dav/addressbooks/users/beccon/contacts/a0a74a88-f56b-4005-8b45-d0bd490f366c.vcf","user":"beccon","version":"11.0.1.2"}
`
The text was updated successfully, but these errors were encountered: