When I create a new contact it will not be saved the first time or saving gets stuck when I add further information. When I highlight another contact and go back to the edited one I get a message (german) "Dieser Kontakt war defekt und wurde korrigiert. Bitte überprüfe den Inhalt und klicke hier, um ihn zu speichern." meaning that the contact has been defekt an has been corrected. The details of the contact are gone than.
When I then add the details again I can update the contact by clicking an arrow at the right near the saving sign. This problem reproduces whether logged in as an admin or normal user.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Saving should always work.
Actual behavior
Contact saving hangs, editings are lost
Operating system: Ubuntu 18.04 on a Rock Pi
Web server: Server version: Apache/2.4.29 (Ubuntu)
Server built: 2019-09-16T12:58:48
Database: MariaDB
PHP version: 7.2.
Nextcloud version: 18.0.0
Contacts version: 3.1.8
Updated from an older Nextcloud or fresh install: Fresh Install
Signing status:
```
Login as admin user into your Nextcloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here.
No errors has been found
Hello!
I will need your browser console log to investigate this issue.
Open your console, reload your page and/or do the action leading to this issue and copy/paste the log in this thread.
How to access your browser console (Click to expand)
Hallo @skjnldsv , here is the output of the Firefox Console. When I pressed the "Add new contact" the logentry "This contact did not have a proper uid. Setting a new one for ...." is generated. Hope that helps. If not I will install Firebug on my Ubuntu. But may be that I reply a few days later because I'm busy at the moment.
Regards
Frank
console-export-2020-2-4_16-52-0.txt
Error: dist.js:1:56302
uncaught exception: Object
Can you take a screenshot of the expanded log matching this part please? :)
Had that error too! Did some other stuff on the server and now it works.
Probably just a webserver restart fixed it.
Had that error too! Did some other stuff on the server and now it works.
Probably just a webserver restart fixed it.
Thank for the hint!
I just needed to restart Apache. No other changes necessary :-)
EDIT: sorry, this was not reliable. Now I have https://github.com/nextcloud/contacts/issues/1452
same problem here:
jquery-migrate.min.js:2 JQMIGRATE: Migrate is installed, version 1.4.1
globals.js:26 oc_config is deprecated: use OC.config instead
He @ globals.js:26
ProxyBus.js:74 Proxying an event bus of version 0.2.1 with 1.1.2
t @ ProxyBus.js:74
globals.js:26 oc_config is deprecated: use OC.config instead
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
globals.js:26 The escapeHTML library is deprecated! It will be removed in nextcloud 19.
He @ globals.js:26
contact.js:72 This contact did not have a proper uid. Setting a new one for taddressbook: (...)conflict: (...)dav: (...)jCal: (...)vCard: (...)displayName: (...)email: (...)firstName: (...)fullName: (...)groups: (...)key: (...)kind: (...)lastName: (...)org: (...)photo: (...)photoUrl: (...)properties: (...)rev: (...)searchData: (...)title: (...)uid: (...)url: (...)version: (...)__ob__: Ct {value: t, dep: ft, vmCount: 0}get addressbook: ƒ ()set addressbook: ƒ (e)get conflict: ƒ ()set conflict: ƒ (e)get dav: ƒ ()set dav: ƒ (e)get jCal: ƒ ()set jCal: ƒ (e)get vCard: ƒ ()set vCard: ƒ (e)__proto__: Object
/nextcloud/remote.php/dav/addressbooks/users/roger/contacts/EE512551-A9AB-4F6A-AECF-8AA4B3AF025C.vcf:1 Failed to load resource: the server responded with a status of 400 ()
dist.js:1 Uncaught (in promise) Error
at XMLHttpRequest.regeneratorRuntime.async.f.abrupt.a.onreadystatechange (dist.js:1)
Dear @skjnldsv , today there is no "uncaught exception: Object". It just says "Error: dist.js:1:56302"

Others meant, that restarting Apache did solve the problem. No. It did not for me.
Regards
Frank
So we all agree that this happens on all contacts? Not only new ones?
I have the same config as @BeFrankly + PLESK. Same Errors
[webdav] Fatal: Sabre\DAV\Exception\BadRequest: VCard object with uid already exists in this addressbook collection. at <<closure>>
0. /var/www/vhosts/cloud.domain.tld/httpdocs/3rdparty/sabre/dav/lib/CardDAV/AddressBook.php line 144
OCA\DAV\CardDAV\CardDavBackend->createCard("3", "83F962B4-E999-4 ... f", "BEGIN:VCARD\r\n ... D")
1. /var/www/vhosts/cloud.domain.tld/httpdocs/3rdparty/sabre/dav/lib/DAV/Server.php line 1096
Sabre\CardDAV\AddressBook->createFile("83F962B4-E999-4 ... f", "BEGIN:VCARD\r\n ... D")
2. /var/www/vhosts/cloud.domain.tld/httpdocs/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 525
Sabre\DAV\Server->createFile("addressbooks/us ... f", "BEGIN:VCARD\r\n ... D", null)
3. <<closure>>
Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
4. /var/www/vhosts/cloud.domain.tld/httpdocs/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
undefinedundefinedcall_user_func_array([Sabre\DAV\CorePlugin {},"httpPut"], [Sabre\HTTP\Requ ... }])
5. /var/www/vhosts/cloud.domain.tld/httpdocs/3rdparty/sabre/dav/lib/DAV/Server.php line 479
Sabre\Event\EventEmitter->emit("method:PUT", [Sabre\HTTP\Requ ... }])
6. /var/www/vhosts/cloud.domain.tld/httpdocs/3rdparty/sabre/dav/lib/DAV/Server.php line 254
Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
7. /var/www/vhosts/cloud.domain.tld/httpdocs/apps/dav/lib/Server.php line 317
Sabre\DAV\Server->exec()
8. /var/www/vhosts/cloud.domain.tld/httpdocs/apps/dav/appinfo/v2/remote.php line 35
OCA\DAV\Server->exec()
9. /var/www/vhosts/cloud.domain.tld/httpdocs/remote.php line 163
undefinedundefinedrequire_once("/var/www/vhosts ... p")
PUT /remote.php/dav/addressbooks/users/agentur/contacts/83F962B4-E999-446C-B82A-8FB8D2E879CB.vcf
from 87.139.18.144 by agentur at 2020-02-06T16:24:38+00:00
UPDATE: checked with 3.1.6 on same machine - no problem.
With 3.1.8 this problem appears
Oh, I must have stepped into a wasp nest. So many users reporting this issue now.
To answer @skjnldsv question: In my configuration this happens only with new created contacts. If Nextcloud had fixed the contact (like it does as I described above) these contact work normal afterwards.
@skjnldsv, are you not able to reproduce the error? Should I help with further details after installing firebug. I do not want to, but if it helps, i will.
Regards
Frank
In my configuration this happens only with new created contacts.
Same here
So we all agree that this happens on all contacts? Not only new ones?
@skjnldsv new contact creation seems to be the trigger. Existing contacts are fine for me.
NC 17.0.3.1, contacts 3.1.8, debian 10.2, PostgreSQL 11.5
Select "new contact", new contact frame is displayed, with exclamation mark mentioning it's not being synchronized. While making first changes of one of the contact fields, the update circle in the right starts spinning and remains spinning (hang as reported issue, with same log entry). Seems after that, no changes are being committed to this new contact. Refreshing the browser at that moment (F5) displays part of the changes of the new contact, spinning circle is gone, and the contact can be edited without issues.
Some days have gone since the last post and nothing new here since then. I'm wondering why this thread has the "need info" flag. What info is needed?
Issue still exist in NC 18.0.1 on Ubuntu 18.04.4 LTS.
It only affects to newly created contacts. It concerns the entire CardDAV interface to other applications.

same problem here on 2 different setups:
Setup A: shared webspace, MySQL 5.7.29 PHP 7.1.33 adressbook with >1500 entries
Setup B: Ubuntu 18.04 Apache, Postgresql 11.7, PHP 7.2.27, adressbook with <100 entries
Happens both in Firefox and Chrome.
Steps to reproduce:
1) click create a new contact
2) start writing a name, wait for the first save
3) keep writing in the name, or any other field
--> save-spinner keeps spinning, changes and any further changes of other contacts are not saved anymore!
Expected behaviour:
After creating a new contact, further edits are automatically saved.
Problem does not occur when editing exisiting contacts. "Create new" is the problem.
Workaround:
Reload of contacts app by pressing F5 in Browser after step 2 (new contact created)
I would consider this a critical bug, because data gets lost (input not saved)
Is it possible to downgrade the app to 3.1.6 (by replacing the files in the app folder), or will it cause any DB problems?
same problem here, same stacktrace in the log.
[webdav] Fatal: Sabre\DAV\Exception\BadRequest: VCard object with uid already exists in this addressbook collection. at <<closure>>
0. /snap/nextcloud/19063/htdocs/3rdparty/sabre/dav/lib/CardDAV/AddressBook.php line 144
OCA\DAV\CardDAV\CardDavBackend->createCard("3", "C4DAF5B6-E8DB-4 ... f", "BEGIN:VCARD\r\n ... D")
1. /snap/nextcloud/19063/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php line 1096
Sabre\CardDAV\AddressBook->createFile("C4DAF5B6-E8DB-4 ... f", "BEGIN:VCARD\r\n ... D")
2. /snap/nextcloud/19063/htdocs/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 525
Sabre\DAV\Server->createFile("addressbooks/us ... f", "BEGIN:VCARD\r\n ... D", null)
3. <<closure>>
Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
4. /snap/nextcloud/19063/htdocs/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
call_user_func_array([Sabre\DAV\CorePlugin {},"httpPut"], [Sabre\HTTP\Requ ... }])
5. /snap/nextcloud/19063/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php line 479
Sabre\Event\EventEmitter->emit("method:PUT", [Sabre\HTTP\Requ ... }])
6. /snap/nextcloud/19063/htdocs/3rdparty/sabre/dav/lib/DAV/Server.php line 254
Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
7. /snap/nextcloud/19063/htdocs/apps/dav/lib/Server.php line 319
Sabre\DAV\Server->exec()
8. /snap/nextcloud/19063/htdocs/apps/dav/appinfo/v2/remote.php line 35
OCA\DAV\Server->exec()
9. /snap/nextcloud/19063/htdocs/remote.php line 165
require_once("/snap/nextcloud ... p")
This makes the contacts app unusable.
For someone who just got their new shiny Nextcloud instance, this is not only a critical bug but a blocker because it makes it impossible to add new contacts (without refreshing the page after every text entry).
Simple Downgrade to 3.1.6 by replacing the files in apps folder seems not possible (it triggers a server upgrade check, including app store updates, which brings it back to 3.1.8)
I suspect the issue is related to
Maybe @hanzi can help us, please?
Same problem here with new contacts, same stacktrace in the log.
This is really a major bug! (And before it was working fine :( )
System:
Debian Stretch 4.19
Intel Celeron N3350
4GB RAM / 32 GB MMC
Nextcloud 17.0.3
Contacts 3.1.8
Unfortunately the same Problem - hope it will be fixed soon .
protocol says:
Fatal webdav SabreDAVExceptionBadRequest: VCard object with uid already exists in this addressbook collection.
Ubuntu server 18.04
MariaDB 10.4
NC 18.0.1
Contacts 3.1.8
Need info status ?
Joe
Did you try to restart the Webserver?!
As mentioned in https://github.com/nextcloud/contacts/issues/1453#issuecomment-582503585 Afterwards it worked like a charm,
of course I did- serveral times !
Yes I also restarted the whole machine to no avail.
Here is a nasty workaround:
0) put server to maintenance mode
1) delete the contacts/ folder in your nextcloud/apps installation
2) download and unpack the previous version 3.1.6 e.g. from here
https://github.com/nextcloud/contacts/releases/download/v3.1.7/contacts.tar.gz
3) edit the file contacts/appinfo/info.xml and change
4) end maintance mode, let server finish its "upgrade" routine.
You will get a code integrity warning of the edited file.
But you can create new contacts without this bug.
Btw. this proves that the bug came with latest 3.1.8 update
Thnx very ! Did that just now and it works ! And syncing with mobile device works too . Only changing content on mobile device causes a message in Nextcloud (Desktop Browser) : "Contact was defect and was corrected. Please check content and click here to save that". Then I do that and everthing's ok. I believe that's _normal behavior_ (!?).
Again thank you for your usefull note !!
p.s. _nextcloud is a great project and I like it very much and thank you all for that work for us !_
But sorry, there is one thing I have to mention: why does updates have bugs whereas previous version works fine ? Isn't it the aim of updates to improve older versions ?
with kind regards, Joe
v3.1.9 is out but does not include this issue.
I'll work on this one this week. and hopefully release a fix soon
Thank you very much !
Thanks!
Fix in https://github.com/nextcloud/contacts/pull/1488
Please help and test the custom release attached: contacts.tar.gz :tada:
If enough tests, I can release quickly ;)
Hi ! _Tested right now. Works!_
p.s.:
Still changing content on mobile device causes a message in Nextcloud (Desktop Browser) : "Contact was defect and corrected . Please check content and click here to save that" - is that the normal behavior ?
Thanks for your effort !
lg. Joe
Please check content and click here to save that" - is that the normal behavior ?
Yes, well normal is relative, but this is known :)
see #1352
Hi,
Thanks, I can also confirm that the custom release fixes this issue.
It also fixes the old issue on new contacts: When you type really fast, some parts of the name gets lost because app saves contact to server and drops further input until sync was complete.
Now it works as expected!
although (sorry), there is one thing to mention:
_Syncing of adresses_ with android contact app(s) doesn't work smoothly.
So for example: If I create a contact on mobile android smartphone and sync it (Davx5) with nextcloud (Desktop Browser), the correct entries (though in one line- not in correct fields) are made in nextcloud. But if I do any changes of that adress in nextcloud, the changes are never synced back to android contacts app. I believe it's the (different) structure of the adress array in Nextcloud and android contact app ?
Of course would be nice to have the changes on any device correctly synced back to other device.
But maybe that's not possible of different structure of adress on different apps..
However, thanks for your great work so far !
Joe
Hallo everybody,
it is really amazing, how my initial post has brought so many people together. Seems that many people are using the contact app and have stumbled over this error.
Some have meant, that it's a major bug but on my opinion there has always been a workaround: Just edit the same contact twice. Ok, that not verry comfortable, but it works.
The webpage is also not meant to be used for a mass import or mass editing.
Thanks to John Molakvoæ for fixing and here is what I observed while using the corrected version:
When I edit the first field (in german it is called "Firma") I can observ the message "Contact was defect and corrected . Please check content and click here to save that" but entering the phone number afterwards works better now. The contact is automaticly saved.
Funny thing is, when I first edit the field "phone number" and not the field "Firma", the "Contact was defect" message is not rising.
Regards
Frank
Tested your version from https://github.com/nextcloud/contacts/issues/1453#issuecomment-592592877 on NC 18.0.1
No more hangs and circle not stop spinning, so main issue seems to be fixed :smiley:
Can confirm that Issue from https://github.com/nextcloud/contacts/issues/1453#issuecomment-592726652 seems only to happen when filling in firm as first field (seems to copy over to the contact main field), not happening on other fields. Perhaps that needs to be filed in a separate bug report.
Just to add as an important side note for testing:
I reverted my NC instance and DB to the state before the test, but could not reproduce the issue..
In Firefox I had to override cache to get back (CTRL+F5), and the issue appeared as expected.
The custom release also fixes the issue on my setup A ( Setup A: shared webspace, MySQL 5.7.29 PHP 7.1.33 adressbook with >1500 entries)
Just FYI the custom release contains 9360 files of 42MB, whereas official 3.1.9 release has only 725 files of 10 MB?
Thanks again for the fix.
@tdoerschel this custom relased is a dev build with lots of uncompressed code :)
Thanks for the review!
Released as 3.2.0
thank you very much
You're very welcome! :)
Thanks everyone for the help here!
Is this considered fixed? I have the same problem on 18.0.4 with Contacts 3.3.0. The problem has been there for quite some time and has never gone away for me. Since a few weeks it has worsened from a annoyance to unusable..
I cannot edit contacts in the web interface, as soon as I enter something, it says that the contact has changed in the meantime. Syncing with clients (mobile, Gnome-Contacts) fails (most of the time?!?), error log says the UID already exists.
It seems like the same error.
@Larx it is working here without problems: Contacts 3.3.0 on Nextcloud 18.0.4 (snap). Syncing with Android (using davx5) also works.
OK, I'll have to look into it, it looked like the same problem. (Moreover, I just noticed that some adress entries have been converted to one-liners in capital letters with "^N" seperating the components of the address. Which is very strange indeed.)
Most helpful comment
Released as 3.2.0