nextcloud / nextcloud/files_versions_s3

files_versions_s3 incorrectly rejects S3 buckets using $user placeholder as “not DNS compatible”

Open
#149 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
20
Forks
2
Avg merge
4m
Merged PRs (30d)
1

Description

Steps to reproduce
  1. Configure an external storage of type Amazon S3 in Nextcloud using a bucket name containing the $user placeholder. Example:
   bucket: "nextcloud.corp.$user"
   hostname: "s3.bhs.io.cloud.ovh.net"
   region: "bhs"
   use_ssl: true
   use_path_style: true
  1. Enable and configure the files_versions_s3 app.
  2. Run: php occ files_versions_s3:status
  3. Check the status output for the affected mount.
Expected behaviour

The app should correctly accept bucket definitions containing the $user placeholder and handle variable expansion before DNS validation.

Expected outcomes:

  • The bucket name validation should occur after placeholder expansion.
  • Or the app should not treat $user as part of the literal DNS name.

Using $user should not prevent the versions bucket from being created or managed.

Actual behaviour

Running: php occ files_versions_s3:status

returns:
- 4 ("/NC-DATAenligne"): The bucket will not be created because the name is not dns compatible, please correct it: nextcloud.corp.$user

Notes:

  • The external S3 mount works normally for all users.
  • The app refuses to create/manage the versions bucket because $user makes it fail the DNS compatibility check.
Server configuration

Web server: Apache/2.4.65 (cPanel)
Database: MySQL/MariaDB Ver 8.0.44
PHP version: 8.3 (EA-PHP 8.3)

Nextcloud version: 32.0.2
files_versions_s3 version: 1.3.0


External storage configuration

/opt/cpanel/ea-php83/root/usr/bin/php occ files_external:list

+----------+-----------------+-----------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+------------------+-------------------+
| Mount ID | Mount Point     | Storage   | Authentication Type | Configuration                                                                                                                                                                                                                                                                                                                  | Options              | Applicable Users | Applicable Groups |
+----------+-----------------+-----------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+------------------+-------------------+
| 4        | /NC-DATAenligne | Amazon S3 | Access key          | bucket: "nextcloud.corp.$user", hostname: "s3.bhs.io.cloud.ovh.net", port: "443", region: "bhs", use_ssl: true, use_path_style: true, legacy_auth: false, useMultipartCopy: true, key: "***REMOVED***", secret: "***REMOVED***", objectroot: "$user", storageClass: "", sse_c_key: "" | enable_sharing: true | All              |                   |
+----------+-----------------+-----------+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+------------------+-------------------+

List of activated apps php occ app:list

Enabled:

  • activity: 5.0.0-dev.0
  • admin_audit: 1.22.0
  • appointments: 2.6.2
  • assistant: 2.9.0
  • calendar: 6.1.0
  • circles: 32.0.0
  • cloud_federation_api: 1.16.0
  • collectives: 3.3.0
  • comments: 1.22.0
  • contacts: 8.1.0
  • contactsinteraction: 1.13.1
  • dashboard: 7.12.0
  • dav: 1.34.2
  • deck: 1.16.2
  • federatedfilesharing: 1.22.0
  • federation: 1.22.0
  • files: 2.4.0
  • files_downloadlimit: 5.0.0-dev.0
  • files_external: 1.24.0
  • files_pdfviewer: 5.0.0-dev.0
  • files_reminders: 1.5.0
  • files_sharing: 1.24.1
  • files_trashbin: 1.22.0
  • files_versions: 1.25.0
  • files_versions_s3: 1.3.0
  • firstrunwizard: 5.0.0-dev.0
  • flow_notifications: 3.0.0
  • forms: 5.2.3
  • integration_openai: 3.9.1
  • integration_slack: 2.2.1
  • logreader: 5.0.0-dev.0
  • lookup_server_connector: 1.20.0
  • mail: 5.6.1
  • nextcloud_announcements: 4.0.0-dev.0
  • notes: 4.12.4
  • notifications: 5.0.0-dev.0
  • notify_push: 1.2.1
  • oauth2: 1.20.0
  • onlyoffice: 9.11.0
  • password_policy: 4.0.0-dev.0
  • passwords: 2025.11.20
  • photos: 5.0.0-dev.1
  • privacy: 4.0.0-dev.0
  • profile: 1.1.0
  • provisioning_api: 1.22.0
  • recommendations: 5.0.0-dev.0
  • related_resources: 3.0.0-dev.0
  • serverinfo: 4.0.0-dev.0
  • settings: 1.15.1
  • sharebymail: 1.22.0
  • spreed: 22.0.4
  • support: 4.0.0-dev.0
  • survey_client: 4.0.0-dev.0
  • systemtags: 1.22.0
  • text: 6.0.1
  • theming: 2.7.0
  • twofactor_backupcodes: 1.21.0
  • twofactor_totp: 14.0.0
  • updatenotification: 1.22.0
  • user_status: 1.12.0
  • viewer: 5.0.0-dev.0
  • weather_status: 1.12.0
  • webhook_listeners: 1.3.0
  • whiteboard: 1.4.2
  • workflow_script: 3.0.0
  • workflowengine: 2.14.0
    Disabled:
  • app_api: 32.0.0 (installed 32.0.0)
  • bruteforcesettings: 5.0.0-dev.0 (installed 2.6.0)
  • encryption: 2.20.0 (installed 2.11.0)
  • richdocuments: 9.0.2 (installed 9.0.2)
  • richdocumentscode: 25.4.702 (installed 25.4.702)
  • suspicious_login: 10.0.0-dev.0
  • translate: 2.2.0 (installed 2.2.0)
  • twofactor_nextcloud_notification: 6.0.0-dev.0
  • user_ldap: 1.23.0
