nextcloud / nextcloud/collectives

[encryption] pages became inaccessible with Collectives 4.0.0 when `user_folder` setting was changed for existing users

Open
#2,326 15 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug feature: server encryption regression
Dominant language
JavaScript
Stars
195
Forks
51
Avg merge
1d 2h
Merged PRs (30d)
48

Description

Describe the bug
Some pages and the related .md-files cannot be opened with the collectives app or via the markdown editor in the files app, as long as they reside somewhere inside the directory that is designated to be the directory for the collectives app.

The problematic files/pages are shown empty in the collectives app and trigger the following error when opening it with collectives or from the file app...

DecryptionFailedException Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.
Uncaught exception 

...even if server-side encryption is disabled and while I am the owner and sole user of the collective.

However, viewing the files offline, they are absolutely fine.

Interestingly, the problematic behavior disappears (meaning md-files can be opened via the files app) as soon as they do not reside in the collectives-folder (e.g. by copying/renaming the collectives-folder or changing the collectives-folder in the settings of the collectives app).

To Reproduce
Sorry, I have not yet figured out, why some files (in the same collective) are affected and others are not.

Expected behavior
All files in the collectives-folder can be opened via the collectives app and the markdown editor from the files app.

Screenshots
Exact copy of collectives folder:

Image

Files do have content:

Image

Files behave differently when opened via files app:

Image

Page displays nothing when opened in collectives app and seems to trigger error:

Image

Server details:

  • Collectives app version: 4.0.0
  • Nextcloud version: 32.0.6 (Docker)
  • PHP Version: [e.g. 8.3]
  • Database: [e.g. MariaDB 10.6]

Client details:

  • OS: Debian 13
  • Browser: Firefox
  • Browser version: 140.8.0esr
  • Device: Notebook
Logs
Nextcloud log (data/nextcloud.log)
{"reqId":"udZA7JyUJcU126rUNyGC","level":3,"time":"2026-03-10T10:43:41+00:00","remoteAddr":"REDACTED_CLIENT_IP","user":"REDACTED_USERNAME","app":"encryption","method":"GET","url":"/remote.php/dav/files/REDACTED_USERNAME/.Collectives/Finanzen%2C%20Versicherungen%20etc/Ethikbanken.md?timestamp=1773139421","scriptName":"/remote.php","message":"Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0","version":"32.0.6.1","data":{"app":"encryption"}}
{"reqId":"udZA7JyUJcU126rUNyGC","level":3,"time":"2026-03-10T10:43:41+00:00","remoteAddr":"REDACTED_CLIENT_IP","user":"REDACTED_USERNAME","app":"webdav","method":"GET","url":"/remote.php/dav/files/REDACTED_USERNAME/.Collectives/Finanzen%2C%20Versicherungen%20etc/Ethikbanken.md?timestamp=1773139421","scriptName":"/remote.php","message":"Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0","version":"32.0.6.1","exception":{"Exception":"OC\\Encryption\\Exceptions\\DecryptionFailedException","Message":"Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/Stream/Encryption.php","line":461,"function":"decrypt","class":"OCA\\Encryption\\Crypto\\Encryption","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/Files/Stream/Encryption.php","line":260,"function":"readCache","class":"OC\\Files\\Stream\\Encryption","type":"->","args":[]},{"function":"stream_read","class":"OC\\Files\\Stream\\Encryption","type":"->","args":[3614]},{"file":"/var/www/html/3rdparty/icewind/streams/src/Wrapper.php","line":54,"function":"fread","args":[null,8192]},{"file":"/var/www/html/3rdparty/icewind/streams/src/CallbackWrapper.php","line":94,"function":"stream_read","class":"Icewind\\Streams\\Wrapper","type":"->","args":[8192]},{"function":"stream_read","class":"Icewind\\Streams\\CallbackWrapper","type":"->","args":[8192]},{"file":"/var/www/html/3rdparty/sabre/http/lib/Sapi.php","line":108,"function":"stream_copy_to_stream","args":[null,null,3614]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":490,"function":"sendResponse","class":"Sabre\\HTTP\\Sapi","type":"::","args":[{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Server.php","line":212,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":426,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":22,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":151,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/apps/encryption/lib/Crypto/Encryption.php","Line":315,"Hint":"Diese Datei kann nicht entschl\u00fcsselt werden, es handelt sich wahrscheinlich um eine geteilte Datei. Bitte den Eigent\u00fcmer der Datei kontaktieren und ihn darum bitten, die Datei noch einmal zu teilen.","message":"Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.","exception":{},"CustomMessage":"Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you."}}
{"reqId":"udZA7JyUJcU126rUNyGC","level":3,"time":"2026-03-10T10:43:41+00:00","remoteAddr":"REDACTED_CLIENT_IP","user":"REDACTED_USERNAME","app":"no app in context","method":"GET","url":"/remote.php/dav/files/REDACTED_USERNAME/.Collectives/Finanzen%2C%20Versicherungen%20etc/Ethikbanken.md?timestamp=1773139421","scriptName":"/remote.php","message":"Uncaught exception","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0","version":"32.0.6.1","exception":{"Exception":"OC\\Encryption\\Exceptions\\DecryptionFailedException","Message":"Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/Stream/Encryption.php","line":461,"function":"decrypt","class":"OCA\\Encryption\\Crypto\\Encryption","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/Files/Stream/Encryption.php","line":260,"function":"readCache","class":"OC\\Files\\Stream\\Encryption","type":"->","args":[]},{"function":"stream_read","class":"OC\\Files\\Stream\\Encryption","type":"->","args":[3614]},{"file":"/var/www/html/3rdparty/icewind/streams/src/Wrapper.php","line":54,"function":"fread","args":[null,8192]},{"file":"/var/www/html/3rdparty/icewind/streams/src/CallbackWrapper.php","line":94,"function":"stream_read","class":"Icewind\\Streams\\Wrapper","type":"->","args":[8192]},{"function":"stream_read","class":"Icewind\\Streams\\CallbackWrapper","type":"->","args":[8192]},{"file":"/var/www/html/3rdparty/sabre/http/lib/Sapi.php","line":108,"function":"stream_copy_to_stream","args":[null,null,3614]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":490,"function":"sendResponse","class":"Sabre\\HTTP\\Sapi","type":"::","args":[{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Server.php","line":212,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":426,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":22,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":151,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/apps/encryption/lib/Crypto/Encryption.php","Line":315,"Hint":"Diese Datei kann nicht entschl\u00fcsselt werden, es handelt sich wahrscheinlich um eine geteilte Datei. Bitte den Eigent\u00fcmer der Datei kontaktieren und ihn darum bitten, die Datei noch einmal zu teilen.","message":"Uncaught exception","exception":{},"CustomMessage":"Uncaught exception"}}
{"reqId":"GkV1n2Oba0MtHhfhSeJL","level":3,"time":"2026-03-10T10:43:42+00:00","remoteAddr":"REDACTED_CLIENT_IP","user":"REDACTED_USERNAME","app":"encryption","method":"PUT","url":"/apps/text/session/672278/create","scriptName":"/index.php","message":"Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0","version":"32.0.6.1","data":{"app":"encryption"}}

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 reproducing the failure through the WebDAV path for files inside the Collectives folder, then inspect apps/encryption/lib/Crypto/Encryption.php and lib/private/Files/Stream/Encryption.php from the logged trace. Compare affected and unaffected files and the user_folder change, using the reported Collectives and markdown-editor entry points. Done means files in the Collectives folder open through both Collectives and the Files markdown editor without DecryptionFailedException.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.