Sync fails with "PREF parameter value is malformed and could not be parsed"

0

DAVdroid 1.3.4.1-ose
Nextcloud 10.0.2

One contact failed the sync. It had the following line:
EMAIL;PREF=;INTERNET=;TYPE=WORK:abc@xz.com

Stacktrace of error>
EXCEPTION java.lang.IllegalStateException: [Error 15] PREF parameter value is malformed and could not be parsed. Retrieve its raw text values instead by calling property.getParameters().get("PREF").
at ezvcard.parameter.VCardParameters.getPref(VCardParameters.java:1025)
at ezvcard.property.VCardProperty.getPref(VCardProperty.java:422)
at ezvcard.property.Email.getPref(Email.java:110)
at at.bitfire.vcard4android.AndroidContact.insertEmail(AndroidContact.java:872)
at at.bitfire.vcard4android.AndroidContact.insertDataRows(AndroidContact.java:720)
at at.bitfire.davdroid.resource.LocalContact.insertDataRows(LocalContact.java:98)
at at.bitfire.vcard4android.AndroidContact.create(AndroidContact.java:647)
at at.bitfire.davdroid.syncadapter.ContactsSyncManager.processVCard(ContactsSyncManager.java:442)
at at.bitfire.davdroid.syncadapter.ContactsSyncManager.downloadRemote(ContactsSyncManager.java:350)
at at.bitfire.davdroid.syncadapter.SyncManager.performSync(SyncManager.java:170)
at at.bitfire.davdroid.syncadapter.ContactsSyncAdapterService$ContactsSyncAdapter.onPerformSync(ContactsSyncAdapterService.java:66)
at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259)
Caused by: java.lang.NumberFormatException: Invalid int: ""
at java.lang.Integer.invalidInt(Integer.java:138)
at java.lang.Integer.parseInt(Integer.java:358)
at java.lang.Integer.parseInt(Integer.java:334)
at java.lang.Integer.valueOf(Integer.java:525)

0

As a general remark, nextcould/owncloud problems are quite often the fault of "upstream", i.e. the *cloud calendar-app not generating valid files.

The title says it all: the VCARD is quite some garbage.

From RFC6350

The PREF parameter is OPTIONAL ... its value MUST be an integer between 1 and 100 that quantifies the level of preference.
ABNF:

       pref-param = "PREF=" (1*2DIGIT / "100")
                            ; An integer between 1 and 100.

So please refer to the nextcloud system.

0

I fully agree with you, that the entry is out of spec, and I deleted the "PREF=" tag. I believe it was another client setting the tag, not own-/nextcloud, as it was the only entry with that error in it.

However, I think that more users could have this issue. So rather than failing sync, I think it would be better practice to ignore that error and maybe issue a warning.
That will keep more users happy with DAVdroid.

(these errors are the reason why i tried an deinstalled DAVdroid before; CardDAV-Sync just syncs)

0

Please follow up here: https://forums.bitfire.at/topic/1144/owncloud-returns-invalid-pref-value

Temporal relations are not necessarily causal relations.

Log in to reply

Looks like your connection to Bitfire App Forums was lost, please wait while we try to reconnect.