[Bug] Can't import all vCard | "faulty contacts"

I had to migrate to a new server with my Nextcloud. Now I need to copy all contacts from the old instance to the new one. I exported the address books via the Web App but when importing again, some of the contacts are not imported and the error says “23 faulty contacts”?

I tried the following ideas already:

  • .vcf files are UTF-8 encoded
  • vCard Versions are mixed, but all are either 3.0 or 4.0
  • I manually changed to BDAY format to ‘‘BDAY:YYYY-MM-DD’’

Nothing helped. Server log doesn’t give any error message. Any ideas how I can proceed from here? How can I debug the file to get all contacts really into new new instance?

Thank you for your help in advance.

Hi @earliestearl,

best way to get the developers attention might be to open an issue on Github: https://github.com/nextcloud/contacts/issues

Thank you for that idea. I will create an issue…

@earliestearl

it would be nice if you would post the link to the issue here… THAT would make the solution, at least in terms of this forum as it would show there’s nothing more to do for us here.

Thank you in advance

@earliestearldid you created an issue?

No, I didn’t create an issue yet because I am not able to isolate the problem and provide a useful example file. For a good issue, an overview over existing issues should be given. Unfortunately, I am not able to spend time on that problem at the moment. Sorry…

I have the same problem. Using the latest Android app I use the “backup contacts” feature that seems to upload all non-DAVx contacts in one single VCF file into the Nextcloud.

I thought I could use this VCF to move all contacts from internal Android to Nextcloud using the web contacts app.

But: Every single conact is refused as faulty (in my case 349 contacts). No error messages whatsoever in the Apache error log.

It would really be nice if Nextcloud was able to import its own export file.

Edit: https://github.com/nextcloud/contacts/issues/1360

Edit #2: Ah, OK, I see, everything is done with client JavaScript. The JavaScript console is full of errors (see F12).

bump

Scenario here: exporting all contacts as VCF form Nextcloud 13 (VCARD VERSION:3.0) and trying to import into a fresh install of Nextcloud 18.
25 out of 228 contacts reported as “Faulty”.

I have a user that is sharing contacts with a bunch of of other users (e.g. shared contacts), and this happens with importing personal contacts for a single user.

After some debugging it seems that UID values cause the problem, but the “how” is yet to be understood.

This is an example that won’t import:
UID:6e410eed-9333-4d4d-b219-0cd138c755a8

Here’s one that will import with no problem:
UID:0543ed71-d44f-4972-904f-2e92560b3929

Format seems to match, no duplicates, and “faulty” uids are not referenced anywhere else in the file. Also, running the same checks on all the contacts (e.g. all shared + personal) has the same result.
Removing any other key/value from the VCF makes for a faulty contact unless I remove UID.
Converting to vcard 4 doesn’t help.
Removing the line with UID makes import successful.
Removing the user and recreating this will make this issue go away (without touching the UIDs)

So this looks like junk left in the DB after a few create address book > import > delete operations.

Hope someone will find this helpful in future.

mb

Indeed, two contacts cannot share the same uid in the same addressbook :slight_smile:
I often wondered if it would make sense to automatically drop the uid, but this is also a nice duplicate detection

so what do you suggest here as a (final?) solution @skjnldsv?

Well, in a good and perfect world, I would reduce any required user interaction, meaning always allow moving the contact. But in another hand, an UID is super unique and the chances of having a contact with the same UID that is NOT the same contact are close to null.

In your use case, the contact that was failing, was it already imported in your addressbook?

I am new to Nextcloud and have just encountered the same problem. I managed to get the following workaround:

On Debian, select Contacts app and set it to sync with Nextcloud.
Import vCard into Evolution Mail Client and set it to import to Nextcloud. The contacts will transfer fine.