nextcloud / contacts

📇 Contacts app for Nextcloud
https://apps.nextcloud.com/apps/contacts
GNU Affero General Public License v3.0
569 stars 172 forks source link

Contacts edited on phone and synced through DAVx5 throw error due to incompatible date format #3712

Open Slater91 opened 1 year ago

Slater91 commented 1 year ago

Describe the bug

I edited one of my contacts to add the birthday date on my phone (running stock Android 13). The phone syncs automatically to Nextcloud using DAVx5. DAVx5 reports error 500 as the server rejects the edit. This is what the log says:

HTTP REQUEST
Request{method=PUT, url=https://nextcloud.mydomain.com/remote.php/dav/addressbooks/users/riccardo/contacts/22e0034b-a113-400f-82de-83bda25ece6f.vcf, headers=[If-Match:"d28890481dc2f7efb662a5daf3fa8728", User-Agent:DAVx5/4.3.9-ose (2023/10/29; dav4jvm; okhttp/4.12.0) Android/13, Accept-Language:pl-PL, pl;q=0.7, *;q=0.5]}
BEGIN:VCARD
VERSION:4.0
PRODID:+//IDN bitfire.at//DAVx5/4.3.9-ose ez-vcard/0.12.1
UID:22e0034b-a113-400f-82de-83bda25ece6f
FN:John Smith
N:Smith;John;;;
TEL;TYPE=cell:+44 0000 000000
BDAY:19531123
REV:20231118T095802Z
END:VCARD

HTTP RESPONSE
Response{protocol=h2, code=500, message=, url=https://nextcloud.mydomain.com/remote.php/dav/addressbooks/users/riccardo/contacts/22e0034b-a113-400f-82de-83bda25ece6f.vcf}
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:exception>OC\DB\Exceptions\DbalException</s:exception>
  <s:message>An exception occurred while executing a query: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xF0\x9F\x8E\x82 A...' for column `nextcloud`.`oc_calendarobjects_props`.`value` at row 1</s:message>
</d:error>

This seems superficially related to #122.

Steps to reproduce

  1. Edit a contact on Android
  2. Sync it with DAVx5

Expected behavior

The contact syncs correctly.

Actual behavior

An error is thrown as the system complains the date is in the wrong format.

Contact version

5.4.2

Operating system

Debian

PHP engine version

Other

Web server

Apache (supported)

Database

MySQL

Additional info

No response

robi-00 commented 10 months ago

try to disable the second feature (Birthday calendars) on groupware setting in nextcloud Calendar server Birthday calendars will be generated by a background job. Hence they will not be available immediately after enabling but will show up after some time

on my site this helps as workaround

darksnakezero commented 10 months ago

Same Problem for me. The workaround by robi-00 worked for me too.

Still I d like this fixed because I use the contacts birthday feature.

MichaelPihlblad commented 7 months ago

same problem here. issue posted in calendar repo: https://github.com/nextcloud/calendar/issues/5716