nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.54k stars 4.08k forks source link

[Bug]: File corruption when moving files with encryption enabled #48174

Open elzody opened 2 months ago

elzody commented 2 months ago

⚠️ This issue respects the following points: ⚠️

Bug description

When encryption is enabled on the server, files become corrupted when moved via the "Move/copy" dialog. The structure of the folders and files I tested is as follows:

This issue does not occur with encryption disabled, and was tested on version 29 of NC Enterprise

Steps to reproduce

  1. Have folder A
  2. Folder A contains files
  3. Select the "Move/copy" action to bring up the dialog
  4. Move folder A somewhere else
  5. Access the files in folder A
  6. The files will be corrupted

Expected behavior

The expected behavior is that, even though encryption is enabled, the files are not corrupted when moved.

Nextcloud Server version

29

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

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?

Encryption is Enabled

What user-backends are you using?

Configuration report

{
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "localhost",
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "default_phone_region": "en",
    "default_language": "en",
    "defaultapp": "dashboard",
    "dbtype": "mysql",
    "version": "28.0.5.2",
    "overwrite.cli.url": "url removed",
    "htaccess.RewriteBase": "\/",
    "bulkupload.enabled": false,
    "forwarded_for_headers": [
        "HTTP_X_FORWARDED_FOR"
    ],
    "simpleSignUpLink.shown": false,
    "allow_user_to_change_display_name": false,
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "filelocking.enabled": true,
    "memcache.local": "\\OC\\Memcache\\APCu",
    "tempdirectory": "\/var\/www\/data\/tmp",
    "redis.cluster": {
        "seeds": "***REMOVED SENSITIVE VALUE***",
        "timeout": 0,
        "read_timeout": 0,
        "failover_mode": 1
    },
    "maintenance": false,
    "loglevel": 2,
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_sendmailmode": "smtp",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "25",
    "updater.server.url": "SENSITIVE DATA REMOVED",
    "updater.release.channel": "enterprise",
    "ldapIgnoreNamingRules": false,
    "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
    "allow_local_remote_servers": true,
    "onlyoffice": {
        "verify_peer_off": true
    },
    "twofactor_enforced": "true",
    "twofactor_enforced_groups": [],
    "twofactor_enforced_excluded_groups": [
        "admin",
        "test_admin"
    ],
    "maintenance_window_start": 100
}

List of activated Apps

Enabled:
 - activity: 2.20.0
 - admin_audit: 1.18.0
 - bruteforcesettings: 2.8.0
 - camerarawpreviews: 0.8.5
 - cloud_federation_api: 1.11.0
 - comments: 1.18.0
 - contacts: 5.5.3
 - contactsinteraction: 1.9.0
 - dashboard: 7.8.0
 - dav: 1.29.1
 - encryption: 2.16.0
 - federatedfilesharing: 1.18.0
 - federation: 1.18.0
 - files: 2.0.0
 - files_accesscontrol: 1.18.1
 - files_external: 1.20.0
 - files_lock: 28.0.6
 - files_pdfviewer: 2.9.0
 - files_reminders: 1.1.0
 - files_retention: 1.17.2
 - files_sharing: 1.20.0
 - files_trashbin: 1.18.0
 - files_versions: 1.21.0
 - logreader: 2.13.0
 - lookup_server_connector: 1.16.0
 - notifications: 2.16.0
 - oauth2: 1.16.3
 - password_policy: 1.18.0
 - provisioning_api: 1.18.0
 - quota_warning: 1.19.0
 - related_resources: 1.3.0
 - richdocuments: 8.3.9
 - security_guard: 1.2.1
 - sendent: 3.0.12
 - serverinfo: 1.18.0
 - settings: 1.10.1
 - sharebymail: 1.18.0
 - support: 1.11.1
 - systemtags: 1.18.0
 - text: 3.9.1
 - theming: 2.3.0
 - twofactor_backupcodes: 1.17.0
 - updatenotification: 1.18.0
 - user_ldap: 1.19.0
 - user_saml: 6.2.0
 - viewer: 2.2.0
 - workflowengine: 2.10.0
Disabled:
 - circles: 26.0.0
 - drawio: 3.0.2
 - files_antivirus: 5.5.7
 - files_automatedtagging: 1.18.0
 - files_confidential: 3.0.3
 - files_rightclick: 1.6.0
 - firstrunwizard: 2.14.0
 - globalsiteselector
 - nextcloud_announcements: 1.14.0
 - photos: 2.0.0
 - privacy: 1.9.0
 - recommendations: 1.4.0
 - spreed: 18.0.10
 - survey_client: 1.14.0
 - suspicious_login
 - twofactor_totp: 7.0.0
 - user_status: 1.5.0
 - weather_status: 1.5.0

Nextcloud Signing status

{
  "core": {
    "FILE_MISSING": {
      "core/skeleton/Documents/Example.md": {
        "expected": "2926fb057563b3a001f0098f6b1e344cda00a53fd9b31313d3efb31d89214e5bfe29db45eac5d795afee02688d8ee7077a4db416dfcb43a0da2af61aec3dcdd9",
        "current": ""
      },
      "core/skeleton/Documents/Nextcloud flyer.pdf": {
        "expected": "6d01367d9bbb16d93a23dd5d3fafb63c11bcbfd7d06bf34c0817a6e34ebcbb14aaf38ec8967513f3e4d001e81052fcb59963d4129aaff411b54a093d1ab88308",
        "current": ""
      },
      "core/skeleton/Documents/Readme.md": {
        "expected": "33525344e2114ee00037e4088a65b2b798b9245d977b4acc904365ce8f3208920085b1d064a085661e9b9c6a01826dfbbbb6cd6c7566e7ebd6bffc2a2f74104f",
        "current": ""
      },
      "core/skeleton/Documents/Welcome to Nextcloud Hub.docx": {
        "expected": "b73469513ca130e6465c65720949c5ac702888e8a3e93d9f4320e50892660986f91ef228f498558a8e522775fa3e5e9700fb11f03885780bc2ea5f90b3275d8f",
        "current": ""
      },
      "core/skeleton/Nextcloud Manual.pdf": {
        "expected": "e64b609ba8d18fc174142b54adfc38a52343732a220c5c0ebc88fa3e65329e0279fa09c5297e839bcad164337c000a4ec5619b756a604eb561a51830782a70a1",
        "current": ""
      },
      "core/skeleton/Nextcloud intro.mp4": {
        "expected": "60c43bedd8fbe2a42be4ecd8ea045409c243cf58b31458cd8bc964a81c27a4b19868b6e6e3e6910447243fbb0adef564e3784a3fc03c6e2bc7fed0df8e5035e0",
        "current": ""
      },
      "core/skeleton/Nextcloud.png": {
        "expected": "ca7ac2ee87d0863132ad50c5a9cb406e0e440322adc25fdcb2d97054785da1ff6711e1a878a83cd8eb0f409c9f5b17f460dab4260771419bae47d4caa9c953f7",
        "current": ""
      },
      "core/skeleton/Photos/Birdie.jpg": {
        "expected": "ac86050cee06918b5f03fdb7bfeef49e683d2d6268f2a560df0186aa42e870775cbc02143c4225cf16a1fea5f21090db5cdbffde26b35a8fb2833a2ae3440538",
        "current": ""
      },
      "core/skeleton/Photos/Frog.jpg": {
        "expected": "31d78ba24166b31e441546188cf3aa0f73a2e993d13870cc7adb0b47aface753c05866c981512a5ca7e95fb1191e5b1b8cd1e71bed2c777f4d8230e358522243",
        "current": ""
      },
      "core/skeleton/Photos/Gorilla.jpg": {
        "expected": "6b18ba8a5eeaff2d52f6e7a2ff3376f6e7797165fa3b9dc7a62bdb291f8984f5782697df44653699e6bc5a4ae4a27db262fad297f0330b8336762bcd6c4a9b7a",
        "current": ""
      },
      "core/skeleton/Photos/Library.jpg": {
        "expected": "8cd773dd47952b6eaeaccd2ad84be73d7a2c146abdeefa4c8feaed80f079d636074712195e9d717fd3cd22fb282fa9909eb69c2742de16a6cb07920afd6fd2dd",
        "current": ""
      },
      "core/skeleton/Photos/Nextcloud community.jpg": {
        "expected": "6ce4c89f1798c4c0233aa0701e7fbbaea5606c81e6060076dca3987c025552102a2381802e66a572ab98874dd876ee67758d8c7d5d53c496948ccaec9811031d",
        "current": ""
      },
      "core/skeleton/Photos/Readme.md": {
        "expected": "6d372b06deb3cb73f17084d812ebd56160c9e795aac3acfe8585c0365eabc42579c71c09d6c7f70c6c50444f93cdf274f4f10c7d0bcfc46f5ae4ff20846ec87f",
        "current": ""
      },
      "core/skeleton/Photos/Steps.jpg": {
        "expected": "0dfd749cfdb6287da5f0cde149ad340cc5885bd2a1d144343ca2c3db9db861dd6735c8b3d9626853fede7a6d2a54ec64a6ca9be43930b0a8253b5cc990298423",
        "current": ""
      },
      "core/skeleton/Photos/Toucan.jpg": {
        "expected": "d40d9c5c11839296697ddf61b921d7cd13c135675c47e722bb811016af97ff9d9371cec0f3fc0903d88cd3299827ecb520b77e94a6203e831bf33a18c88cef81",
        "current": ""
      },
      "core/skeleton/Photos/Vineyard.jpg": {
        "expected": "689e351a2740e503bfbb0d91e2859951b9d79c2ec21d59f6a70dbf41c16a9cebb7de38b9ce24eb7f1141857e5e4718572d7c5748171b4517419131e2cc94b2b3",
        "current": ""
      },
      "core/skeleton/Readme.md": {
        "expected": "5e8dbae4587a00deb1c63d69c9c7a4c45da0d5ddbc55c14f84a4f61f4c9a40c62aaa24e060ddb1fbdaff7a0f92f90a13695d4b8453a757a0f21cdcaaece0a5f8",
        "current": ""
      },
      "core/skeleton/Reasons to use Nextcloud.pdf": {
        "expected": "2aa0772faef9410115a30de793972dc2cccfe188f19149e29c47871aae6c07c9616f8aa8dd6472362463ca647c7d5b4171d18a09645a99e4feb556c90807ded4",
        "current": ""
      },
      "core/skeleton/Templates credits.md": {
        "expected": "eb4ae61204e05a839b0181a8b95cf64ae16ede7986be8c9e30ac03e4c2225b8c97cb6ec233b3f136802448c3b6c4ec779440b8169e1b5ac5a54aa6a45e38a46e",
        "current": ""
      },
      "core/skeleton/Templates/Business model canvas.odg": {
        "expected": "4eb9e0f653faaad041849e18a287de6013e3ceefcf4df32efcc3a901329a286f15788138625f4e5bf95a7226c6e922ff574e94366b24abbf8fb86922dfbedc83",
        "current": ""
      },
      "core/skeleton/Templates/Business model canvas.ods": {
        "expected": "179384a7c03dd4ea3dadb2ba8ad91b45a5cb781f8b9fa29f5c04ec64ea4e02dfec63b6e3d6d11dfd4b8a64232fd08e9a4c2bef64f49d2223399414ee7ebf3ef2",
        "current": ""
      },
      "core/skeleton/Templates/Diagram & table.ods": {
        "expected": "16ecc6b7088236e12b800b01bc7fdc985e74ca4f411e4620f23a06e639ee5dd0710fdaefff308e2cfe43aa00efd443152429efd0a880cbcd92d3dfcc3a9cf27a",
        "current": ""
      },
      "core/skeleton/Templates/Elegant.odp": {
        "expected": "7f2799e339e609631704a1eed5f18fee5924cecddc16bc56ebc37cc54686044b805a68df7b5bef3ee19097b28099aa33243ff75d3411ce08ede078c9a03ed585",
        "current": ""
      },
      "core/skeleton/Templates/Expense report.ods": {
        "expected": "a71df1eb87af2e8415c7ec0c8bf532ea0744a23e73891d513e152e8b42cf13c70a1cb83022c85f324535bfd4c2ebef4634365ae9b432e54e9a4cc9cd60e7a96f",
        "current": ""
      },
      "core/skeleton/Templates/Flowchart.odg": {
        "expected": "77967a1eef9f865cb98dab71f119c091f078bd5ab8eba086efcbce94cebe93221e7a35763e001bd20120b62175476c4d052358833cda0558e04547ce29699636",
        "current": ""
      },
      "core/skeleton/Templates/Gotong royong.odp": {
        "expected": "77b94c3f6f53806791497540ebac0076d8b5943ff9156eab41e40da5f4634db03b9dbf757d491b48838b27b2a09bf2ce102c38f536b9ccc63cb78bed65ab20d4",
        "current": ""
      },
      "core/skeleton/Templates/Impact effort matrix.whiteboard": {
        "expected": "7993c14bdfb0746ef14b92a1e2ced228b059b24f038d1d9813e02af130b12b778a59deeb71b1c391eb5762c30e775f504bacf284001fbb03cc3208c6e716d504",
        "current": ""
      },
      "core/skeleton/Templates/Invoice.odt": {
        "expected": "91c002064fda834cfe561ce7d91809baaec17b301a38dc7ab01709bf6086d43c691cc75b5eec7649325b1322493749c6b2f0182bafe739cfc3ee0c35a7c6b232",
        "current": ""
      },
      "core/skeleton/Templates/Letter.odt": {
        "expected": "e0a3ff93c54d184cc796777139cd7ba0bd3ef25fa3616aabd85a7a79865f7cdfb1f7663bf1ac1f6d1ea48490c6ba856e2d776a2cc33e0c1cd2999ee80fd1b410",
        "current": ""
      },
      "core/skeleton/Templates/Meeting notes.md": {
        "expected": "60a902c73909bee3c8ff4c26d2378cb24a3a7cb6fcf531eaea294fd2a57f1ed5b27c611644cf41a702f22017d9ae02b0fb5cee0149dcf6d85ab59c58018ad6b0",
        "current": ""
      },
      "core/skeleton/Templates/Mindmap.odg": {
        "expected": "99664b09d36b6caf782a3dfc2920bfc7faf133e9b129f4a6b6e01b504b852d484666d3a22781038dcbd3fa0613deda676ea6db2c37a7587a6658a49eb93e0de7",
        "current": ""
      },
      "core/skeleton/Templates/Modern company.odp": {
        "expected": "8f414b1cf04eeb20c665dd4e8d022ddebedd65cacf1bfa6315a7ade215fcaa01c815dcbbcbd844d90a3e301ef93dd736aaf2df15b23b6cf1d2abae6eaf643c96",
        "current": ""
      },
      "core/skeleton/Templates/Mother's day.odt": {
        "expected": "43a7b8a0866c7b8ab72676c9f7c2f86a23b36719f8ce093889cbc5243c01c8cbe9c1cc7ce1857df42b8e369bf7ba631eab78ed2614447de41d717d90841425fb",
        "current": ""
      },
      "core/skeleton/Templates/Org chart.odg": {
        "expected": "dbcda0a787dc44889b7c246d6f594263bb543f53f46e480c3d4595545998fe0efc75306f7059c5cd7aa710f070f4f3a0f39857c7656828469d55d55497088b5f",
        "current": ""
      },
      "core/skeleton/Templates/Party invitation.odt": {
        "expected": "b1da3724d6dc00a477bf52fc96e587612c3f60dd20e99424b8987ec59e14fe5616208ba3d1df1014160b81da40b94884762025cf7135ecbeeaaf98f944e9d510",
        "current": ""
      },
      "core/skeleton/Templates/Photo book.odt": {
        "expected": "16022bb77a4af06c2f94cbaa45a0afd212be9bdc70a245bdf4251cd5bbbd4932cb4a27c981f11735e6dc42ef3aec500aa806879c8f88f778ee80f7875ba9499d",
        "current": ""
      },
      "core/skeleton/Templates/Product plan.md": {
        "expected": "2e55c6e9f477a6d861b20fe0e0e9a27d5aa4bbb585cc751cb20b44d1247155004b9885b6544c6568fe7e044d0ba4d1ccd9dc62a7d8c6c8034739ede607f5ab1d",
        "current": ""
      },
      "core/skeleton/Templates/Readme.md": {
        "expected": "d06d7bb96c0ed38f1b6fd10cb065f915c8f5522cd85f9a0ca3a5a4a29ca81bc8a7c11917cffe964a68f7d6481283bb100910343c844159d348eb1201b460db1c",
        "current": ""
      },
      "core/skeleton/Templates/Resume.odt": {
        "expected": "754975cee51edf149c2d80817c62a85e3a7a5db1a8441f616465a66829af394888646d6fedb0b76042b5e1f6a0673c99c76adfd7e7c8b0be29543dc17e831bd9",
        "current": ""
      },
      "core/skeleton/Templates/SWOT analysis.whiteboard": {
        "expected": "67529d68ae3c2b59123fb178f26e871b61fa8b4d05c0dc85f3114577a1076d3c2fa77de43beb2f6b9524ea4e9a546bff516c377d64e40868100a54193ef1933f",
        "current": ""
      },
      "core/skeleton/Templates/Simple.odp": {
        "expected": "0695dc9d1c4cee0a424b8a2030e19756b9265d111f74e7a05df4a2b99b92dfb42fb3bb0d82da75cbd29aea349b2b61e733f755d729dd521bca16de1df32b1dc9",
        "current": ""
      },
      "core/skeleton/Templates/Syllabus.odt": {
        "expected": "18a3accd35fb9a68f98e4bce4f97b102c6cadce7b4e08252f84b9412a12f712cc6cc0786109679c04354a9896f14c4177bbc1581f500a59535737a5b931d0f47",
        "current": ""
      },
      "core/skeleton/Templates/Timesheet.ods": {
        "expected": "e70d255685f68f3f231b0c3c54a3cda33450ae4817d6091a90c7cbb3187c637fa8e6d59c5a39c7c2d51b48ea276d4331b1c4a149ff2e3eed23f7d5387c25aa8b",
        "current": ""
      },
      "core/skeleton/Templates/Yellow idea.odp": {
        "expected": "b576d7f46d8a61688606042f54b0195b11acba879393f6419267a88f347dfb13d3c4fee8d362ae06f502f8949591366cc6c660b05d64e7cf233e38fbdf6f4d6c",
        "current": ""
      }
    }
  }
}

