[Bug] Syntax error. The contact cannot be opened, EMAIL PREF

I swear I searched this forum.
I swear I searched with google first!
I swear I tried to solve the problem myself!!

After these preliminaries … I would like to ask if anybody else has encountered a problem like this or might help me with solving it:
I have more than 300 contacts that I synced from my outlook via carddav to Nextcloud.
When I select a contact, in the contacts app in Nextcloud, in the overview to show the details for the contact, for some contacts a message pops up within the browser window:
“Syntaxfehler. Der Kontakt kann nicht geöffnet werden.” (rough translation:
"Syntax error. The contact cannot be opened)
and the contact disappears from the overview. Choosing a different app and the the contacts app brings the contact again (in the overview).
That happens only to some contacts. Other contacts make no problem at all.
There is no error in the logs of Nextcloud and I don’t know where else to look.
Downloading the database as XML shows no really difference between contacts that can be displayed and contacts that cannot be displayed. Any idea how I can check the integrity of the contacts or what else to do or where to look?

This behavior shows up since some time …

I am running Nextcloud 18.0.3 an all apps are updated.

Thanks

Stefan

Good to here that not all of the contacts are impacted, so there is a chance to find the root cause of the problem.
Have you checked the Nextcloud log file for any related messages when you try to open such a contact? Can you export an impacted contact to a vcf file and post the content here. (Please make sure to anonymize the data :wink:)

Here you will find a vCard validator to test the syntax of an invalid data set.

Sorry that it took me so long to answer but to use the vCard validator I had to set up a linux environment via Hyper-V at Windows 10 and that took some time …
Anyhow the vCard validator did not run because of a syntax error:

Anyhow, I solved the problem! Contacts is some what picky regarding formats and categories.

  1. In one address I had to replace a “-” as last name.
  2. For what ever reasons a lot of addresses had the following syntax for mail addresses:
    EMAIL;PREF:name@domain.TLD <- This crashed the app. After changing to:
    EMAIL;TYPE=INTERNET;TYPE=HOME:name@domain.TLD
    -> everything was good!!!
    In my android app the first syntax showed “sonstige” (diverse) as type. When I changed type to home or work everything was fine!

Well, yep, yours was not compliant to the vcard rfc :slight_smile:
EMAIL;PREF:name@domain.TLD needs to be EMAIL;PREF=1:name@domain.TLD
https://tools.ietf.org/html/rfc6350

Glad it’s fixed! :rocket: