[Bug]: Error message if user and display name are equal
⚠️ This issue respects the following points: ⚠️
- [X] This is a bug, not a question or a configuration/webserver/proxy issue.
- [X] This issue is not already reported on Github (I've searched it).
- [X] Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- [X] Nextcloud Server is running on 64bit capable CPU, PHP and OS.
- [X] I agree to follow Nextcloud's Code of Conduct.
Bug description
After upgrade to 24.0.3+ when creating a user via the web interface, the error "Invalid display name" (in 24.0.3) or "User already exist" (in 24.0.4) is thrown as soon as the user name and display name are the same.
Regardless of this, the user is nevertheless created correctly.
Could be related with https://github.com/nextcloud/server/commit/51e20dd6c56e8f9221f9019f83a2abe61a90c4f6
Steps to reproduce
- Create new user with same display and user name
- Error message appears at the top right
- Close modal and search for the created user
- User could be found
Expected behavior
No error message should occur on same user and display name.
Installation method
Community Docker image
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.0
Web server
Nginx
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
Updated from a minor version (ex. 22.2.3 to 22.2.4)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
- [X] Default user-backend (database)
- [ ] LDAP/ Active Directory
- [ ] SSO - SAML
- [ ] Other
Configuration report
{
"system": {
"simpleSignUpLink.shown": false,
"memcache.local": "\\OC\\Memcache\\APCu",
"apps_paths": [{
"path": "\/var\/www\/html\/apps",
"url": "\/apps",
"writable": false
},
{
"path": "\/var\/www\/html\/custom_apps",
"url": "\/custom_apps",
"writable": true
}
],
"loglevel": 2,
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"***REMOVED SENSITIVE VALUE***"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "24.0.4.1",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"instanceid": "***REMOVED SENSITIVE VALUE***",
"default_language": "de",
"default_locale": "de",
"default_phone_region": "DE",
"mail_smtpmode": "smtp",
"mail_smtpauthtype": "LOGIN",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"templatedirectory": "\/var\/www\/html\/core\/skeleton\/Templates\/",
"enabledPreviewProviders": [
"OC\\Preview\\PNG",
"OC\\Preview\\JPEG",
"OC\\Preview\\GIF",
"OC\\Preview\\BMP",
"OC\\Preview\\XBitmap",
"OC\\Preview\\MP3",
"OC\\Preview\\TXT",
"OC\\Preview\\MarkDown",
"OC\\Preview\\OpenDocument",
"OC\\Preview\\Krita",
"OC\\Preview\\HEIC"
],
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": "6379",
"timeout": "1.5",
"dbindex": "0"
},
"memcache.locking": "\\OC\\Memcache\\Redis",
"memcache.distributed": "\\OC\\Memcache\\Redis"
}
}
List of activated Apps
Enabled:
- accessibility: 1.10.0
- activity: 2.16.0
- circles: 24.0.1
- cloud_federation_api: 1.7.0
- comments: 1.14.0
- contactsinteraction: 1.5.0
- dashboard: 7.4.0
- dav: 1.22.0
- federatedfilesharing: 1.14.0
- federation: 1.14.0
- files: 1.19.0
- files_pdfviewer: 2.5.0
- files_rightclick: 1.3.0
- files_sharing: 1.16.2
- files_trashbin: 1.14.0
- files_versions: 1.17.0
- files_videoplayer: 1.13.0
- firstrunwizard: 2.13.0
- logreader: 2.9.0
- lookup_server_connector: 1.12.0
- nextcloud_announcements: 1.13.0
- notifications: 2.12.0
- notify_push: 0.4.0
- oauth2: 1.12.0
- password_policy: 1.14.0
- photos: 1.6.0
- privacy: 1.8.0
- provisioning_api: 1.14.0
- recommendations: 1.3.0
- serverinfo: 1.14.0
- settings: 1.6.0
- sharebymail: 1.14.0
- support: 1.7.0
- survey_client: 1.12.0
- systemtags: 1.14.0
- text: 3.5.1
- twofactor_backupcodes: 1.13.0
- updatenotification: 1.14.0
- user_status: 1.4.0
- viewer: 1.8.0
- weather_status: 1.4.0
- workflowengine: 2.6.0
Disabled:
- admin_audit
- encryption
- files_external
- theming: 1.15.0
- user_ldap
Nextcloud Signing status
No errors have been found.
Nextcloud Logs
{"reqId":"48uZMG0da0UQUhAuoSY3","level":2,"time":"2022-08-18T07:45:20+00:00","remoteAddr":"<REDACTED>","user":"Admin","app":"ocs_api","method":"POST","url":"/ocs/v2.php/cloud/users","message":"{\"Exception\":\"OCP\\\\AppFramework\\\\OCS\\\\OCSException\",\"Message\":\"Invalid displayname\",\"Code\":102,\"Trace\":[{\"file\":\"/var/www/html/apps/provisioning_api/lib/Controller/UsersController.php\",\"line\":429,\"function\":\"editUser\",\"class\":\"OCA\\\\Provisioning_API\\\\Controller\\\\UsersController\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\",\"display\",\"*** sensitive parameters replaced ***\"]},{\"file\":\"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":225,\"function\":\"addUser\",\"class\":\"OCA\\\\Provisioning_API\\\\Controller\\\\UsersController\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":133,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Provisioning_API\\\\Controller\\\\UsersController\"},\"addUser\"]},{\"file\":\"/var/www/html/lib/private/AppFramework/App.php\",\"line\":172,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\",\"args\":[{\"__class__\":\"OCA\\\\Provisioning_API\\\\Controller\\\\UsersController\"},\"addUser\"]},{\"file\":\"/var/www/html/lib/private/Route/Router.php\",\"line\":298,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\",\"args\":[\"OCA\\\\Provisioning_API\\\\Controller\\\\UsersController\",\"addUser\",{\"__class__\":\"OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer\"},[\"ocs.provisioning_api.Users.addUser\"]]},{\"file\":\"/var/www/html/ocs/v1.php\",\"line\":62,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\",\"args\":[\"/ocsapp/cloud/users\"]},{\"file\":\"/var/www/html/ocs/v2.php\",\"line\":23,\"args\":[\"/var/www/html/ocs/v1.php\"],\"function\":\"require_once\"}],\"File\":\"/var/www/html/apps/provisioning_api/lib/Controller/UsersController.php\",\"Line\":841,\"message\":\"Failed addUser attempt with ocs exeption.\",\"exception\":{},\"CustomMessage\":\"Failed addUser attempt with ocs exeption.\"}","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.83 Safari/537.36","version":"24.0.4.1"}
Additional info
No response
I can confirm this issue. We are facing this too.
same issue with versions 23.0.0, 23.0.8 and 24.0.5
Does anyone have any update on this topic? We are having the same problem with versions 22.2.6, 24.0.5, 24.0.6.
Could you please assign it at least to a milestone?
This bug is frustrating, I really hope it will be fixed soon.
@Donniewr how about being politely when using software for free maintained by other ppl?
this bug is fixed for v25: https://github.com/nextcloud/server/pull/33625 back-porting looks complicated according to the comments on the ticket, so please update. I am closing it as resolved. If someone have any idea how to backport it properly, open this ticket again.