nextcloud / nextcloud/ldap_contacts_backend

ldap_contacts_backend.contacts.import" must match "[^/]++

Open
#168 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
9
Forks
7
Avg merge
1d 13h
Merged PRs (30d)
25

Description

Hello!
I'm trying to set up an LDAP Contacts Backend.
Settings:
addressBookDisplayName: Primary address book
host: corp.domain.local
port: 3268
agentDn: CN=nextus,OU=IT,OU=DomainUsers,DC=corp,DC=domain,DC=local
agentPassword: Replaced
bases:
DC=corp,DC=domain,DC=local
searchAttributes:
cn
mail
telephoneNumber
mobile
attributeMapping:
EMAIL: mail
FN:cn
TEL: telephoneNumber
tEnc: none
filter: (&(|(objectclass=user))(|(|(memberof=CN=NextCloud_Users,OU=IntergationGroups,OU=Groups,DC=corp,DC=domain,DC=local)(primaryGroupID=2823))) )
Problem: when I try to view contacts in the contacts drop-down list (next to the Nextcloud profile icon), I get an error in the Nextcloud logs:


{"reqId":"CepQbkmuxM1dztwBbhRz","level":3,"time":"May 20, 2024 03:59:10","remoteAddr":"192.168.120.48","user":"mastertux"," app":"index","method":"POST","url":"/contactsmenu/contacts","message":"Parameter "contactId" for route "ldap_contacts_backend.contacts.import" must match "[^/]++" ("Q0490JXQstCz0LXQvdC40Lkg0K/QvdC40L0sT1U9SVQsT1U9RG9tYWluVXNlcnMsREM9Y29ycCxEQz1zdG9rb25leSxEQz1ydQ==" given) to generate a corresponding URL.","userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36","version":"29.0.0.19","exception":{"Exception":"Symfony\Component\Routing\Exception\InvalidParameterException" ,"Message":"Parameter "contactId" for route "ldap_contacts_backend.contacts.import" must match "[^/]++" ("Q0490JXQstCz0LXQvdC40Lkg0K/QvdC40L0sT1U9SVQsT1U9RG9tYWluVXNlcnMsREM9Y2 9ycCxEQz1zdG9rb25leSxEQz1ydQ==" given) to generate a corresponding URL.","Code":0,"Trace":[{"file":"/var/www/nextcloud/3rdparty/symfony/routing/Generator/UrlGenerator.php","line":161,"function ":"doGenerate","class":"Symfony\Component\Routing\Generator\UrlGenerator","type":"->"},{"file":"/var/www/nextcloud/lib /private/Route/Router.php","line":402,"function":"generate","class":"Symfony\Component\Routing\Generator\UrlGenerator","type":"- >"},{"file":"/var/www/nextcloud/lib/private/Route/CachingRouter.php","line":65,"function":"generate","class":"OC\ Route\Router","type":"->"},{"file":"/var/www/nextcloud/lib/private/URLGenerator.php","line":103,"function":"generate ","class":"OC\Route\CachingRouter","type":"->"},{"file":"/var/www/nextcloud/apps/ldap_contacts_backend/lib/Provider/ImportProvider.php ","line":76,"function":"linkToRoute","class":"OC\URLGenerator","type":"->"},{"file":"/var/www/nextcloud/ lib/private/Contacts/ContactsMenu/Manager.php","line":114,"function":"process","class":"OCA\LDAPContactsBackend\Provider\ImportProvider","type":"- >"},{"file":"/var/www/nextcloud/lib/private/Contacts/ContactsMenu/Manager.php","line":58,"function":"processEntries","class":"OC \Contacts\ContactsMenu\Manager","type":"->"},{"file":"/var/www/nextcloud/core/Controller/ContactsMenuController.php","line":53," function":"getEntries","class":"OC\Contacts\ContactsMenu\Manager","type":"->"},{"file":"/var/www/nextcloud/lib/private /AppFramework/Http/Dispatcher.php","line":232,"function":"index","class":"OC\Core\Controller\ContactsMenuController","type":"->"} ,{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\AppFramework \Http\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":184,"function ":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/ Route/Router.php","line":338,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file": "/var/www/nextcloud/lib/base.php","line":1050,"function":"match","class":"OC\Route\Router","type":"-> "},{"file":"/var/www/nextcloud/index.php","line":49,"function":"handleRequest","class":"OC","type":":: "}],"File":"/var/www/nextcloud/3rdparty/symfony/routing/Generator/UrlGenerator.php","Line":194,"message":"Parameter "contactId" for route " ldap_contacts_backend.contacts.import" must match "[^/]++" ("Q0490JXQstCz0LXQvdC40Lkg0K/QvdC40L0sT1U9SVQsT1U9RG9tYWluVXNlcnMsREM9Y29ycCxEQz1zdG9rb25leSxEQz 1ydQ==" given) to generate a corresponding URL.","exception":{},"CustomMessage": "Parameter "contactId" for route "ldap_contacts_backend.contacts.import" must match "[^/]++" ("Q0490JXQstCz0LXQvdC40Lkg0K/QvdC40L0sT1U9SVQsT1U9RG9tYWluVXNlcnMsREM9Y29ycCx EQz1zdG9rb25leSxEQz1ydQ==" given) to generate a corresponding URL."} }

I apologize if I did not attach any additional log. At your request, I can attach any log and any information.

Please tell me how I can fix this problem. Thanks in advance for your help.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in apps/ldap_contacts_backend/lib/Provider/ImportProvider.php at line 76, where the failing contact-menu URL is generated, and compare it with the logged contactId and route constraint. Reproduce the contacts drop-down request and verify that contact entries with this encoded LDAP value can generate a URL without the Symfony routing exception.

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
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.