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

Offen
#66,475 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
mariadb, php
Bereich
backend, databases

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
PHP
Sterne
37.5k
Forks
5.4k
Ø Merge
1 T. 13 Std.
Gemergte PRs (30 T.)
639

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus nextcloud/server

Alle Issues in nextcloud/server

Ähnliche Issues

Weitere Issues zu PHP

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.