nextcloud / contacts

📇 Contacts app for Nextcloud
https://apps.nextcloud.com/apps/contacts
GNU Affero General Public License v3.0
569 stars 173 forks source link

Empty contact list showing a spinning wheel #358

Closed wirepatch closed 7 years ago

wirepatch commented 7 years ago

Steps to reproduce

No idea for reproducing from scratch. Problem appeared when a single Nextcloud instance user discoverd the problem.

Expected behaviour

When hitting "Contacts" in Nextcloud's Web GUI a list of contacts should be shown.

Actual behaviour

App's reply is "No contacts here" showing a spinning wheel. User in question synchronized his address book for a longer time period including a fresh mobile device contacts initialization.

Server configuration

Operating system: Ubuntu 16.04.3 LTS / Linux 4.4.0-78-generic #99-Ubuntu SMP Thu Apr 27 15:29:09 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Web server: nginx/1.12.1

Database: mysqld 10.0.31-MariaDB-0ubuntu0.16.04.2

PHP version: PHP 7.0.22-0ubuntu0.16.04.1

Nextcloud version: 12.0.3

Contacts version: 1.5.3

Updated from an older Nextcloud or fresh install: Last update from 11.0.4, problem was discovered in 11.0.4

Signing status:

No errors have been found.

List of activated apps:

Enabled:
  - activity: 2.5.2
  - admin_audit: 1.2.0
  - bruteforcesettings: 1.0.2
  - calendar: 1.5.5
  - comments: 1.2.0
  - contacts: 1.5.3
  - dav: 1.3.0
  - federatedfilesharing: 1.2.0
  - federation: 1.2.0
  - files: 1.7.2
  - files_pdfviewer: 1.1.1
  - files_sharing: 1.4.0
  - files_texteditor: 2.4.1
  - files_trashbin: 1.2.0
  - files_versions: 1.5.0
  - files_videoplayer: 1.1.0
  - firstrunwizard: 2.1
  - gallery: 17.0.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.0.0
  - nextcloud_announcements: 1.1
  - notes: 2.3.1
  - notifications: 2.0.0
  - oauth2: 1.0.5
  - password_policy: 1.2.2
  - provisioning_api: 1.2.0
  - serverinfo: 1.2.0
  - sharebymail: 1.2.0
  - survey_client: 1.0.0
  - systemtags: 1.2.0
  - theming: 1.3.0
  - twofactor_backupcodes: 1.1.1
  - updatenotification: 1.2.0
  - user_ldap: 1.2.1
  - workflowengine: 1.2.0
Disabled:
  - encryption
  - files_external
  - user_external

Nextcloud configuration:

{
    "system": {
        "instanceid": "oc85bf2bd50d",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.xtraservice.de",
            "xtraservice.de"
        ],
        "datadirectory": "\/opt\/nextcloud\/data\/",
        "dbtype": "mysql",
        "version": "12.0.3.3",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "ldapIgnoreNamingRules": false,
        "ldapUserCleanupInterval": 1,
        "mail_smtpmode": "php",
        "preview_libreoffice_path": "\/usr\/bin\/libreoffice",
        "forcessl": true,
        "theme": "",
        "maintenance": false,
        "secret": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "xtraservice.de",
        "loglevel": 0,
        "trashbin_retention_obligation": "auto",
        "appstore.experimental.enabled": true,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
        "mail_from_address": "goik",
        "updater.secret": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/cloud.xtraservice.de\/owncloud"
    }
}

Are you using external storage, if yes which one: No

Are you using encryption: no

Are you using an external user-backend, if yes which one: LDAP

LDAP configuration

+-------------------------------+------------------------------------------------+
| Configuration                 |                                                |
+-------------------------------+------------------------------------------------+
| hasMemberOfFilterSupport      |                                                |
| hasPagedResultSupport         |                                                |
| homeFolderNamingRule          |                                                |
| lastJpegPhotoLookup           | 0                                              |
| ldapAgentName                 | cn=admin,dc=xtraservice,dc=de                  |
| ldapAgentPassword             | ***                                            |
| ldapAttributesForGroupSearch  |                                                |
| ldapAttributesForUserSearch   |                                                |
| ldapBackupHost                |                                                |
| ldapBackupPort                |                                                |
| ldapBase                      | dc=xtraservice,dc=de                           |
| ldapBaseGroups                | ou=group,dc=xtraservice,dc=de                  |
| ldapBaseUsers                 | ou=People,dc=xtraservice,dc=de                 |
| ldapCacheTTL                  | 600                                            |
| ldapConfigurationActive       | 1                                              |
| ldapDefaultPPolicyDN          |                                                |
| ldapDynamicGroupMemberURL     |                                                |
| ldapEmailAttribute            | mail                                           |
| ldapExperiencedAdmin          | 0                                              |
| ldapExpertUUIDGroupAttr       | gid                                            |
| ldapExpertUUIDUserAttr        | uid                                            |
| ldapExpertUsernameAttr        | uid                                            |
| ldapGidNumber                 | gidNumber                                      |
| ldapGroupDisplayName          | cn                                             |
| ldapGroupFilter               | (|(cn=users))                                  |
| ldapGroupFilterGroups         | users                                          |
| ldapGroupFilterMode           | 0                                              |
| ldapGroupFilterObjectclass    |                                                |
| ldapGroupMemberAssocAttr      | uniqueMember                                   |
| ldapHost                      | localhost                                      |
| ldapIgnoreNamingRules         |                                                |
| ldapLoginFilter               | (&(|(objectclass=inetOrgPerson))(|(uid=%uid))) |
| ldapLoginFilterAttributes     | uid                                            |
| ldapLoginFilterEmail          | 0                                              |
| ldapLoginFilterMode           | 0                                              |
| ldapLoginFilterUsername       | 0                                              |
| ldapNestedGroups              | 0                                              |
| ldapOverrideMainServer        | 0                                              |
| ldapPagingSize                | 500                                            |
| ldapPort                      | 389                                            |
| ldapQuotaAttribute            |                                                |
| ldapQuotaDefault              |                                                |
| ldapTLS                       | 0                                              |
| ldapUserDisplayName           | cn                                             |
| ldapUserDisplayName2          |                                                |
| ldapUserFilter                | (|(objectclass=inetOrgPerson))                 |
| ldapUserFilterGroups          |                                                |
| ldapUserFilterMode            | 0                                              |
| ldapUserFilterObjectclass     | inetOrgPerson                                  |
| ldapUuidGroupAttribute        | auto                                           |
| ldapUuidUserAttribute         | auto                                           |
| turnOffCertCheck              | 0                                              |
| turnOnPasswordChange          | 1                                              |
| useMemberOfToDetectMembership | 1                                              |
+-------------------------------+------------------------------------------------+

Client configuration

Browser: Current google chrome

Operating system: Ubuntu 17.04 amd64 current Linux

CardDAV-clients: Android CardDAV-Sync 0.4.23

Logs

Web server error log

access.log:
141.62.31.244 - - [22/Sep/2017:09:30:04 +0200] "GET /owncloud/index.php/apps/contacts/ HTTP/2.0" 200 4909 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
141.62.31.244 - - [22/Sep/2017:09:30:04 +0200] "GET /owncloud/ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 200 74 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
141.62.31.244 - - [22/Sep/2017:09:30:04 +0200] "GET /owncloud/remote.php/dav/addressbooks HTTP/2.0" 200 111 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
141.62.31.244 - - [22/Sep/2017:09:30:05 +0200] "GET /owncloud/cron.php HTTP/2.0" 200 20 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
141.62.31.244 - - [22/Sep/2017:09:30:05 +0200] "PROPFIND /owncloud/remote.php/dav/addressbooks HTTP/2.0" 207 573 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
141.62.31.244 - - [22/Sep/2017:09:30:05 +0200] "PROPFIND /owncloud/remote.php/dav/principals/users/david/ HTTP/2.0" 207 587 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
141.62.31.244 - - [22/Sep/2017:09:30:05 +0200] "PROPFIND /owncloud/remote.php/dav/addressbooks/users/david/ HTTP/2.0" 207 1205 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
141.62.31.244 - - [22/Sep/2017:09:30:05 +0200] "PROPFIND /owncloud/remote.php/dav/addressbooks/users/david/contacts/ HTTP/2.0" 207 358407 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
141.62.31.244 - - [22/Sep/2017:09:30:06 +0200] "PROPFIND /owncloud/remote.php/dav/addressbooks/users/david/ HTTP/2.0" 207 487 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"
"Mozilla/5.0 (Windows) mirall/2.3.2 (build 6928)"
141.62.31.244 - - [22/Sep/2017:09:30:06 +0200] "REPORT /owncloud/remote.php/dav/addressbooks/users/david/contacts/ HTTP/2.0" 500 225 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"

Nextcloud log (data/nextcloud.log)

{"reqId":"vU6jU5yM5BmCJFaU36f6","level":0,"time":"2017-09-22T07:33:11+00:00","remoteAddr":"141.62.31.244","user":"david","app":"user_ldap","method":"GET","url":"\/owncloud\/index.php\/apps\/contacts\/","message":"initializing paged search for  Filter (|(objectclass=inetOrgPerson)) base Array\n(\n    [0] => uid=david,ou=people,dc=xtraservice,dc=de\n)\n attr Array\n(\n    [0] => \n)\n limit 500 offset 0","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/59.0.3071.115 Safari\/537.36","version":"12.0.3.3"}
{"reqId":"vU6jU5yM5BmCJFaU36f6","level":0,"time":"2017-09-22T07:33:11+00:00","remoteAddr":"141.62.31.244","user":"david","app":"user_ldap","method":"GET","url":"\/owncloud\/index.php\/apps\/contacts\/","message":"Ready for a paged search","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/59.0.3071.115 Safari\/537.36","version":"12.0.3.3"}

... omitted for brevity

{"reqId":"gAkfphIuVQAV8swQzTPT","level":0,"time":"2017-09-22T07:33:13+00:00","remoteAddr":"141.62.31.244","user":"david","app":"user_ldap","method":"PROPFIND","url":"\/owncloud\/remote.php\/dav\/addressbooks\/users\/david\/","message":"Ready for a paged search","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/59.0.3071.115 Safari\/537.36","version":"12.0.3.3"}
{"reqId":"lsHWKjBzczsouFPpafSp","level":6,"time":"2017-09-22T07:33:13+00:00","remoteAddr":"141.62.31.244","user":"david","app":"webdav","method":"REPORT","url":"\/owncloud\/remote.php\/dav\/addressbooks\/users\/david\/contacts\/","message":"Exception: {\"Exception\":\"Sabre\\\\VObject\\\\EofException\",\"Message\":\"End of document reached prematurely\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/cloud\\\/html\\\/owncloud\\\/3rdparty\\\/sabre\\\/vobject\\\/lib\\\/Parser\\\/MimeDir.php(177): Sabre\\\\VObject\\\\Parser\\\\MimeDir->readLine()\\n#1 \\\/var\\\/www\\\/cloud\\\/html\\\/owncloud\\\/3rdparty\\\/sabre\\\/vobject\\\/lib\\\/Parser\\\/MimeDir.php(89): Sabre\\\\VObject\\\\Parser\\\\MimeDir->parseDocument()\\n#2 \\\/var\\\/www\\\/cloud\\\/html\\\/owncloud\\\/3rdparty\\\/sabre\\\/vobject\\\/lib\\\/Reader.php(46): Sabre\\\\VObject\\\\Parser\\\\MimeDir->parse('BEGIN:VCARD\\\\r\\\\nVE...', 0)\\n#3 \\\/var\\\/www\\\/cloud\\\/html\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/CardDAV\\\/Plugin.php(857): Sabre\\\\VObject\\\\Reader::read('BEGIN:VCARD\\\\r\\\\nVE...')\\n#4 \\\/var\\\/www\\\/cloud\\\/html\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/CardDAV\\\/Plugin.php(494): Sabre\\\\CardDAV\\\\Plugin->convertVCard('BEGIN:VCARD\\\\r\\\\nVE...', 'vcard3', Array)\\n#5 \\\/var\\\/www\\\/cloud\\\/html\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/CardDAV\\\/Plugin.php(203): Sabre\\\\CardDAV\\\\Plugin->addressbookQueryReport(Object(Sabre\\\\CardDAV\\\\Xml\\\\Request\\\\AddressBookQueryReport))\\n#6 [internal function]: Sabre\\\\CardDAV\\\\Plugin->report('{urn:ietf:param...', Object(Sabre\\\\CardDAV\\\\Xml\\\\Request\\\\AddressBookQueryReport), 'addressbooks\\\/us...')\\n#7 \\\/var\\\/www\\\/cloud\\\/html\\\/owncloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#8 \\\/var\\\/www\\\/cloud\\\/html\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(718): Sabre\\\\Event\\\\EventEmitter->emit('report', Array)\\n#9 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpReport(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#10 \\\/var\\\/www\\\/cloud\\\/html\\\/owncloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#11 \\\/var\\\/www\\\/cloud\\\/html\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:REPORT', Array)\\n#12 \\\/var\\\/www\\\/cloud\\\/html\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#13 \\\/var\\\/www\\\/cloud\\\/html\\\/owncloud\\\/apps\\\/dav\\\/lib\\\/Server.php(258): Sabre\\\\DAV\\\\Server->exec()\\n#14 \\\/var\\\/www\\\/cloud\\\/html\\\/owncloud\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(33): OCA\\\\DAV\\\\Server->exec()\\n#15 \\\/var\\\/www\\\/cloud\\\/html\\\/owncloud\\\/remote.php(162): require_once('\\\/var\\\/www\\\/cloud\\\/...')\\n#16 {main}\",\"File\":\"\\\/var\\\/www\\\/cloud\\\/html\\\/owncloud\\\/3rdparty\\\/sabre\\\/vobject\\\/lib\\\/Parser\\\/MimeDir.php\",\"Line\":296}","userAgent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/59.0.3071.115 Safari\/537.36","version":"12.0.3.3"}

Browser log

JQMIGRATE: Migrate is installed, version 1.4.0
/owncloud/remote.php/dav/addressbooks/users/david/contacts/ Failed to load resource: the server responded with a status of 500 ()
dav.js?v=21cf2b7…-6:3649 Uncaught (in promise) Error: Bad status: 500
    at XMLHttpRequest.request.onreadystatechange (dav.js?v=21cf2b7…-6:3649)
dav.js?v=21cf2b7…-6:3649 Uncaught (in promise) Error: Bad status: 500
    at XMLHttpRequest.request.onreadystatechange (dav.js?v=21cf2b7…-6:3649)

In addition trying to download the address book using Nextcloud's web GUI settings/download results in:

Internal Server Error

Technical details

Remote Address: 141.62.31.244
Request ID: S351TAWO9lEJ9ezAEroK
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/49612229-empty-contact-list-showing-a-spinning-wheel?utm_campaign=plugin&utm_content=tracker%2F46751899&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F46751899&utm_medium=issues&utm_source=github).
skjnldsv commented 7 years ago

Hello! You seemed to have a broken vCard. :) Do you have a more detailed server log? You could easily identify the failing card.

wirepatch commented 7 years ago

Do you refer to nextcloud.log? A complete set of entries corresponding to the failed access is available at https://cloud.xtraservice.de/owncloud/index.php/s/XOdrUsp3PIwvx5h not cluttering this answer. I see no references or id values corresponding to vcard entries there.

I do see some Requested attribute primarygroupid not found for .... messages. But how do I identify a broken vcard? Do I have to locate it somewhere in the MariaDB database? Are there other server logs on offer? Do I have to set up for additional logging?

r3pek commented 7 years ago

I hitted this but with an empty contact list. exactly the same behaviour. Plus, i have this in browser console when trying to add one:

Error: addressBook is undefined
Contact@https://cloud.r3pek.org/apps/contacts/js/public/script.js?v=9e5b8afbce1079605b8602bf8485bd21-3:1079:4
this.create@https://cloud.r3pek.org/apps/contacts/js/public/script.js?v=9e5b8afbce1079605b8602bf8485bd21-3:1708:30
ctrl.createContact@https://cloud.r3pek.org/apps/contacts/js/public/script.js?v=9e5b8afbce1079605b8602bf8485bd21-3:954:3
fn@https://cloud.r3pek.org/apps/contacts/js/vendor/angular/angular.js?v=9e5b8afbce1079605b8602bf8485bd21-3 line 14817 > Function:4:266
expensiveCheckFn@https://cloud.r3pek.org/apps/contacts/js/vendor/angular/angular.js?v=9e5b8afbce1079605b8602bf8485bd21-3:15906:18
callback@https://cloud.r3pek.org/apps/contacts/js/vendor/angular/angular.js?v=9e5b8afbce1079605b8602bf8485bd21-3:25885:17
$eval@https://cloud.r3pek.org/apps/contacts/js/vendor/angular/angular.js?v=9e5b8afbce1079605b8602bf8485bd21-3:17682:16
$apply@https://cloud.r3pek.org/apps/contacts/js/vendor/angular/angular.js?v=9e5b8afbce1079605b8602bf8485bd21-3:17782:20
ngEventHandler/<@https://cloud.r3pek.org/apps/contacts/js/vendor/angular/angular.js?v=9e5b8afbce1079605b8602bf8485bd21-3:25890:17
dispatch@https://cloud.r3pek.org/core/vendor/core.js?v=9e5b8afbce1079605b8602bf8485bd21-3:3:6414
add/r.handle@https://cloud.r3pek.org/core/vendor/core.js?v=9e5b8afbce1079605b8602bf8485bd21-3:3:3224

Related or should i open a new one?

skjnldsv commented 7 years ago

@r3pek please create an addressbook :)

r3pek commented 7 years ago

@skjnldsv 🤦‍♂️ Anyway, shouldn't this be automatic?! ;)

wirepatch commented 7 years ago

@r3pek for the record: In my case the cause was three corrupt Vcard records. Correcting them manually on SQL level solved the problem.

skjnldsv commented 7 years ago

@r3pek it is in the next version! :)

@wirepatch can we close this then? :)

kangaroo72 commented 7 years ago

Same problem here - all contacts are gone - only spinning wheel ... that's really bad - can someone help me? It happened after upgrading to 2.0.1

skjnldsv commented 7 years ago

@kangaroo72 Anything in the debug log? Or in nextcloud's error log?

kangaroo72 commented 7 years ago

Just solved by deleting browser cache. Sorry for circumstances ;-)

skjnldsv commented 7 years ago

@irgendwie too many people having issue with the cache ^^' Time for 2.0.2 😆