We have moved to a new Sailfish OS Forum. Please start new discussions there.
1

Contact failed detail constraints

asked 2017-05-01 08:52:43 +0300

Fenuks gravatar image

Hello,

I'm facing an error with contacts that I can't diagnose.

External symptoms:
Contacts application does not allow editing or deleting contacts. Attempt to change anything in any contact does not result in any change, and opening any contact after shows it's empty, until /usr/bin/jolla-contacts is killed via terminal and started again.

Internal symptoms:
Killing and starting via terminal '/usr/bin/contactsd --log-console' showed the following (entries that seem normal are omitted):

...
[W] unknown:0 - virtual bool QtContactsSqliteExtensions::TwoWayContactSyncAdapter::determineLocalChanges(QDateTime*, QList<qtcontacts::qcontact>*, QList<qtcontacts::qcontact>*, QList<qtcontacts::qcontact>*, const QString&, const QSet<qtcontacts::qcontactdetail::detailtype>&, const QHash<qtcontacts::qcontactdetail::detailtype, qset<int=""> >&) FIXME: local modification reported for non-upsynced local contact: QContactId("sql-1343")               
[W] unknown:0 - CDExport: exporting changes: 5 217 0                                                                                                                                                                           
[W] unknown:0 - "Detail URI confict on: /org/freedesktop/Telepathy/Account/gabble/jabber/jabber_107!user1@domain.tld OnlineAccount 18"                                                                                   
[W] unknown:0 - "Contact failed detail constraints"                                                                                                                                                                            
[W] unknown:0 - "Error updating contact sql-453: 3"                                                                                                                                                                            
[W] unknown:0 - Error updating ID: QContactId("sql-453")error:3                                                                                                                                                                
[W] unknown:0 - Unable to save privileged DB modifications to export DB!                                                                                                                                                       
[W] unknown:0 - Unable to synchronize database changes!
...
[W] unknown:0 - CDTpStorage: syncAccounts: ()
[D] unknown:0 - contactsd 1.1.1 DEBUG: "void CDTpStorage::syncAccounts(const QList<tp::sharedptr<cdtpaccount> >&):2368" Remove obsolete account: "/org/freedesktop/Telepathy/Account/gabble/jabber/jabber_107"
[D] unknown:0 - contactsd 1.1.1 DEBUG: "void CDTpStorage::syncAccounts(const QList<tp::sharedptr<cdtpaccount> >&):2368" Remove obsolete account: "/org/freedesktop/Telepathy/Account/gabble/jabber/jabber_2"
[W] unknown:0 - "Detail URI confict on: /org/freedesktop/Telepathy/Account/gabble/jabber/jabber_107!user1@domain.tld OnlineAccount 18"
[W] unknown:0 - "Contact failed detail constraints"
[W] unknown:0 - "Error updating contact sql-3601: 3"
[W] unknown:0 - "Failed to write updated aggregate contacts during regenerate.  definitionMask:" ()
[W] unknown:0 - contactsd 1.1.1 WARN: "void CDTpStorage::removeExistingAccount(QtContacts::QContact&, QtContacts::QContactOnlineAccount&):1995" Unable to remove linked contacts for account: "/org/freedesktop/Telepathy/Account/gabble/jabber/jabber_107" error: 3                                                                                                                                                                   
</tp::sharedptr<cdtpaccount></tp::sharedptr<cdtpaccount></qtcontacts::qcontactdetail::detailtype,></qtcontacts::qcontactdetail::detailtype></qtcontacts::qcontact></qtcontacts::qcontact></qtcontacts::qcontact>

I've had a jabber account set up, then it was deleted (server was closed) and another, different one, was created. When I faced this error, I've tried deleting this new account as well, it not listed in Accounts anymore, but looks like it's not deleted yet due to this error.
Details on user with jabberID user1@domain.tld show a lot of constituents and multiple fields with same info: phone numbers, address, organization.

I'd like to avoid deleting all contacts, as I'm not sure they're being successfuly backed up.
I can access sqlite3 database with contacts, but have no idea what I can do regarding those errors.

edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted
1

answered 2017-05-14 11:51:04 +0300

Fenuks gravatar image

I was unable to resolve the issue without deleting and reimporting all contacts.

Here's what I had to do, if anyone get similar issues (I use Russian locale, so menu entries might be named differently):

  1. Backup and export all contacts to vcf file (found in https://together.jolla.com/question/151558/export-contacts-from-ssh-terminal/?answer=151560#post-id-151560 and https://together.jolla.com/question/384/export-vcf-from-people/?answer=758#post-id-758, many thanks there!):
    $ mkdir -p Documents/mycontacts
    $ invoker --type=generic vcardconverter -e Documents/mycontacts/contacts.vcf
    $ cd Documents/mycontacts
  2. As I had a lot (over 50) of duplicated and linked constituents for several contacts, I had to manually find and remove them from vcf. One way to do it is split this file with all contacts into single contact per file:
    $ csplit contacts.vcf '/END:VCARD/+1' '{*}'
    it'll create files named xx00, xx01 and so on, you can use grep and uniq to find duplicated contacts, for example this will find and show all duplicated names:
    $ grep -h "FN:" xx* | sort | uniq -cd
    then delete those files.
  3. Then went to Settings → Applications → People and use pulley menu to remove all. In my case it hang there for a while, I had to reboot and second time it worked and wiped most, but not all, accounts.
  4. Checking that I can now edit and delete entries in contact, I reimported my contacts, merging them into single file with:
    $ cat xx* > contacts_new.vcf
    Import is done via Settings → Applications → People, Import from file.

It's working now, can add, edit, delete contacts and sync with CardDav. I lost at least 2 contacts in the process, but was able to add them again manually as soon as I got through the "-Hello, who is it? -It's Xxx Xxx, did you delete me from contacts?".

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
1 follower

Stats

Asked: 2017-05-01 08:52:43 +0300

Seen: 404 times

Last updated: May 14 '17