Nextcloud configuration php occ config:list system

{
"system": {
"instanceid": "REMOVED SENSITIVE VALUE",
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"datadirectory": "REMOVED SENSITIVE VALUE",
"dbtype": "mysql",
"version": "32.0.2.2",
"dbname": "REMOVED SENSITIVE VALUE",
"dbhost": "REMOVED SENSITIVE VALUE",
"dbport": "",
"dbtableprefix": "oc_",
"dbuser": "REMOVED SENSITIVE VALUE",
"dbpassword": "REMOVED SENSITIVE VALUE",
"installed": true,
"trashbin_retention_obligation": "auto,7",
"integrity.check.disabled": true,
"maintenance": false,
"theme": "",
"default_phone_region": "CA",
"loglevel": 3,
"quota_include_external_storage": true,
"preview_max_x": 512,
"preview_max_y": 512,
"preview_max_scale_factor": 1,
"mysql.utf8mb4": true,
"app_install_overwrite": [
"onlyoffice",
"passwords",
"event_update_notification",
"bruteforcesettings",
"documentserver_community"
],
"mail_smtpmode": "sendmail",
"mail_smtpauthtype": "PLAIN",
"mail_sendmailmode": "smtp",
"mail_from_address": "REMOVED SENSITIVE VALUE",
"mail_domain": "REMOVED SENSITIVE VALUE",
"mail_smtpauth": 1,
"mail_smtphost": "REMOVED SENSITIVE VALUE",
"mail_smtpport": "25",
"mail_smtpname": "REMOVED SENSITIVE VALUE",
"mail_smtppassword": "REMOVED SENSITIVE VALUE",
"memcache.local": "\OC\Memcache\Redis",
"memcache.locking": "\OC\Memcache\Redis",
"filelocking.enabled": true,
"redis": {
"host": "REMOVED SENSITIVE VALUE",
"port": 6379
},
"defaultapp": "",
"maintenance_window_start": 100,
"simpleSignUpLink.shown": false,
"trusted_proxies": "REMOVED SENSITIVE VALUE",
"forwarded_for_headers": [
"HTTP_X_FORWARDED_FOR"
],
"allow_local_remote_servers": true
}
}


Additional information
  • S3 backend: OVH Object Storage

    Endpoint: s3.bhs.io.cloud.ovh.net
    Region: bhs
    
  • The external storage is working normally for all file operations.

  • The issue happens only in the bucket name validation of files_versions_s3 when $user is included.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the files_versions_s3 app and run php occ files_versions_s3:status using an external S3 bucket named nextcloud.corp.$user. Trace the bucket validation from this command and verify that $user is handled before DNS compatibility is checked, with the versions bucket accepted and managed successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.