[Bug]: SMB share with trailing dollar sign on 28.0.2 generates error during occ files:scan
Open
Nobody has claimed this yet.
0. Needs triage
28-feedback
bug
feature: external storage
feature: occ
hotspot: filename handling
- 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
During a file scan for a user having external smb storage with a dollar sign the following error happens:
Error during scan: Couldn't get xattr for smb://10.1.2.3/some.user$/: unknown error (13)
Exception during scan: Invalid request for / (ForbiddenException)
#0 /var/www/nextcloud/apps/files_external/lib/Lib/Storage/SMB.php(696): OCA\Files_External\Lib\Storage\SMB->getFileInfo()
#1 /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(224): OCA\Files_External\Lib\Storage\SMB->file_exists()
#2 /var/www/nextcloud/lib/private/Files/Utils/Scanner.php(263): OC\Files\Storage\Wrapper\Wrapper->file_exists()
#3 /var/www/nextcloud/apps/files/lib/Command/Scan.php(180): OC\Files\Utils\Scanner->scan()
#4 /var/www/nextcloud/apps/files/lib/Command/Scan.php(241): OCA\Files\Command\Scan->scanFiles()
#5 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(298): OCA\Files\Command\Scan->execute()
#6 /var/www/nextcloud/core/Command/Base.php(177): Symfony\Component\Console\Command\Command->run()
#7 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1040): OC\Core\Command\Base->run()
#8 /var/www/nextcloud/3rdparty/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#9 /var/www/nextcloud/3rdparty/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#10 /var/www/nextcloud/lib/private/Console/Application.php(206): Symfony\Component\Console\Application->run()
#11 /var/www/nextcloud/console.php(100): OC\Console\Application->run()
#12 /var/www/nextcloud/occ(11): require_once('...')
#13 {main}
Steps to reproduce
- Run php occ files:scan --all
- Wait
- Error shows up
Expected behavior
No error
Installation method
Community Manual installation with Archive
Nextcloud Server version
28
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.2
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***",
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "mysql",
"version": "28.0.2.5",
"overwrite.cli.url": "https:\/\/cloud",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"force_language": "de",
"force_locale": "de_DE",
"defaultapp": "files",
"knowledgebaseenabled": false,
"allow_user_to_change_display_name": false,
"log_type": "file",
"loglevel": 3,
"logfile": "\/var\/log\/nextcloud\/nextcloud.log",
"log_rotate_size": 104857600,
"skeletondirectory": "",
"memcache.local": "\\OC\\Memcache\\Redis",
"filelocking.enabled": "true",
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 6379,
"timeout": 0,
"dbindex": 0
},
"maintenance": false,
"lost_password_link": "disabled",
"ldapIgnoreNamingRules": false,
"ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
"onlyoffice": {
"verify_peer_off": true
},
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"overwriteprotocol": "https",
"overwritewebroot": "\/\/",
"overwriteconaddr": "***REMOVED SENSITIVE VALUE***",
"csrf.disabled": true,
"updater.release.channel": "stable",
"theme": "",
"twofactor_enforced": "true",
"twofactor_enforced_groups": [],
"twofactor_enforced_excluded_groups": [],
"mail_smtpmode": "smtp",
"mail_smtpsecure": "ssl",
"mail_sendmailmode": "smtp",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtpauthtype": "LOGIN",
"mail_smtpauth": 1,
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "465",
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"default_phone_region": "DE",
"app_install_overwrite": [
"bbb",
"twofactor_admin",
"spreed"
],
"trashbin_retention_obligation": "auto, 31",
"maintenance_window_start": 1
}
}
List of activated Apps
Enabled:
- app_api: 2.0.4
- bbb: 2.5.0
- bruteforcesettings: 2.8.0
- calendar: 4.6.4
- circles: 28.0.0-dev
- cloud_federation_api: 1.11.0
- contacts: 5.5.1
- contactsinteraction: 1.9.0
- dashboard: 7.8.0
- dav: 1.29.1
- deck: 1.12.1
- drawio: 3.0.2
- eidlogin: 1.0.15
- federatedfilesharing: 1.18.0
- files: 2.0.0
- files_external: 1.20.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
- forms: 4.1.0
- integration_zammad: 2.0.6
- logreader: 2.13.0
- lookup_server_connector: 1.16.0
- mail: 3.5.5
- notifications: 2.16.0
- oauth2: 1.16.3
- ownpad: 0.10.0
- photos: 2.4.0
- polls: 6.0.1
- privacy: 1.12.0
- provisioning_api: 1.18.0
- related_resources: 1.3.0
- richdocuments: 8.3.1
- serverinfo: 1.18.0
- settings: 1.10.1
- smb_test: 0.3.8
- spreed: 18.0.3
- stt_helper: 1.1.0
- stt_whisper: 1.0.8
- text: 3.9.1
- theming: 2.3.0
- twofactor_admin: 4.4.0
- twofactor_backupcodes: 1.17.0
- twofactor_totp: 10.0.0-beta.2
- updatenotification: 1.18.0
- user_ldap: 1.19.0
- user_status: 1.8.1
- viewer: 2.2.0
- weather_status: 1.8.0
- workflowengine: 2.10.0
Disabled:
- activity: 2.20.0 (installed 2.9.1)
- admin_audit: 1.18.0
- assistant: 1.0.3 (installed 1.0.3)
- comments: 1.18.0 (installed 1.6.0)
- context_chat: 1.0.0 (installed 1.0.0)
- encryption: 2.16.0
- federation: 1.18.0 (installed 1.6.0)
- files_linkeditor: 1.1.16 (installed 1.1.16)
- files_markdown: 2.4.1 (installed 2.4.1)
- files_rightclick: 0.15.1 (installed 1.6.0)
- files_texteditor: 2.15.1 (installed 2.15.1)
- firstrunwizard: 2.17.0 (installed 2.5.0)
- nextcloud_announcements: 1.17.0 (installed 1.5.0)
- onlyoffice: 8.2.4 (installed 8.2.4)
- openotp_sign: 1.5.2 (installed 1.5.2)
- password_policy: 1.18.0 (installed 1.6.0)
- recommendations: 2.0.0 (installed 0.4.0)
- sharebymail: 1.18.0 (installed 1.6.0)
- support: 1.11.0 (installed 1.0.0)
- survey_client: 1.16.0 (installed 1.4.0)
- suspicious_login: 6.0.0
- systemtags: 1.18.0 (installed 1.6.0)
Nextcloud Signing status
No response
Nextcloud Logs
No response
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 in apps/files_external/lib/Lib/Storage/SMB.php around line 696, then trace the call from occ files:scan through Scanner and the SMB storage implementation. Reproduce with an external SMB share whose name ends in $, and consider the issue resolved when the scan completes without the xattr or ForbiddenException errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100