nextcloud / nextcloud/server

File attributes get lost when uploaded to a external SMB/CIFS share

Open
#48,885 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 30-feedback bug feature: external storage
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

⚠️ This issue respects the following points: ⚠️
Bug description

When using SMB share as external storage and one does upload a file via any endpoint (browser/desktop app/ios app) to that share, file attributes change.

Steps to reproduce
  1. Configure a SMB/CIFS share as external storage
  2. upload a file, e.g. a photo to that share
  3. check the file attribute of the uploaded photo on the SMB share, learn that the date/time of last modified is set to the time when uploaded to the share, not date/time when you took the photo, as the file had before.
  4. feel annoyed of that behavior, because your photo library is a mess now...

My setup: nextcloud latest stable, nginx, mysql, tested using desktop app, ios app and firefox as client.

Expected behavior

Leave file attributes untouched, like any other smb client using that same share does.

Nextcloud Server version

30

Operating system

Debian/Ubuntu

PHP engine version

None

Web server

Nginx

Database engine version

MySQL

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

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

occ config:list system:

{
"system": {
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"XXXXX"
],
"datadirectory": "REMOVED SENSITIVE VALUE",
"dbtype": "mysql",
"version": "30.0.0.14",
"overwrite.cli.url": "https://nc.humph.ddnss.de",
"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",
"overwritehost": "XXXXXX",
"activity_expire_days": 14,
"allow_local_remote_servers": true,
"auth.bruteforce.protection.enabled": true,
"forbidden_filenames": [
".htaccess",
"Thumbs.db",
"thumbs.db"
],
"cron_log": true,
"default_phone_region": "XX",
"enable_previews": true,
"enabledPreviewProviders": [
"OC\Preview\PNG",
"OC\Preview\JPEG",
"OC\Preview\GIF",
"OC\Preview\BMP",
"OC\Preview\XBitmap",
"OC\Preview\Movie",
"OC\Preview\PDF",
"OC\Preview\MP3",
"OC\Preview\TXT",
"OC\Preview\MarkDown",
"OC\Preview\HEIC",
"OC\Preview\Movie",
"OC\Preview\MKV",
"OC\Preview\MP4",
"OC\Preview\AVI"
],
"filesystem_check_changes": 0,
"filelocking.enabled": "true",
"htaccess.RewriteBase": "/",
"integrity.check.disabled": false,
"knowledgebaseenabled": false,
"log_rotate_size": "104857600",
"logfile": "/var/log/nextcloud/nextcloud.log",
"loglevel": 2,
"logtimezone": "XXXXX",
"memcache.local": "\OC\Memcache\APCu",
"memcache.locking": "\OC\Memcache\Redis",
"overwriteprotocol": "https",
"preview_max_x": 1024,
"preview_max_y": 768,
"preview_max_scale_factor": 1,
"profile.enabled": false,
"redis": {
"host": "REMOVED SENSITIVE VALUE",
"port": 0,
"password": "REMOVED SENSITIVE VALUE",
"timeout": 0.5,
"dbindex": 1
},
"quota_include_external_storage": false,
"share_folder": "/Shared",
"skeletondirectory": "",
"trashbin_retention_obligation": "auto, 7",
"maintenance_window_start": 1,
"maintenance": false,
"mail_from_address": "REMOVED SENSITIVE VALUE",
"mail_smtpmode": "smtp",
"mail_sendmailmode": "smtp",
"mail_domain": "REMOVED SENSITIVE VALUE",
"mail_smtphost": "REMOVED SENSITIVE VALUE",
"mail_smtpport": "587",
"mail_smtpauth": 1,
"mail_smtpname": "REMOVED SENSITIVE VALUE",
"mail_smtppassword": "REMOVED SENSITIVE VALUE",
"auto_logout": true

List of activated Apps

occ app:list:

Enabled:

  • activity: 3.0.0
  • admin_audit: 1.20.0
  • bruteforcesettings: 3.0.0
  • calendar: 5.0.0
  • circles: 30.0.0-dev
  • cloud_federation_api: 1.13.0
  • comments: 1.20.1
  • contacts: 6.1.0
  • contactsinteraction: 1.11.0
  • dashboard: 7.10.0
  • dav: 1.31.1
  • federatedfilesharing: 1.20.0
  • files: 2.2.0
  • files_downloadlimit: 3.0.0
  • files_external: 1.22.0
  • files_pdfviewer: 3.0.0
  • files_reminders: 1.3.0
  • files_sharing: 1.22.0
  • files_trashbin: 1.20.1
  • files_versions: 1.23.0
  • groupfolders: 18.0.2
  • lookup_server_connector: 1.18.0
  • mail: 4.0.1
  • nextcloud_announcements: 2.0.0
  • notifications: 3.0.0
  • oauth2: 1.18.1
  • password_policy: 2.0.0
  • passwords: 2024.9.20
  • photos: 3.0.2
  • privacy: 2.0.0
  • provisioning_api: 1.20.0
  • recommendations: 3.0.0
  • related_resources: 1.5.0
  • richdocuments: 8.5.1
  • richdocumentscode: 24.4.802
  • serverinfo: 2.0.0
  • settings: 1.13.0
  • sharebymail: 1.20.0
  • spreed: 20.0.1
  • systemtags: 1.20.0
  • text: 4.1.0
  • theming: 2.5.0
  • twofactor_backupcodes: 1.19.0
  • twofactor_totp: 12.0.0-dev
  • updatenotification: 1.20.0
  • user_status: 1.10.0
  • viewer: 3.0.0
  • weather_status: 1.10.0
  • webhook_listeners: 1.1.0-dev
  • workflowengine: 2.12.0
    Disabled:
  • encryption: 2.18.0
  • federation: 1.20.0 (installed 1.20.0)
  • firstrunwizard: 3.0.0 (installed 3.0.0)
  • logreader: 3.0.0 (installed 3.0.0)
  • support: 2.0.0 (installed 2.0.0)
  • survey_client: 2.0.0 (installed 2.0.0)
  • suspicious_login: 8.0.0
  • twofactor_nextcloud_notification: 4.0.0
  • user_ldap: 1.21.
Nextcloud Signing status

No errors have been found.

Nextcloud Logs

No response

Additional info

No response

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 by tracing the external-storage SMB upload path in the Nextcloud server and reproduce the upload using the reported browser, desktop, or iOS flow. Compare the uploaded file's modification time with the source file; done means the SMB copy preserves the source file attributes without regressing other uploads.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.