nextcloud / nextcloud/server

[Bug]: Checksum recorded in file cache not copied when file is copied

Open
#52,370 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 31-feedback bug
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 a checksum is recorded in the file cache for a file, that checksum is not included in the file metadata that is duplicated for the new file cache records when the file is copied. Size, timestamps, mime type, etc. are all duplicated, but not the previously recorded checksum.

Steps to reproduce
  1. Upload a file using a client that reports the checksum of the file on upload.
  2. Copy the file to another location within Nextcloud using either the UI or WebDAV.
  3. The file cache metadata for the new copy does not include the previously recorded checksum.
Expected behavior

The file cache metadata for the new copy would include the previously recorded checksum.

Nextcloud Server version

31

Operating system

RHEL/CentOS

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

PostgreSQL

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
{
    "system": {
        "debug": false,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "trusted_domains": [
            "***REMOVED SENSITIVE VALUE***",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "logfile":  "***REMOVED SENSITIVE VALUE***",
        "loglevel": 0,
        "log_rotate_size": 0,
        "loglevel_dirty_database_queries": 1,
        "overwrite.cli.url":  "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "31.0.2.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "htaccess.RewriteBase": "\/",
        "knowledgebaseenabled": false,
        "auth.bruteforce.protection.enabled": false,
        "skeletondirectory": "",
        "updatechecker": false,
        "appstoreenabled": false,
        "enable_previews": false,
        "cron_log": true,
        "maintenance": false,
        "maintenance_window_start": 1,
        "integrity.check.disabled": true,
        "mail_sendmailmode": "smtp",
        "mail_smtpmode": "sendmail",
        "mail_smtpauthtype": "PLAIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "sharing.enable_autocomplete": false,
        "sharing.minSearchStringLength": 99,
        "sharing.maxAutocompleteResults": 0,
        "session_lifetime": 31536000,
        "session_keepalive": true,
        "remember_login_cookie_lifetime": 31536000,
        "localstorage.allowsymlinks": true,
        "apps_paths": [
            {
                "path": "***REMOVED SENSITIVE VALUE***",
                "url": "\/apps",
                "writable": true
            }
        ],
        "gs.enabled": false,
        "app_install_overwrite": [
            "ida"
        ],
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "theme": "ida",
        "config_is_read_only": true,
        "default_language": "en",
        "default_locale": "fi_FI",
        "default_phone_region": "FI",
        "reduce_to_languages": [
            "en",
            "fi",
            "sv"
        ],
        "default_timezone": "UTC",
        "knowledgebase.embedded": false,
        "enable_avatars": false,
        "allow_user_to_change_display_name": false,
        "logtimezone": "UTC",
        "logdateformat": "Y-m-d\\TH:i:s\\Z"
    }
}
List of activated Apps
Enabled:
  - admin_audit: 1.21.0
  - app_api: 5.0.2
  - cloud_federation_api: 1.14.0
  - dav: 1.33.0
  - federatedfilesharing: 1.21.0
  - files: 2.3.1
  - files_sharing: 1.23.1
  - ida: 3
  - lookup_server_connector: 1.19.0
  - oauth2: 1.19.1
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - settings: 1.14.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - viewer: 4.0.0
  - workflowengine: 2.13.0
Disabled:
  - activity: 4.0.0 (installed 4.0.0)
  - bruteforcesettings: 4.0.0 (installed 4.0.0)
  - circles: 31.0.0 (installed 31.0.0)
  - comments: 1.21.0 (installed 1.21.0)
  - contactsinteraction: 1.12.0 (installed 1.12.0)
  - dashboard: 7.11.0 (installed 7.11.0)
  - encryption: 2.19.0
  - federation: 1.21.0 (installed 1.21.0)
  - files_downloadlimit: 4.0.0 (installed 4.0.0)
  - files_external: 1.23.0
  - files_pdfviewer: 4.0.0 (installed 4.0.0)
  - files_reminders: 1.4.0 (installed 1.4.0)
  - files_trashbin: 1.21.0 (installed 1.21.0)
  - files_versions: 1.24.0 (installed 1.24.0)
  - firstrunwizard: 4.0.0 (installed 4.0.0)
  - logreader: 4.0.0 (installed 4.0.0)
  - nextcloud_announcements: 3.0.0 (installed 3.0.0)
  - notifications: 4.0.0 (installed 4.0.0)
  - password_policy: 3.0.0 (installed 3.0.0)
  - photos: 4.0.0-dev.1 (installed 4.0.0-dev.1)
  - privacy: 3.0.0 (installed 3.0.0)
  - recommendations: 4.0.0 (installed 4.0.0)
  - related_resources: 2.0.0 (installed 2.0.0)
  - serverinfo: 3.0.0 (installed 3.0.0)
  - sharebymail: 1.21.0 (installed 1.21.0)
  - support: 3.0.0 (installed 3.0.0)
  - survey_client: 3.0.0 (installed 3.0.0)
  - suspicious_login: 9.0.1
  - systemtags: 1.21.1 (installed 1.21.1)
  - text: 5.0.0 (installed 5.0.0)
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - updatenotification: 1.21.0 (installed 1.21.0)
  - user_ldap: 1.22.0
  - user_status: 1.11.0 (installed 1.11.0)
  - weather_status: 1.11.0 (installed 1.11.0)
  - webhook_listeners: 1.2.0 (installed 1.2.0)
Nextcloud Signing status

Nextcloud Logs

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 file-cache metadata handling used by the upload and copy paths described in the reproduction steps. Compare which metadata fields are duplicated during a copy, then verify that the recorded checksum is retained for the new file-cache record; the issue names no specific source file or test to run.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.