Nextcloud Logs

{
  "reqId": "kBO819YxhFiZCzIe0rE1",
  "level": 0,
  "time": "2024-09-11T17:21:28+00:00",
  "remoteAddr": "172.19.0.1",
  "user": "admin",
  "app": "no app in context",
  "method": "COPY",
  "url": "/remote.php/dav/files/admin/moved/root",
  "message": "dirty table reads: SELECT `filecache`.`fileid`, `storage`, `path`, `path_hash`, `filecache`.`parent`, `filecache`.`name`, `mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, `encrypted`, `etag`, `filecache`.`permissions`, `checksum`, `unencrypted_size`, `metadata_etag`, `creation_time`, `upload_time`, `meta`.`json` AS `meta_json`, `meta`.`sync_token` AS `meta_sync_token` FROM `*PREFIX*filecache` `filecache` LEFT JOIN `*PREFIX*filecache_extended` `fe` ON `filecache`.`fileid` = `fe`.`fileid` LEFT JOIN `*PREFIX*files_metadata` `meta` ON `filecache`.`fileid` = `meta`.`file_id` WHERE (`storage` = :dcValue1) AND (`path_hash` = :dcValue2)",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0",
  "version": "29.0.6.2",
  "exception": {
    "Exception": "Exception",
    "Message": "dirty table reads: SELECT `filecache`.`fileid`, `storage`, `path`, `path_hash`, `filecache`.`parent`, `filecache`.`name`, `mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, `encrypted`, `etag`, `filecache`.`permissions`, `checksum`, `unencrypted_size`, `metadata_etag`, `creation_time`, `upload_time`, `meta`.`json` AS `meta_json`, `meta`.`sync_token` AS `meta_sync_token` FROM `*PREFIX*filecache` `filecache` LEFT JOIN `*PREFIX*filecache_extended` `fe` ON `filecache`.`fileid` = `fe`.`fileid` LEFT JOIN `*PREFIX*files_metadata` `meta` ON `filecache`.`fileid` = `meta`.`file_id` WHERE (`storage` = :dcValue1) AND (`path_hash` = :dcValue2)",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
        "line": 344,
        "function": "executeQuery",
        "class": "OC\\DB\\Connection",
        "type": "->",
        "args": [
          "SELECT `filecache`.`fileid`, `storage`, `path`, `path_hash`, `filecache`.`parent`, `filecache`.`name`, `mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, `encrypted`, `etag`, `filecache`.`permissions`, `checksum`, `unencrypted_size`, `metadata_etag`, `creation_time`, `upload_time`, `meta`.`json` AS `meta_json`, `meta`.`sync_token` AS `meta_sync_token` FROM `*PREFIX*filecache` `filecache` LEFT JOIN `*PREFIX*filecache_extended` `fe` ON `filecache`.`fileid` = `fe`.`fileid` LEFT JOIN `*PREFIX*files_metadata` `meta` ON `filecache`.`fileid` = `meta`.`file_id` WHERE (`storage` = :dcValue1) AND (`path_hash` = :dcValue2)",
          [
            1,
            "a801fcf292d963da1bd0217eeb950420"
          ],
          [
            1,
            2
          ],
          null
        ]
      },
      {
        "file": "/var/www/html/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php",
        "line": 384,
        "function": "executeQuery",
        "class": "Doctrine\\DBAL\\Query\\QueryBuilder",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/lib/private/DB/QueryBuilder/QueryBuilder.php",
        "line": 280,
        "function": "execute",
        "class": "Doctrine\\DBAL\\Query\\QueryBuilder",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/lib/private/Files/Cache/Cache.php",
        "line": 164,
        "function": "execute",
        "class": "OC\\DB\\QueryBuilder\\QueryBuilder",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/lib/private/Files/Cache/HomeCache.php",
        "line": 57,
        "function": "get",
        "class": "OC\\Files\\Cache\\Cache",
        "type": "->",
        "args": [
          "files/copied3/root/subfolder_one/de-article-1.jpeg"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",
        "line": 191,
        "function": "get",
        "class": "OC\\Files\\Cache\\HomeCache",
        "type": "->",
        "args": [
          "files/copied3/root/subfolder_one/de-article-1.jpeg"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",
        "line": 217,
        "function": "modifyMetaData",
        "class": "OC\\Files\\Storage\\Wrapper\\Encryption",
        "type": "->",
        "args": [
          "files/copied3/root/subfolder_one/de-article-1.jpeg",
          [
            "image/jpeg",
            1726075288,
            0,
            "6baa385b8e6c54f83df9570c8b4cdae0",
            1726075288,
            27,
            "de-article-1.jpeg"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php",
        "line": 605,
        "function": "getMetaData",
        "class": "OC\\Files\\Storage\\Wrapper\\Encryption",
        "type": "->",
        "args": [
          "files/copied3/root/subfolder_one/de-article-1.jpeg"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Cache/Scanner.php",
        "line": 125,
        "function": "getMetaData",
        "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
        "type": "->",
        "args": [
          "files/copied3/root/subfolder_one/de-article-1.jpeg"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Cache/Scanner.php",
        "line": 162,
        "function": "getData",
        "class": "OC\\Files\\Cache\\Scanner",
        "type": "->",
        "args": [
          "files/copied3/root/subfolder_one/de-article-1.jpeg"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Cache/Scanner.php",
        "line": 357,
        "function": "scanFile",
        "class": "OC\\Files\\Cache\\Scanner",
        "type": "->",
        "args": [
          "files/copied3/root/subfolder_one/de-article-1.jpeg",
          3,
          -1,
          null,
          true
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/View.php",
        "line": 1347,
        "function": "scan",
        "class": "OC\\Files\\Cache\\Scanner",
        "type": "->",
        "args": [
          "files/copied3/root/subfolder_one/de-article-1.jpeg",
          false
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/View.php",
        "line": 1383,
        "function": "getCacheEntry",
        "class": "OC\\Files\\View",
        "type": "->",
        "args": [
          [
            "OCA\\Files_Trashbin\\Storage",
            null,
            [
              "OC\\Files\\Cache\\Scanner"
            ],
            null,
            null,
            [
              "OC\\Files\\Cache\\Updater"
            ]
          ],
          "files/copied3/root/subfolder_one/de-article-1.jpeg",
          "/admin/files/copied3/root/subfolder_one/de-article-1.jpeg"
        ]
      },
      {
        "file": "/var/www/html/apps/encryption/lib/KeyManager.php",
        "line": 433,
        "function": "getFileInfo",
        "class": "OC\\Files\\View",
        "type": "->",
        "args": [
          "/admin/files/copied3/root/subfolder_one/de-article-1.jpeg"
        ]
      },
      {
        "file": "/var/www/html/apps/encryption/lib/Crypto/Encryption.php",
        "line": 160,
        "function": "getVersion",
        "class": "OCA\\Encryption\\KeyManager",
        "type": "->",
        "args": [
          "/admin/files/copied3/root/subfolder_one/de-article-1.jpeg",
          [
            "OC\\Files\\View"
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Stream/Encryption.php",
        "line": 284,
        "function": "begin",
        "class": "OCA\\Encryption\\Crypto\\Encryption",
        "type": "->",
        "args": [
          "/admin/files/copied3/root/subfolder_one/de-article-1.jpeg",
          "admin",
          "w",
          [],
          []
        ]
      },
      {
        "function": "stream_open",
        "class": "OC\\Files\\Stream\\Encryption",
        "type": "->",
        "args": [
          "ocencryption://",
          "w",
          0,
          null
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Stream/Encryption.php",
        "line": 212,
        "function": "fopen",
        "args": [
          "ocencryption://",
          "w",
          false,
          null
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Stream/Encryption.php",
        "line": 187,
        "function": "wrapSource",
        "class": "OC\\Files\\Stream\\Encryption",
        "type": "::",
        "args": [
          null,
          null,
          "ocencryption",
          "OC\\Files\\Stream\\Encryption",
          "w"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",
        "line": 490,
        "function": "wrap",
        "class": "OC\\Files\\Stream\\Encryption",
        "type": "::",
        "args": [
          null,
          "files/copied3/root/subfolder_one/de-article-1.jpeg",
          "/admin/files/copied3/root/subfolder_one/de-article-1.jpeg",
          [],
          "admin",
          [
            "OCA\\Encryption\\Crypto\\Encryption"
          ],
          [
            "OC\\Files\\Storage\\Wrapper\\Quota",
            null,
            null,
            null,
            null,
            null
          ],
          [
            "OC\\Files\\Storage\\Wrapper\\Encryption",
            null,
            null,
            null,
            null,
            null
          ],
          [
            "OC\\Encryption\\Util"
          ],
          [
            "OC\\Encryption\\File"
          ],
          "w",
          0,
          0,
          0,
          true
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",
        "line": 836,
        "function": "fopen",
        "class": "OC\\Files\\Storage\\Wrapper\\Encryption",
        "type": "->",
        "args": [
          "files/copied3/root/subfolder_one/de-article-1.jpeg",
          "w"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",
        "line": 710,
        "function": "copyBetweenStorage",
        "class": "OC\\Files\\Storage\\Wrapper\\Encryption",
        "type": "->",
        "args": [
          [
            "OC\\Files\\Storage\\Wrapper\\Encryption",
            null,
            null,
            null,
            null,
            null
          ],
          "files/moved/root/subfolder_one/de-article-1.jpeg",
          "files/copied3/root/subfolder_one/de-article-1.jpeg",
          false,
          false
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",
        "line": 829,
        "function": "copyFromStorage",
        "class": "OC\\Files\\Storage\\Wrapper\\Encryption",
        "type": "->",
        "args": [
          [
            "OC\\Files\\Storage\\Wrapper\\Encryption",
            null,
            null,
            null,
            null,
            null
          ],
          "files/moved/root/subfolder_one/de-article-1.jpeg",
          "files/copied3/root/subfolder_one/de-article-1.jpeg",
          false,
          false
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",
        "line": 710,
        "function": "copyBetweenStorage",
        "class": "OC\\Files\\Storage\\Wrapper\\Encryption",
        "type": "->",
        "args": [
          [
            "OC\\Files\\Storage\\Wrapper\\Encryption",
            null,
            null,
            null,
            null,
            null
          ],
          "files/moved/root/subfolder_one",
          "files/copied3/root/subfolder_one",
          false,
          false
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",
        "line": 829,
        "function": "copyFromStorage",
        "class": "OC\\Files\\Storage\\Wrapper\\Encryption",
        "type": "->",
        "args": [
          [
            "OC\\Files\\Storage\\Wrapper\\Encryption",
            null,
            null,
            null,
            null,
            null
          ],
          "files/moved/root/subfolder_one",
          "files/copied3/root/subfolder_one",
          false,
          false
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",
        "line": 710,
        "function": "copyBetweenStorage",
        "class": "OC\\Files\\Storage\\Wrapper\\Encryption",
        "type": "->",
        "args": [
          [
            "OC\\Files\\Storage\\Wrapper\\Encryption",
            null,
            null,
            null,
            null,
            null
          ],
          "files/moved/root",
          "files/copied3/root",
          false,
          false
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",
        "line": 377,
        "function": "copyFromStorage",
        "class": "OC\\Files\\Storage\\Wrapper\\Encryption",
        "type": "->",
        "args": [
          [
            "OC\\Files\\Storage\\Wrapper\\Encryption",
            null,
            null,
            null,
            null,
            null
          ],
          "files/moved/root",
          "files/copied3/root"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php",
        "line": 296,
        "function": "copy",
        "class": "OC\\Files\\Storage\\Wrapper\\Encryption",
        "type": "->",
        "args": [
          "files/moved/root",
          "files/copied3/root"
        ]
      },
      {
        "file": "/var/www/html/lib/private/Files/View.php",
        "line": 927,
        "function": "copy",
        "class": "OC\\Files\\Storage\\Wrapper\\Wrapper",
        "type": "->",
        "args": [
          "files/moved/root",
          "files/copied3/root"
        ]
      },
      {
        "file": "/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php",
        "line": 486,
        "function": "copy",
        "class": "OC\\Files\\View",
        "type": "->",
        "args": [
          "/moved/root",
          "/copied3/root"
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line": 150,
        "function": "copyInto",
        "class": "OCA\\DAV\\Connector\\Sabre\\Directory",
        "type": "->",
        "args": [
          "root",
          "/moved/root",
          [
            "OCA\\DAV\\Connector\\Sabre\\Directory"
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
        "line": 659,
        "function": "copy",
        "class": "Sabre\\DAV\\Tree",
        "type": "->",
        "args": [
          "files/admin/moved/root",
          "files/admin/copied3/root"
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
        "line": 89,
        "function": "httpCopy",
        "class": "Sabre\\DAV\\CorePlugin",
        "type": "->",
        "args": [
          [
            "Sabre\\HTTP\\Request"
          ],
          [
            "Sabre\\HTTP\\Response"
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 472,
        "function": "emit",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          "method:COPY",
          [
            [
              "Sabre\\HTTP\\Request"
            ],
            [
              "Sabre\\HTTP\\Response"
            ]
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 253,
        "function": "invokeMethod",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": [
          [
            "Sabre\\HTTP\\Request"
          ],
          [
            "Sabre\\HTTP\\Response"
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php",
        "line": 321,
        "function": "start",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/apps/dav/lib/Server.php",
        "line": 385,
        "function": "exec",
        "class": "Sabre\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/apps/dav/appinfo/v2/remote.php",
        "line": 35,
        "function": "exec",
        "class": "OCA\\DAV\\Server",
        "type": "->",
        "args": []
      },
      {
        "file": "/var/www/html/remote.php",
        "line": 172,
        "args": [
          "/var/www/html/apps/dav/appinfo/v2/remote.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/html/lib/private/DB/Connection.php",
    "Line": 320,
    "message": "dirty table reads: SELECT `filecache`.`fileid`, `storage`, `path`, `path_hash`, `filecache`.`parent`, `filecache`.`name`, `mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, `encrypted`, `etag`, `filecache`.`permissions`, `checksum`, `unencrypted_size`, `metadata_etag`, `creation_time`, `upload_time`, `meta`.`json` AS `meta_json`, `meta`.`sync_token` AS `meta_sync_token` FROM `*PREFIX*filecache` `filecache` LEFT JOIN `*PREFIX*filecache_extended` `fe` ON `filecache`.`fileid` = `fe`.`fileid` LEFT JOIN `*PREFIX*files_metadata` `meta` ON `filecache`.`fileid` = `meta`.`file_id` WHERE (`storage` = :dcValue1) AND (`path_hash` = :dcValue2)",
    "tables": [
      "oc_file_locks",
      "oc_filecache"
    ],
    "reads": [
      "oc_filecache",
      "oc_filecache_extended",
      "oc_files_metadata"
    ],
    "exception": {},
    "CustomMessage": "dirty table reads: SELECT `filecache`.`fileid`, `storage`, `path`, `path_hash`, `filecache`.`parent`, `filecache`.`name`, `mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, `encrypted`, `etag`, `filecache`.`permissions`, `checksum`, `unencrypted_size`, `metadata_etag`, `creation_time`, `upload_time`, `meta`.`json` AS `meta_json`, `meta`.`sync_token` AS `meta_sync_token` FROM `*PREFIX*filecache` `filecache` LEFT JOIN `*PREFIX*filecache_extended` `fe` ON `filecache`.`fileid` = `fe`.`fileid` LEFT JOIN `*PREFIX*files_metadata` `meta` ON `filecache`.`fileid` = `meta`.`file_id` WHERE (`storage` = :dcValue1) AND (`path_hash` = :dcValue2)"
  }
}

Additional info

No response

elzody commented 2 months ago

Quick note: The config options, etc. are not mine but the customer's, with all sensitive data removed. The nextcloud.log is one that I recorded after reproducing. (Customer was using v28 but also reproducible on 29)

joshtrichards commented 2 months ago

What do you mean by "corrupted"? What's the actual user experience when this happens?

Also, master key (our default for new installs for awhile now) or per-user key?

artonge commented 2 months ago

I am not able to reproduce. With encryption enabled, I have a folder "A" with files in it, I move the folder "A" inside the folder "B", but the files are still accessible.