Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF viewer not working with shared links #1063

Closed
Winterkeks opened this issue Sep 30, 2024 · 8 comments
Closed

PDF viewer not working with shared links #1063

Winterkeks opened this issue Sep 30, 2024 · 8 comments

Comments

@Winterkeks
Copy link

Winterkeks commented Sep 30, 2024

How to use GitHub

  • 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

  1. Update on Nextcloud version 30
  2. Open a PDF with the Viewer

Expected behaviour

Tell us what should happen
Normaly it you should see the PDF

Actual behaviour

Tell us what happens instead, if possible also add a screenshot
When I open the PDF a black screen appears

Server configuration

Database: MySQL/Maria/SQLite/PostgreSQL
MariaDB

Nextcloud version: (see Nextcloud admin page)
30.0.0

List of activated apps Auditing / Logging Brute-force settings External storage support File sharing Files download limit Nextcloud webhook support Password policy Share by mail PDF Viewer 3.0.0
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder
Nextcloud configuration
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

Browser

Browser name: Firefox/Chrome/Safari/…
In every Browser it doesnt work
Browser version: 124/125/…

Operating system: Windows/Ubuntu/Mac/…
Windows

Browser log
Insert your browser log here, this could for example include:
a) The javascript console log
b) The network log


Browser Console
image

If I open a PDF normally and i am logged in as a user on the nextcloud, the PDF opens and I see it. But if I share a PDF and open the link in another browser and I'm not logged in there, all I see is a blank screen.

I use docker and there the Nextcloud container:
https://hub.docker.com/layers/library/nextcloud/30.0.0/images/sha256-0f19a49f4169d4622128f73b8b84110dccd8d7b6c925e1cc54860914be549e89?context=explore

Not working:
nextcloud1

Working (If iam logged in):
nextcloud2

@madrzejewski
Copy link

madrzejewski commented Oct 7, 2024

Hi,

I can confirm that I have the same bug on my side.
The preview don't work on shared links, but it works when authenticated.

I think the problem is that it returns an HTTP 401 when the preview script tries to fetch the PDF.

I noticed a 401 error on this kind of links :

https://redacted-server.com/public.php/dav/files/3mQSWszDagxCo7p/

Edit : I'm also on Nextcloud V30

Edit 2 : However, the download of the file works fine, no 401 on this.

@alpsayin
Copy link

alpsayin commented Oct 11, 2024

Also affected.

If I disable both PDF Viewer and Built-in Collabora Server (but not remove them), then at least somehow Nextcloud Office still finds the Builtin Collabora in apps, and generates a preview. It's ugly but it's something.

I think this is also related and it's where I got the idea from; https://help.nextcloud.com/t/pdf-files-wont-open/188277/9

@joshtrichards
Copy link
Member

Possibly related: #946

@madrzejewski
Copy link

madrzejewski commented Oct 15, 2024

I think I have the same issues on MP3 files. The mp3 player does not show up and I have the same 401 errors (but I can still download the file).

So it may be a broader issue with the previewing of all public/shared files.

EDIT: Similar error with mp4 file. But images & .md files previews are working.

@boutilpj
Copy link

I tracked down where the 401 is coming from.

apps/dav/appinfo/v2/publicremote.php , starting at line 78.

if ($federatedShareProvider->isOutgoingServer2serverShareEnabled() === false && !$isAjax) {
// this is what is thrown when trying to access a non-existing share
throw new NotAuthenticated();
}

I tested by comment out the throw line and I was able to view the PDF as expected.

Noticing isOutgoingServer2serverShareEnabled , I took a look in Administration settings -> Sharing -> Federate Cloud Sharing and noticed this setting which was off. Turning it on (with the throw back in the above code) also fixes the issue.

Allow people on this server to send shares to other servers (this option also allows WebDAV access to public shares) .

@madrzejewski
Copy link

Thanks @boutilpj, from what I managed to find, it seems to be fixed in a recent commit bbc5d32c8e14de78ae12c3acea384c69d2264eca in this pull request 48628

@asayin-xlnx
Copy link

Thanks @madrzejewski and indeed Nextcloud update to 30.0.1 fixed it.

@skjnldsv
Copy link
Member

skjnldsv commented Nov 7, 2024

Thanks @madrzejewski and indeed Nextcloud update to 30.0.1 fixed it.

Closing then 👍

@skjnldsv skjnldsv closed this as completed Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants