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

未关闭
#66,475 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
mariadb, php
领域
backend, databases

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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

主要语言
PHP
星标
37.5k
派生
5.4k
平均合并
1 天 13 小时
30 天内合并 PR
639

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nextcloud/server 的其他 Issue

查看 nextcloud/server 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。