[Bug]: Exception when typing user id with `@` character in *External shares* field
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
When typing the user id into the field for External shares an exception occurs imediately after typing @ character.
Example: Typing via keyboard user@ will cause the exception.
Workaround is to use a different character than @ e.g. a dot . and finalize typing the complete feration id. After that replace the dot with an @
Or another workaround is to paste the complete federation id directly into the field.
Steps to reproduce
See attached screenrecordings for the steps.
1. Exception when typing the characters one by one and ending with an @
https://github.com/user-attachments/assets/8168ff2e-538b-4af2-bc6f-7c7125dc637c
2. Workaround via placeholder
https://github.com/user-attachments/assets/c44e0ee8-698e-45d7-89d5-f9d0c4793fd3
3. Workaround via pasting the complete federation id
https://github.com/user-attachments/assets/119ac3bb-db37-4efc-adc0-117031c2a812
Expected behavior
Do not throw an exception when typing the user id for federated shares.
Nextcloud Server version
31
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Apache (supported)
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?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"domain.tld"
],
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"forwarded_for_headers": [
"HTTP_X_FORWARDED_FOR"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "31.0.5.1",
"overwrite.cli.url": "https:\/\/yournextcloud.tld",
"overwriteprotocol": "https",
"overwritehost": "yournextcloud.tld",
"htaccess.RewriteBase": "\/",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"maintenance": false,
"memcache.local": "\\OC\\Memcache\\APCu",
"memcache.distributed": "\\OC\\Memcache\\Redis",
"filelocking.enabled": true,
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 6379,
"timeout": 0,
"read_timeout": 0
},
"theme": "",
"loglevel": "2",
"logtimezone": "Europe\/Berlin",
"updater.release.channel": "stable",
"mail_smtpmode": "smtp",
"mail_sendmailmode": "smtp",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtpsecure": "ssl",
"mail_smtpauthtype": "LOGIN",
"mail_smtpauth": 1,
"mail_smtpport": "465",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"defaultapp": "files",
"default_phone_region": "DE",
"enforce_theme": "",
"profile.enabled": false,
"maintenance_window_start": 1,
}
}
List of activated Apps
Enabled:
- activity: 4.0.0
- app_api: 5.0.2
- calendar: 5.2.4
- checksum: 1.2.6
- circles: 31.0.0
- cloud_federation_api: 1.14.0
- comments: 1.21.0
- contacts: 7.1.0
- dav: 1.33.0
- deck: 1.15.1
- federatedfilesharing: 1.21.0
- federation: 1.21.0
- files: 2.3.1
- files_downloadactivity: 1.18.1
- files_downloadlimit: 4.0.0
- files_external: 1.23.0
- files_pdfviewer: 4.0.0
- files_reminders: 1.4.0
- files_sharing: 1.23.1
- files_trashbin: 1.21.0
- files_versions: 1.24.0
- firstrunwizard: 4.0.0
- forms: 5.1.0
- groupfolders: 19.0.4
- logreader: 4.0.0
- lookup_server_connector: 1.19.0
- nextcloud_announcements: 3.0.0
- notes: 4.12.0
- notifications: 4.0.0
- oauth2: 1.19.1
- password_policy: 3.0.0
- photos: 4.0.0-dev.1
- polls: 7.4.2
- privacy: 3.0.0
- profile: 1.0.0
- provisioning_api: 1.21.0
- quota_warning: 1.21.0
- related_resources: 2.0.0
- serverinfo: 3.0.0
- settings: 1.14.0
- sharebymail: 1.21.0
- sharereview: 1.3.3
- spreed: 21.0.4
- survey_client: 3.0.0
- systemtags: 1.21.1
- tasks: 0.16.1
- text: 5.0.0
- theming: 2.6.1
- twofactor_backupcodes: 1.20.0
- twofactor_totp: 13.0.0-dev.0
- twofactor_webauthn: 2.1.0
- updatenotification: 1.21.0
- viewer: 4.0.0
- webhook_listeners: 1.2.0
- whiteboard: 1.0.5
- workflowengine: 2.13.0
Disabled:
- admin_audit: 1.21.0
- breezedark: 29.0.0 (installed 29.0.0)
- bruteforcesettings: 4.0.0 (installed 4.0.0)
- contactsinteraction: 1.12.0 (installed 1.12.0)
- dashboard: 7.11.0 (installed 7.4.0)
- encryption: 2.19.0
- files_rightclick: 0.15.1 (installed 1.6.0)
- recommendations: 4.0.0 (installed 0.7.0)
- side_menu: 5.1.0 (installed 5.1.0)
- support: 3.0.0 (installed 1.4.0)
- suspicious_login: 9.0.1
- twofactor_nextcloud_notification: 5.0.0
- user_ldap: 1.22.0
- user_status: 1.11.0 (installed 1.3.1)
- weather_status: 1.11.0 (installed 1.3.0)
Nextcloud Signing status
No errors have been found.
Nextcloud Logs
Error no app in context InvalidArgumentException: Invalid Federated Cloud ID at 2025-05-16T17:17:58+02:00
.../Collaboration/Collaborators/RemoteGroupPlugin.php line 69
0. .../RemoteGroupPlugin.php line 39
OC\Collaboration\Collaborators\RemoteGroupPlugin->splitGroupRemote(
... @"
)
1. .../Search.php line 46
OC\Collaboration\Collaborators\RemoteGroupPlugin->search(
"user@",
25,
0,
OC ... {}
)
2. .../ShareesAPIController.php line 181
OC\Collaboration\Collaborators\Search->search(
"user@",
[4,6,9],
false,
25,
0
)
3. .../Dispatcher.php line 200
OCA\Files_Sharing\Controller\ShareesAPIController->search(
"user@",
"file",
1,
25,
[ ... "],
false
)
4. .../Dispatcher.php line 114
OC\AppFramework\Http\Dispatcher->executeController(
OCA\File ... {},
"search"
)
5. .../App.php line 161
OC\AppFramework\Http\Dispatcher->dispatch(
OCA\Files_Sharing ... {},
"search"
)
6. lib/private/Route/Router.php line 307
OC\AppFramework\App::main(
"OCA\\Files_Sharing\\Controller\\ ... r",
"search",
OC\AppFramework\DependencyInjecti ... {},
{_route:"ocs.files_sharing.sharee ... "}
)
7. ocs/v1.php line 49
OC\Route\Router->match("\/ocsapp\/apps\/files_sharing\/api\ ... s")
8. ocs/v2.php line 7
require_once("\/var\/www\/html\/nextcloud\/nc_instance\/ ... p")
Caused by InvalidArgumentException: Invalid cloud id at
lib/private/Federation/CloudIdManager.php line 119
0. .../RemoteGroupPlugin.php line 66
OC\Federation\CloudIdManager->resolveCloudId("user@")
1. .../RemoteGroupPlugin.php line 39
OC\Collaboration\Collaborators\RemoteGroupPlugin->splitGroupRemote(
... @"
)
2. .../Search.php line 46
OC\Collaboration\Collaborators\RemoteGroupPlugin->search(
"user@",
25,
0,
OC ... {}
)
3. .../ShareesAPIController.php line 181
OC\Collaboration\Collaborators\Search->search(
"user@",
[4,6,9],
false,
25,
0
)
4. .../Dispatcher.php line 200
OCA\Files_Sharing\Controller\ShareesAPIController->search(
"user@",
"file",
1,
25,
[ ... "],
false
)
5. .../Dispatcher.php line 114
OC\AppFramework\Http\Dispatcher->executeController(
OCA\File ... {},
"search"
)
6. .../App.php line 161
OC\AppFramework\Http\Dispatcher->dispatch(
OCA\Files_Sharing ... {},
"search"
)
7. lib/private/Route/Router.php line 307
OC\AppFramework\App::main(
"OCA\\Files_Sharing\\Controller\\ ... r",
"search",
OC\AppFramework\DependencyInjecti ... {},
{_route:"ocs.files_sharing.sharee ... "}
)
8. ocs/v1.php line 49
OC\Route\Router->match("\/ocsapp\/apps\/files_sharing\/api\ ... s")
9. ocs/v2.php line 7
require_once("\/var\/www\/html\/nextcloud\/nc_instance\/ ... p")
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 with lib/private/Collaboration/Collaborators/RemoteGroupPlugin.php at line 69, then trace the call through Search.php and ShareesAPIController.php. Reproduce the search with the input "user@" and inspect how the Invalid Federated Cloud ID exception is handled. Done means typing an incomplete federated user ID ending in @ no longer throws an exception and the complete ID can still be entered.
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
- 35/100