Please use the š reaction to show that you are affected by the same issue.
Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
Subscribe to receive notifications on status change and new comments.
Steps to reproduce
Share link of any kind of files like PDFs, zip files, text files and images etc.
Open or download the files
Opening files like PDF and text files returns an error on the web interface and when downloaded, it downloads an HTML file that is 4.5kb with an error.
Expected behaviour
Shows and downloads the files through the shared link without any problems
Actual behaviour
The owner of the shared link can access the files so it does not seem to be corrupted. It just gets corrupted when it is shared. Also re-shared the files many times and still same problem occurs.
Opening PDFs:
Opening text files (.md or .txt): does not show the content just white screen
Opening images: shows the image preview but download fails
Downloading all the files: downloads an 4.5 KB HTML file instead like the following:
$ file image.png
image.png: HTML document, UTF-8 Unicode text, with very long lines
Here is the content of the HTML document:
<div class="error">
<h2>Error</h2>
<ul>
<li>
<p>Can't read file</p>
<p class='hint'>Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.</p>
</li>
</ul>
Server configuration
Operating system: Debian 9.13 (stretch)
Web server: nginx 1.10.3
Database: MariaDB 10.1.48
PHP version: 7.2
Nextcloud version: 20.0.12
Updated from an older Nextcloud/ownCloud or fresh install: updated from an older version. The problem started since version 18.0.6 .
Where did you install Nextcloud from: Nextcloud website
Are you using encryption: yes - server side encryption with user keys
Client configuration
Browser: Chrome, Firefox
Operating system: Linux / Windows / Mac OS
Logs
Web server error log
Web server error log
```
no errors
```
Nextcloud log (data/nextcloud.log)
Nextcloud log
```
[error] 25168#25168: *43072837 FastCGI sent in stderr: "PHP message: [owncloud][no app in context][3] Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.
PHP message: [owncloud][no app in context][3] {"Exception":"OC\\Encryption\\Exceptions\\DecryptionFailedException","Message":"Can not 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/nextcloud/lib/private/Files/Stream/Encryption.php","line":501,"function":"decrypt","class":"OCA\\Encryption\\Crypto\\Encryption","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Stream/Encryption.php","line":299,"function":"readCache","class":"OC\\Files\\Stream\\Encryption","type":"->","args":[]},{"function":"stream_read","class":"OC\\Files\\Stream\\Encryption","type":"->","args":[8192]},{"file":"/var/www/nextcloud/3rdparty/icewind/streams/src/Wrapper.php","line":91,"function":"fread","args":[null,8192]},{"file":"/var/www/nextcloud/3rdparty/icewind/streams/src/CallbackWrapper.php","line":98,"function":"stream_read","class":"Icewind\\Streams\\Wrapper","type":"->","args":[8192" while reading response header from upstream, client: ***REMOVED SENSITIVE VALUE***, server: ***REMOVED SENSITIVE VALUE***, request: "GET /s/RSGxCLoYfeTQSBy/download?path=%2F&files=document.pdf HTTP/2.0", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "***REMOVED SENSITIVE VALUE***"
```
Browser log
Browser log for opening PDFs
```
Content Security Policy: The pageās settings blocked the loading of a resource at inline (āscript-srcā). 2 utils.js:35:9
Content Security Policy: The pageās settings blocked the loading of a resource at eval (āscript-srcā). global.js:10:10
Please do NOT wait for the DOMContentLoaded before registering your viewer handler Viewer.vue:217
[ERROR] Files_PDFViewer: But this does not appear to be a public page
Object { app: "Files_PDFViewer" }
ConsoleLogger.js:54:18
Content Security Policy: The pageās settings blocked the loading of a resource at inline (āscript-srcā). utils.js:35:9
Content Security Policy: The pageās settings blocked the loading of a resource at inline (āscript-srcā). utils.js:35:9
Uncaught (in promise) Error: Invalid or corrupted PDF file.
_callee7$/< app.js:817
app.js:817:16
```
This is definitely a bug somewhere, but not sure where. I thought I lost all of them. Fortunately, someone has written a script that'll let you decrypt them, though it took me a little time to figure out exactly how to set it up with my setup:
I was able to decrypt all of mine using this tool where Nextcloud would fail. I believe an update around version 20 broke it for me, but not sure since this appears to be an issue for a while.
Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!
My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!
How to use GitHub
Steps to reproduce
Expected behaviour
Shows and downloads the files through the shared link without any problems
Actual behaviour
The owner of the shared link can access the files so it does not seem to be corrupted. It just gets corrupted when it is shared. Also re-shared the files many times and still same problem occurs.
Opening PDFs:
Opening text files (.md or .txt): does not show the content just white screen
Opening images: shows the image preview but download fails
Downloading all the files: downloads an 4.5 KB HTML file instead like the following:
Here is the content of the HTML document: