VCard object with uid already exists in this addressbook collection

I got the following error from my nextcloud cron job recently:


Sabre\DAV\Exception\BadRequest: VCard object with uid already exists in this addressbook collection. in /var/www/nextcloud/apps/dav/lib/CardDAV/CardDavBackend.php:667
Stack trace:
#0 /var/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php(276): OCA\DAV\CardDAV\CardDavBackend->createCard()
#1 /var/www/nextcloud/apps/dav/lib/AppInfo/Application.php(231): OCA\DAV\CardDAV\SyncService->updateUser()
#2 /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(264): OCA\DAV\AppInfo\Application->OCA\DAV\AppInfo\{closure}()
#3 /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(239): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch()
#4 /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#5 /var/www/nextcloud/lib/private/EventDispatcher/SymfonyAdapter.php(123): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#6 /var/www/nextcloud/lib/private/Accounts/AccountManager.php(278): OC\EventDispatcher\SymfonyAdapter->dispatch()
#7 /var/www/nextcloud/lib/private/Accounts/AccountManager.php(765): OC\Accounts\AccountManager->updateUser()
#8 /var/www/nextcloud/apps/settings/lib/BackgroundJobs/VerifyUserData.php(284): OC\Accounts\AccountManager->updateAccount()
#9 /var/www/nextcloud/apps/settings/lib/BackgroundJobs/VerifyUserData.php(103): OCA\Settings\BackgroundJobs\VerifyUserData->resetVerificationState()
#10 /var/www/nextcloud/cron.php(127): OCA\Settings\BackgroundJobs\VerifyUserData->execute()
#11 {main}

It seemed to happen three times and then stop. Is it anything to be concerned about?

We have the same problem here.

In the Admin / Overview page, I get “Last background job execution ran 1 hour ago. Something seems wrong.”
In the Admin / Basic settings page, I get “Last job execution ran 1 hour ago. Something seems wrong.”
We use “Cron” for Background jobs option.

When running cron.php manually (using “sudo -u apache /usr/bin/php -f /var/www/nextcloud/cron.php”), I get following error:

Sabre\DAV\Exception\BadRequest: VCard object with uid already exists in this addressbook collection. in /var/www/nextcloud/apps/dav/lib/CardDAV/CardDavBackend.php:667
Stack trace:
#0 /var/www/nextcloud/apps/dav/lib/CardDAV/SyncService.php(276): OCA\DAV\CardDAV\CardDavBackend->createCard('2', 'Database:sal.vc...', 'BEGIN:VCARD\r\nVE...')
#1 /var/www/nextcloud/apps/dav/lib/AppInfo/Application.php(231): OCA\DAV\CardDAV\SyncService->updateUser(Object(OC\User\User))
#2 /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(264): OCA\DAV\AppInfo\Application->OCA\DAV\AppInfo\{closure}(Object(OC\EventDispatcher\GenericEventWrapper), 'OC\\AccountManag...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#3 /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(239): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'OC\\AccountManag...', Object(OC\EventDispatcher\GenericEventWrapper))
#4 /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners(Array, 'OC\\AccountManag...', Object(OC\EventDispatcher\GenericEventWrapper))
#5 /var/www/nextcloud/lib/private/EventDispatcher/SymfonyAdapter.php(123): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(OC\EventDispatcher\GenericEventWrapper), 'OC\\AccountManag...')
#6 /var/www/nextcloud/lib/private/Accounts/AccountManager.php(278): OC\EventDispatcher\SymfonyAdapter->dispatch('OC\\AccountManag...', Object(Symfony\Component\EventDispatcher\GenericEvent))
#7 /var/www/nextcloud/lib/private/Accounts/AccountManager.php(765): OC\Accounts\AccountManager->updateUser(Object(OC\User\User), Array, true)
#8 /var/www/nextcloud/apps/settings/lib/BackgroundJobs/VerifyUserData.php(284): OC\Accounts\AccountManager->updateAccount(Object(OC\Accounts\Account))
#9 /var/www/nextcloud/apps/settings/lib/BackgroundJobs/VerifyUserData.php(103): OCA\Settings\BackgroundJobs\VerifyUserData->resetVerificationState()
#10 /var/www/nextcloud/cron.php(127): OCA\Settings\BackgroundJobs\VerifyUserData->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))
#11 {main}

But we even don’t use CardDAV and CalDAV - and the “Contacts” App is disabled.

We are currently running on 22.2.0.

I have created a github issue for Nextcloud here. I mentioned your issue, but perhaps you would like to add you experience to the issue as multiple reports might be taken more seriously.