⚠️ This issue respects the following points: ⚠️
Bug description
Some contacts stored in the oc_cards table of my Nextcloud instance have a URL as uid. This breaks the contacts menu and causes the following warning in nextcloud.log:
Parameter "contact" for route "contacts.contacts.direct" must match "[^/]++" ("https://Username@mycloud.example.org/remote.php/carddav/addressbooks/Username/contacts/d9efda0aea.vcf~contacts" given) to generate a corresponding URL.
Full error message (formatted and slightly anonymized)
{
"reqId": "Lin5UlVlVkZHuCShLZem",
"level": 3,
"time": "2024-05-10T09:25:33+00:00",
"remoteAddr": "0.0.0.0", // anonymized
"user": "Username", // anonymized
"app": "index",
"method": "POST",
"url": "/index.php/contactsmenu/contacts",
"message": "Parameter \"contact\" for route \"contacts.contacts.direct\" must match \"[^/]++\" (\"https://Username@mycloud.example.org/remote.php/carddav/addressbooks/Username/contacts/d9efda0aea.vcf~contacts\" given) to generate a corresponding URL.",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:125.0) Gecko/20100101 Firefox/125.0",
"version": "28.0.5.1",
"exception": {
"Exception": "Symfony\\Component\\Routing\\Exception\\InvalidParameterException",
"Message": "Parameter \"contact\" for route \"contacts.contacts.direct\" must match \"[^/]++\" (\"https://Username@mycloud.example.org/remote.php/carddav/addressbooks/Username/contacts/d9efda0aea.vcf~contacts\" 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": 372,
"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/contacts/lib/ContactsMenu/Providers/DetailsProvider.php",
"line": 112,
"function": "linkToRoute",
"class": "OC\\URLGenerator",
"type": "->"
}, {
"file": "/var/www/nextcloud/lib/private/Contacts/ContactsMenu/Manager.php",
"line": 114,
"function": "process",
"class": "OCA\\Contacts\\ContactsMenu\\Providers\\DetailsProvider",
"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": 51,
"function": "getEntries",
"class": "OC\\Contacts\\ContactsMenu\\Manager",
"type": "->"
}, {
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 230,
"function": "index",
"class": "OC\\Core\\Controller\\ContactsMenuController",
"type": "->"
}, {
"file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 137,
"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": 315,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::"
}, {
"file": "/var/www/nextcloud/lib/base.php",
"line": 1069,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->"
}, {
"file": "/var/www/nextcloud/index.php",
"line": 39,
"function": "handleRequest",
"class": "OC",
"type": "::"
}],
"File": "/var/www/nextcloud/3rdparty/symfony/routing/Generator/UrlGenerator.php",
"Line": 194,
"message": "Parameter \"contact\" for route \"contacts.contacts.direct\" must match \"[^/]++\" (\"https://Username@mycloud.example.org/remote.php/carddav/addressbooks/Username/contacts/d9efda0aea.vcf~contacts\" given) to generate a corresponding URL.",
"exception": {},
"CustomMessage": "Parameter \"contact\" for route \"contacts.contacts.direct\" must match \"[^/]++\" (\"https://Username@mycloud.example.org/remote.php/carddav/addressbooks/Username/contacts/d9efda0aea.vcf~contacts\" given) to generate a corresponding URL."
}
}
The entry with uri "d9efda0aea.vcf" in the oc_cards table in this example has a uid of "https://Username@mycloud.example.org/remote.php/carddav/addressbooks/Username/contacts/d9efda0aea.vcf".
Steps to reproduce
- Create a contact with a uid that contains slashes (e.g., a URL). I don't know how these entries were created in my case.
- Log into the Nextcloud web interface.
Expected behavior
No errors should be produced and the contacts menu should work.
Installation method
None
Nextcloud Server version
28
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.2
Web server
Nginx
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "28.0.5.1",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"loglevel": 0,
"theme": "",
"maintenance": false,
"trusted_domains": [
"***REMOVED SENSITIVE VALUE***"
],
"secret": "***REMOVED SENSITIVE VALUE***",
"trashbin_retention_obligation": "auto, 30",
"versions_retention_obligation": "auto, 30",
"updatechecker": true,
"appstore.experimental.enabled": false,
"mail_smtpmode": "smtp",
"overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpauthtype": "PLAIN",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "25",
"updater.release.channel": "stable",
"mysql.utf8mb4": true,
"memcache.local": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 0,
"dbindex": 0,
"password": "***REMOVED SENSITIVE VALUE***",
"timeout": 1.5
},
"default_phone_region": "DE",
"preview_max_x": 1024,
"preview_max_y": 1024,
"preview_max_filesize_image": 5,
"maintenance_window_start": 2
}
}
List of activated Apps
Enabled:
- activity: 2.20.0
- calendar: 4.7.3
- cloud_federation_api: 1.11.0
- contacts: 5.5.3
- dav: 1.29.1
- federatedfilesharing: 1.18.0
- files: 2.0.0
- files_pdfviewer: 2.9.0
- files_reminders: 1.1.0
- files_sharing: 1.20.0
- files_trashbin: 1.18.0
- files_versions: 1.21.0
- logreader: 2.13.0
- lookup_server_connector: 1.16.0
- notes: 4.10.0
- notifications: 2.16.0
- oauth2: 1.16.3
- password_policy: 1.18.0
- photos: 2.4.0
- privacy: 1.12.0
- provisioning_api: 1.18.0
- recommendations: 2.0.0
- related_resources: 1.3.0
- settings: 1.10.1
- sharebymail: 1.18.0
- survey_client: 1.16.0
- tasks: 0.16.0
- text: 3.9.1
- theming: 2.3.0
- twofactor_backupcodes: 1.17.0
- twofactor_totp: 10.0.0-beta.2
- updatenotification: 1.18.0
- viewer: 2.2.0
- workflowengine: 2.10.0
Disabled:
- admin_audit: 1.18.0
- bruteforcesettings: 2.8.0 (installed 1.0.2)
- circles: 28.0.0 (installed 27.0.1)
- comments: 1.18.0 (installed 1.17.0)
- contactsinteraction: 1.9.0 (installed 1.8.0)
- dashboard: 7.8.0 (installed 7.7.0)
- encryption: 2.16.0
- federation: 1.18.0 (installed 1.17.0)
- files_external: 1.20.0
- firstrunwizard: 2.17.0 (installed 2.16.0)
- nextcloud_announcements: 1.17.0 (installed 1.16.0)
- serverinfo: 1.18.0 (installed 1.17.0)
- support: 1.11.1 (installed 1.10.0)
- suspicious_login: 6.0.0
- systemtags: 1.18.0 (installed 1.17.0)
- user_ldap: 1.19.0
- user_status: 1.8.1 (installed 1.7.0)
- weather_status: 1.8.0 (installed 1.7.0)
Nextcloud Signing status
No errors have been found.
Nextcloud Logs
(see problem description)
Additional info
No response
Bug description
Some contacts stored in the
oc_cardstable of my Nextcloud instance have a URL as uid. This breaks the contacts menu and causes the following warning in nextcloud.log:Full error message (formatted and slightly anonymized)
{ "reqId": "Lin5UlVlVkZHuCShLZem", "level": 3, "time": "2024-05-10T09:25:33+00:00", "remoteAddr": "0.0.0.0", // anonymized "user": "Username", // anonymized "app": "index", "method": "POST", "url": "/index.php/contactsmenu/contacts", "message": "Parameter \"contact\" for route \"contacts.contacts.direct\" must match \"[^/]++\" (\"https://Username@mycloud.example.org/remote.php/carddav/addressbooks/Username/contacts/d9efda0aea.vcf~contacts\" given) to generate a corresponding URL.", "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:125.0) Gecko/20100101 Firefox/125.0", "version": "28.0.5.1", "exception": { "Exception": "Symfony\\Component\\Routing\\Exception\\InvalidParameterException", "Message": "Parameter \"contact\" for route \"contacts.contacts.direct\" must match \"[^/]++\" (\"https://Username@mycloud.example.org/remote.php/carddav/addressbooks/Username/contacts/d9efda0aea.vcf~contacts\" 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": 372, "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/contacts/lib/ContactsMenu/Providers/DetailsProvider.php", "line": 112, "function": "linkToRoute", "class": "OC\\URLGenerator", "type": "->" }, { "file": "/var/www/nextcloud/lib/private/Contacts/ContactsMenu/Manager.php", "line": 114, "function": "process", "class": "OCA\\Contacts\\ContactsMenu\\Providers\\DetailsProvider", "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": 51, "function": "getEntries", "class": "OC\\Contacts\\ContactsMenu\\Manager", "type": "->" }, { "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "line": 230, "function": "index", "class": "OC\\Core\\Controller\\ContactsMenuController", "type": "->" }, { "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php", "line": 137, "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": 315, "function": "main", "class": "OC\\AppFramework\\App", "type": "::" }, { "file": "/var/www/nextcloud/lib/base.php", "line": 1069, "function": "match", "class": "OC\\Route\\Router", "type": "->" }, { "file": "/var/www/nextcloud/index.php", "line": 39, "function": "handleRequest", "class": "OC", "type": "::" }], "File": "/var/www/nextcloud/3rdparty/symfony/routing/Generator/UrlGenerator.php", "Line": 194, "message": "Parameter \"contact\" for route \"contacts.contacts.direct\" must match \"[^/]++\" (\"https://Username@mycloud.example.org/remote.php/carddav/addressbooks/Username/contacts/d9efda0aea.vcf~contacts\" given) to generate a corresponding URL.", "exception": {}, "CustomMessage": "Parameter \"contact\" for route \"contacts.contacts.direct\" must match \"[^/]++\" (\"https://Username@mycloud.example.org/remote.php/carddav/addressbooks/Username/contacts/d9efda0aea.vcf~contacts\" given) to generate a corresponding URL." } }The entry with
uri"d9efda0aea.vcf" in theoc_cardstable in this example has auidof "https://Username@mycloud.example.org/remote.php/carddav/addressbooks/Username/contacts/d9efda0aea.vcf".Steps to reproduce
Expected behavior
No errors should be produced and the contacts menu should work.
Installation method
None
Nextcloud Server version
28
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.2
Web server
Nginx
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
{ "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "28.0.5.1", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "loglevel": 0, "theme": "", "maintenance": false, "trusted_domains": [ "***REMOVED SENSITIVE VALUE***" ], "secret": "***REMOVED SENSITIVE VALUE***", "trashbin_retention_obligation": "auto, 30", "versions_retention_obligation": "auto, 30", "updatechecker": true, "appstore.experimental.enabled": false, "mail_smtpmode": "smtp", "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_smtpauthtype": "PLAIN", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "25", "updater.release.channel": "stable", "mysql.utf8mb4": true, "memcache.local": "\\OC\\Memcache\\Redis", "memcache.locking": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 0, "dbindex": 0, "password": "***REMOVED SENSITIVE VALUE***", "timeout": 1.5 }, "default_phone_region": "DE", "preview_max_x": 1024, "preview_max_y": 1024, "preview_max_filesize_image": 5, "maintenance_window_start": 2 } }List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response