Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contacts not showing up in contacts app #478

Open
jankkm opened this issue Aug 4, 2016 · 26 comments
Open

Contacts not showing up in contacts app #478

jankkm opened this issue Aug 4, 2016 · 26 comments

Comments

@jankkm
Copy link

jankkm commented Aug 4, 2016

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.

@sushidave
Copy link

@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)?

@jankkm
Copy link
Author

jankkm commented Aug 4, 2016

@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.

@sushidave
Copy link

sushidave commented Aug 4, 2016

@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?

@jankkm
Copy link
Author

jankkm commented Aug 5, 2016

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 #430 but there is no solution that helps me.

@jankkm
Copy link
Author

jankkm commented Aug 5, 2016

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

@sushidave
Copy link

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

@jankkm
Copy link
Author

jankkm commented Aug 6, 2016

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

@sushidave
Copy link

@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?

@jankkm
Copy link
Author

jankkm commented Aug 6, 2016

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.

@sushidave
Copy link

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

@jankkm
Copy link
Author

jankkm commented Aug 7, 2016

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.

@sushidave
Copy link

@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?

@jankkm
Copy link
Author

jankkm commented Aug 7, 2016

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

@jankkm
Copy link
Author

jankkm commented Aug 7, 2016

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

@sushidave
Copy link

sushidave commented Aug 7, 2016

@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?

@jankkm
Copy link
Author

jankkm commented Aug 7, 2016

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.

@sushidave
Copy link

sushidave commented Aug 7, 2016

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?

@jankkm
Copy link
Author

jankkm commented Aug 7, 2016

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

@sushidave
Copy link

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

@ghost
Copy link

ghost commented Aug 23, 2016

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
Copy link

ghost commented Sep 8, 2016

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 :(

@jankkm
Copy link
Author

jankkm commented Nov 3, 2016

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?

@rinurinu
Copy link

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

@davidarp
Copy link

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!

@butonic
Copy link
Member

butonic commented Mar 19, 2019

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
Copy link
Member

butonic commented Mar 19, 2019

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 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants