nextcloud / nextcloud/ldap_contacts_backend
Loading LDAP contacts fail (due to conversion?)
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 9
- Forks
- 7
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 25
Description
I cannot make it work on Nextcloud 23.0.2 and LDAP Contacts Backend 1.2.0
As far as I know, I configured the backend's addressbook correctly.
However, loading contacts from LDAP fails, and it fails so hard that it brings down global contact search in its entirety.
I never did php, but last time I managed to insert some printing to the affected code path, and I am pretty sure the configured search returns entries. Problem seems to be around LdapEntryToVcard Here is the sanitized log.
Feb 18 11:36:34 mail.example.com nextcloud[22355]: {"reqId":"64xjcQrCsrwtaqAncJzw","level":3,"time":"2022-02-18T10:36:34+00:00","remoteAddr":"86.59.192.114","user":"userName","app":"index","method":"POST","url":"/contactsmenu/contacts","message":"{\"Exception\":\"RuntimeException\",\"Message\":\"Invalid record or configuration for vcard\",\"Code\":0,\"Trace\":[{\"file\":\"nextcloud_full_path/apps/ldap_contacts_backend/lib/Service/LdapCardBackend.php\",\"line\":83,\"function\":\"convert\",\"class\":\"OCA\\\\LDAPContactsBackend\\\\Service\\\\LdapEntryToVcard\",\"type\":\"::\"},{\"file\":\"nextcloud_full_path/apps/ldap_contacts_backend/lib/Service/LdapCardBackend.php\",\"line\":64,\"function\":\"entryToCard\",\"class\":\"OCA\\\\LDAPContactsBackend\\\\Service\\\\LdapCardBackend\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/apps/ldap_contacts_backend/lib/Service/ContactsAddressBook.php\",\"line\":84,\"function\":\"searchCards\",\"class\":\"OCA\\\\LDAPContactsBackend\\\\Service\\\\LdapCardBackend\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/lib/private/ContactsManager.php\",\"line\":73,\"function\":\"search\",\"class\":\"OCA\\\\LDAPContactsBackend\\\\Service\\\\ContactsAddressBook\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/lib/private/Contacts/ContactsMenu/ContactsStore.php\",\"line\":111,\"function\":\"search\",\"class\":\"OC\\\\ContactsManager\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/lib/private/Contacts/ContactsMenu/Manager.php\",\"line\":70,\"function\":\"getContacts\",\"class\":\"OC\\\\Contacts\\\\ContactsMenu\\\\ContactsStore\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/core/Controller/ContactsMenuController.php\",\"line\":60,\"function\":\"getEntries\",\"class\":\"OC\\\\Contacts\\\\ContactsMenu\\\\Manager\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":217,\"function\":\"index\",\"class\":\"OC\\\\Core\\\\Controller\\\\ContactsMenuController\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":126,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/lib/private/AppFramework/App.php\",\"line\":157,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/lib/private/Route/Router.php\",\"line\":302,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\"},{\"file\":\"nextcloud_full_path/lib/base.php\",\"line\":1006,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\"},{\"file\":\"nextcloud_full_path/index.php\",\"line\":36,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\"}],\"File\":\"nextcloud_full_path/apps/ldap_contacts_backend/lib/Service/LdapEntryToVcard.php\",\"Line\":65,\"CustomMessage\":\"--\"}","userAgent"...}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with apps/ldap_contacts_backend/lib/Service/LdapEntryToVcard.php at line 65 and trace how LdapCardBackend.php handles conversion at lines 64 and 83. Reproduce the POST to /contactsmenu/contacts with the reported Nextcloud and backend versions, then verify that LDAP contact loading no longer raises the vCard exception or disables global contact search.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100