[Bug]: Some DB entries and the encrypted files they point to have a size mismatch

Ouverte
#66,475 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
mariadb, php
Domaine
backend, databases

Piste de recherche

Start by tracing how encrypted file sizes are written to oc_filecache and how WebDAV downloads use those values; the issue does not name a source file or test. Compare the binary and legacy base64 cases, including whether upgrades to Nextcloud 32 affect size updates. Done means identifying a reproducible cause and ensuring the database reports the correct size for the affected files.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

0. Needs triage 32-feedback bug
⚠️ This issue respects the following points: ⚠️
  • This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug (if unsure, ask the Community Help Forum).
  • This issue is not already reported on Github OR solved at the Community Help Forum (I've searched!).
  • I'm using a maintained major version of Nextcloud Server and tested against the latest patch level. (Supported major versions and current patch levels).
  • I agree to follow Nextcloud's Code of Conduct.
  • I've tried my best to provide clear reproduction steps that someone unfamiliar with this bug could use to reproduce it.
Bug description

I found 14 encrypted photos where size and unencrypted_size in oc_filecache are both zero, although the files on disk contain data. Nine use binary encoding and five use legacy base64.

I tested one binary-encrypted JPEG. Downloading it through WebDAV with rclone returned exit code 0, but the downloaded file was empty. Both database sizes stayed at zero after the download.

The size calculated from the encrypted file’s structure was 1,578,720 bytes. After setting both database size fields to that value, the download returned a JPEG of exactly that size without errors. I didn’t change the encrypted file, its keys, or its encryption version.

I don’t know what originally set the sizes to zero. One thing I noticed is that all 14 calculated sizes are exact multiples of the encryption block’s plaintext capacity—8,096 bytes for binary files or 6,072 for base64. That might be relevant?

I also encountered this, but this seems different: the example above uses binary encoding, and the sizes are zero rather than inflated.

I’ve left the other 13 entries unchanged. Is this a known issue, and what information would help investigate it?

Steps to reproduce
  1. There are no steps to reproduce it, I just scanned the database
Expected behavior

The DB should report the right size, not zero!

Nextcloud Server version

32

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

MariaDB

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

Upgraded to a MAJOR version (ex. 31 to 32)

Are you using the Nextcloud Server Encryption module?

Encryption is Enabled

What user-backends are you using?
  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other
Configuration report
/var/www/nextcloud# sudo -u www-data php occ config:list system
{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": {
            "0": "localhost",
            "11": "***REMOVED SENSITIVE VALUE***",
            "1": "10.0.3.10",
            "5": "nextcloudpi.local",
            "7": "nextcloudpi",
            "8": "nextcloudpi.lan",
            "3": "***REMOVED SENSITIVE VALUE***",
            "14": "nextcloudpi"
        },
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "33.0.10.1",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "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***",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "tempdirectory": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "overwriteprotocol": "https",
        "maintenance": false,
        "logfile": "\/var\/log\/nextcloud\/nextcloud.log",
        "mail_sendmailmode": "smtp",
        "loglevel": "2",
        "log_type": "file",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "data-fingerprint": "***REMOVED SENSITIVE VALUE***",
        "remember_login_cookie_lifetime": 60,
        "session_lifetime": 600,
        "session_keepalive": true,
        "auto_logout": true,
        "mail_smtpsecure": "tls",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "serverid": 246,
        "config_preset": 2,
        "allowed_admin_ranges": [
            "192.168.8.0\/24"
        ]
    }
}
List of activated Apps

Nextcloud Signing status

Nextcloud Logs

Additional info

No response

Langage dominant
PHP
Étoiles
37.5k
Forks
5.4k
Merge moyen
1 j 13 h
PR mergées (30 j)
639

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de nextcloud/server

Toutes les issues de nextcloud/server

Issues similaires

Plus d'issues PHP

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.