[Bug]: Using UUIDs for usernames breaks xml-api, if UUID starts with a digit.
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
Using UUIDs for usernames breaks xml-api, if UUID starts with a digit (maybe every username that starts with a digit is broken?)
It does not seem to be broken, when using format=json (which doesnt help much, since the administrative account page uses the xml call)
I have been tinkering for many, many hours and finally came to this exception:
ValueError: XMLWriter::startElement(): Argument #2 must be a valid element name, "1CA11E1C-FAA5-4187-B46F-E06370ABF51F" given at /opt/nextcloud/lib/private/AppFramework/OCS/BaseResponse.php#139
Steps to reproduce
curl -u "admin:pw" -X GET 'https://.../ocs/v2.php/cloud/users/details?offset=0&limit=25&search=' -H "OCS-APIRequest: true" -v | less- Works
- Create account
1CA11E1C-FAA5-4187-B46F-E06370ABF51Fvia admin account page. curl -u "admin:pw" -X GET 'https://.../ocs/v2.php/cloud/users/details?offset=0&limit=25&search=' -H "OCS-APIRequest: true" -v | less- Document is empty now.
Expected behavior
That creating UUID or maybe in general account names that start with digits do not break the XML-API.
Nextcloud Server version
30
Operating system
RHEL/CentOS
PHP engine version
PHP 8.2
Web server
Apache (supported)
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response
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 at lib/private/AppFramework/OCS/BaseResponse.php around line 139 and reproduce the failure with the documented OCS users/details curl request. Trace how the UUID becomes an XML element name, then verify that the XML API returns a valid document when a username starts with a digit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100