contacts icon indicating copy to clipboard operation
contacts copied to clipboard

Contacts not showing up in contacts app

Open jankkm opened this issue 8 years ago • 26 comments

Since upgrading to nextcloud from owncloud 8.x I have problem with the contacts app. It is running on a shared hosting. I have 462 contacts in my address book synced between multiple Apple devices which still works fine but the contacts web app just shows "No contacts in here". If I remove about 20 contacts it works and it does not matter which contacts I remove so this is not about a faulty contact. This was not the case on owncloud 8.x

Any idea what the issue could be? Or how to get any more information? There is nothing interesting in the log file.

jankkm avatar Aug 04 '16 10:08 jankkm

@jankkm Bare with me if the question is too silly but just to make sure: Do your CardDAV settings on the Apple devices show the address and credentials for your Nextcloud (or still owncloud or even iCloud)?

sushidave avatar Aug 04 '16 20:08 sushidave

@sushidave I have used owncloud for quite some time now and the address did not change after the move to nextcloud. The devices are properly synced with nextcloud. This is definitely something about the web interface which seems to be trying to load the contacts but then just gives up and shows none. Could be about some sort of cache which is too small or a timeout.

jankkm avatar Aug 04 '16 21:08 jankkm

@jankkm Yes. What version of Nextcloud is it and is there anything in the error log file of your server (not the one on Nextcloud's Admin page) that could give us a hint?

sushidave avatar Aug 04 '16 22:08 sushidave

It is the most recent stable of nextcloud, so 9.0.53 The error log of apache does not show anything interesting. There is nothing reported when opening the contacts app in nextcloud. The web server uses php 5.6.20 which might not be ideal but I can only choose between 5.6.20 and 7.0.6 and the latter makes nextcloud run into an internal server error. It is a shared hosting and have to deal with what they offer me.

I think this problem might be related to https://github.com/owncloud/contacts/issues/430 but there is no solution that helps me.

jankkm avatar Aug 05 '16 08:08 jankkm

It looks a little different though. In my case there is the spinning wheel first as usual and then it shows this: screen shot 2016-08-05 at 11 17 00

jankkm avatar Aug 05 '16 09:08 jankkm

@jankkm What happens when you add a single contact via the GUI? Please backup your contacts on the Apple device first.

sushidave avatar Aug 05 '16 14:08 sushidave

I tried that and it the new contact does not show up on the synced devices. So nothing actually changed after adding that contact.

jankkm avatar Aug 06 '16 19:08 jankkm

@jankkm Thanks for testing. Does the new contact appear in the web UI contacts app? Do the other contacts then appear there too? After updating any contact on the synced device does the new contact appear on the synced device?

sushidave avatar Aug 06 '16 19:08 sushidave

The new contact appears in the web UI while creating it but after a reload of the page the contact list is empty again. The new contact does not appear on any synced device not after updating any existing contact on a synced device eather. It seems like the contact is not being saved at all.

jankkm avatar Aug 06 '16 22:08 jankkm

@jankkm Does the new contact appear in the database, tables "oc_cards" and "oc_properties"?

sushidave avatar Aug 07 '16 10:08 sushidave

I can't tell if it appears in oc_cards because I don't know the card id or etag. In oc_cards_properties (or did you really mean oc_properties? Because that doesn't exist in my database) there is no entry with the string as a value that I used as a name in the contact I created in the UI. So no.

jankkm avatar Aug 07 '16 12:08 jankkm

@jankkm Yes and sorry, I meant oc_cards_properties. If the new contact entered via web UI isn't stored in the database it looks to me as if your contacts app is broken... Could you try to backup the contacts folder in the apps directory (apps/contacts) and replace it by the source files? Do the contacts then appear in the contacts app?

sushidave avatar Aug 07 '16 12:08 sushidave

I just tried that but it doesn't change anything. I used the latest release v0.0.0.146

jankkm avatar Aug 07 '16 12:08 jankkm

Oh wait! Now new contacts actually do appear on the synced devices. But the UI still doesn't show any contacts after a reload.

jankkm avatar Aug 07 '16 12:08 jankkm

@jankkm That's better now :) So, the contacts are stored in the database and can be processed for CardDAV. I suspect that the contacts app has an issue with data of one or several contacts in the database. Looking at other recent issues here on Github it might be something specific to Apple.

Please try this:

  1. Create a new user account on Nextcloud.
  2. Log-out and log-in as the new user.
  3. Add a new simple contact - such as first name and last name only - via web UI. Does it appear in the contact app?

sushidave avatar Aug 07 '16 12:08 sushidave

A faulty contact was my first guess on this problem but I ruled that out. As described in the first post I can just remove about 20 contacts and then it works fine. I tested around a little more and it is definitely not about one specific contact but contacts with photos which are large in size are kind of problematic. But I am very sure that it is about the total size of all contacts. If it exceeds some certain size it stops working. If I am under that size (so when the UI is working) and I just replace one contact with a photo with another one it is not a problem so it can not be about one specific contact that is a problem for the UI.

jankkm avatar Aug 07 '16 18:08 jankkm

I just tested with a file of 800 kB containing around 1'200 contacts and no photos. After importing on OS X Address Book the contacts appear in the web UI as expected. If imported via web UI the browser after a while comes up with user prompt about Javascript not responding (=> timeout). In both cases, all groups/categories are missing on OS X Address Book as reported in #475. Of what size is your contacts file where it does/does not work?

sushidave avatar Aug 07 '16 19:08 sushidave

My address book contains about 460 contacts and when exported to one single file are just under 10mb.

jankkm avatar Aug 07 '16 19:08 jankkm

Halleluja, that's another dimension ;) Alright, let's see what the experts here can do about it.

sushidave avatar Aug 07 '16 20:08 sushidave

Hm, this seems to be a size problem. If the addressbook is larger than about 10M, it isn't shown any more. Mine is about 16M and not displayed in the contacts app. If I add a new addressbook and import a few contacs, all entries in the new addressbook are shown, all "old" entries not. As soon as the new addressbook gets about 10M in size, nothing is displayed any more, just the spinning wheel.

ghost avatar Aug 23 '16 08:08 ghost

Hi, The same issue for me. In my case 14M of contacts. At the moment I import them from a OC8 file, the contacts was displayed, but when i try to load again the contact page it's blank :(

ghost avatar Sep 08 '16 07:09 ghost

I think the issue here is pretty clear now. If the size of an address book is over a certain limit which is at about 10mb the contacts app stops working. It is very easy to reproduce by adding and removing contacts when the address book is at around that size So what is the procedure now? How can we get some developer's attention?

jankkm avatar Nov 03 '16 21:11 jankkm

Maybe this is helpful for the developers: In the Javascript-Console I get a an Error 500. (The first one points to the adress "URL/remote.php/dav/addressbooks/users/USERNAME/kontakte/ Failed to load resource: the server responded with a status of 500 ()" where I replaced URL and USERNAME)

bildschirmfoto 2016-12-15 um 12 52 15

rinurinu avatar Dec 15 '16 11:12 rinurinu

This discussion thread has definitely helped me out: I was going crazy with this contact app which was working yesterday (on my ownCloud 10.0.2, contact app 1.5.2)! I got lost in all the solutions that you can find on this site dealing with address books containing corrupted entries.

The easiest way to confirm this simple diagnosis is:

  1. Export your address book (with the https://my_path_to_owncloud/remote.php/dav/addressbooks/users/my_name/my_address_book?export command).
  2. Have a look at the size of the downloaded file, which must be close to 10 MB or above.
  3. Sync your address book with a CardDAV-compliant device: you can edit your contacts to remove your largest pictures one by one.
  4. Steps 1 and 2 again, until the contact book is loaded.

To the developers of this such a useful app: I understand that this issue is about loading the full contacts database, and that you are working on it. However, is there any tip/tweak/trick that we could manually apply to reduce this database size drastically?

Thanks a lot!

davidarp avatar Jul 29 '17 16:07 davidarp

Ran into this today after adding a large photo to a card. looking at the db I see that all rows in oc_cards with a PHOTO have stored the image as base64 encoded binary ... well that easily makes the result set become >10mb ... now ... where does that trigger a limit ... I don't know. It certainly looks like the response is just truncated ...

207 Multi-Status, Transfer-Encoding is chunked, so there is no premature truncation of the response .... hmmm

* upload completely sent off: 477 out of 477 bytes
100   477    0     0  100   477      0    392  0:00:01  0:00:01 --:--:--   393{ [5 bytes data]
< HTTP/1.1 207 Multi-Status
< Date: Tue, 19 Mar 2019 11:24:41 GMT
< Server: Apache/2.2.22 (Debian)
< Strict-Transport-Security: max-age=15768000; includeSubDomains; preload
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< Content-Security-Policy: default-src 'none';
< Vary: Brief,Prefer
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< X-Robots-Tag: none
< X-Frame-Options: SAMEORIGIN
< X-Download-Options: noopen
< X-Permitted-Cross-Domain-Policies: none
< Keep-Alive: timeout=5, max=100
< Connection: Keep-Alive
< Transfer-Encoding: chunked
< Content-Type: application/xml; charset=utf-8
<
100   477    0     0  100   477      0    301  0:00:01  0:00:01 --:--:--   301{ [5 bytes data]
100 7056k    0 7056k  100   477  3001k    202  0:00:02  0:00:02 --:--:-- 3001k* Curl_http_done: called premature == 0
100 9760k    0 9760k  100   477  3596k    175  0:00:02  0:00:02 --:--:-- 3596k
* Connection #0 to host xxx left intact

no errors in the logs ... wtf

butonic avatar Mar 19 '19 10:03 butonic

ok so using thunderbird and CardBook I could remove an image ... can now at least edit cards ... will need to dig into this later ... weird ...

ok so cardbook uses an addressbook-multiget REPORT:

<?xml version="1.0" encoding="utf-8"?>
<C:addressbook-multiget xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:carddav">
  <D:prop>
    <D:getetag/>
    <C:address-data content-type='text/vcard'/>
  </D:prop>
  <D:href>/remote.php/dav/addressbooks/users/test/default/a-b-c-d.vcf</D:href>
...

and includes a list of 40 vcards that were discovered with a PROPFIND for /remote.php/dav/addressbooks/users/test/default/with Depth 1 before:

<?xml version="1.0" encoding="utf-8"?>
<D:propfind xmlns:D="DAV:">
  <D:prop>
    <D:getcontenttype/>
    <D:getetag/>
  </D:prop>
</D:propfind>

The contacts app uses an addressbook-query REPORT

<card:addressbook-query xmlns:card="urn:ietf:params:xml:ns:carddav"
                          xmlns:d="DAV:">
    <d:prop>
      <d:getetag />,<card:address-data />
    </d:prop>
    <!-- According to http://stackoverflow.com/questions/23742568/google-carddav-api-addressbook-multiget-returns-400-bad-request,
         Google's CardDAV server requires a filter element. I don't think all addressbook-query calls need a filter in the spec though? -->
  </card:addressbook-query>

including a comment ... oh well ...

butonic avatar Mar 19 '19 13:03 butonic