server icon indicating copy to clipboard operation
server copied to clipboard

[Bug]: PDF viewer stopped working with v28 unless federated cloud sharing is enabled

Open meonkeys opened this issue 1 year ago • 2 comments

⚠️ This issue respects the following points: ⚠️

Bug description

I upgraded from 27.1.6.2 to 28.0.2.5 and now the PDF viewer doesn't work for public shares of PDF files.

On my live instance: I upload a PDF or locate an existing PDF no problem, then I create a public share with default options. I leave Download allowed. I get a HTTP 200 fetching the share URL itself and I see the Nextcloud banner at the top of the page with the file name and Download button, but the main part of the page is blank (no PDF preview). In the console I see a failed XHR for SERVER/public.php/webdav/ (HTTP 401 - unauthorized) and an error: Could not open file / Error: Invalid response: 401. Any ideas? I searched around a bit and it doesn't seem like others are running into this same issue.

https://help.nextcloud.com/t/pdf-dont-open-after-nc-upgrade-to-28-0-2/181260 sounds like a similar symptom but perhaps different cause.

https://github.com/nextcloud/server/issues/5496 is really old, but matches the error I'm seeing.

I have a repro in a production/live instance and in a fresh 28.0.2.5 instance running in a Docker container after disabling all Federated Cloud Sharing options.

Steps to reproduce

  1. docker run --rm -it -p 8080:80 nextcloud
  2. set up instance, skip installing additional apps
  3. create public link for a PDF -- I used Nextcloud Manual.pdf
  4. works -- go to public link and see PDF in viewer as logged-out user
  5. toggle off all Federated Cloud Sharing options at http://localhost:8080/settings/admin/sharing
  6. with browser console open, reload public share link for the PDF
  7. in console: see PROPFIND request for /public.php/webdav/ returning HTTP 401 Unauthorized
  8. in browser: see PDF viewer not working

example

Expected behavior

PDF viewer works with all Federated Cloud Sharing options disabled.

Installation method

Community Docker image

Nextcloud Server version

28

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

SQlite

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • [X] Default user-backend (database)
  • [ ] LDAP/ Active Directory
  • [ ] SSO - SAML
  • [ ] Other

Configuration report

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "upgrade.disable-web": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost:8080"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "sqlite3",
        "version": "28.0.2.5",
        "overwrite.cli.url": "http:\/\/localhost:8080",
        "installed": true
    }
}

List of activated Apps

Enabled:
  - activity: 2.20.0
  - circles: 28.0.0-dev
  - cloud_federation_api: 1.11.0
  - comments: 1.18.0
  - contactsinteraction: 1.9.0
  - dashboard: 7.8.0
  - dav: 1.29.1
  - federatedfilesharing: 1.18.0
  - federation: 1.18.0
  - files: 2.0.0
  - files_pdfviewer: 2.9.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - firstrunwizard: 2.17.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - nextcloud_announcements: 1.17.0
  - notifications: 2.16.0
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - photos: 2.4.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - support: 1.11.0
  - survey_client: 1.16.0
  - systemtags: 1.18.0
  - text: 3.9.1
  - theming: 2.3.0
  - twofactor_backupcodes: 1.17.0
  - updatenotification: 1.18.0
  - user_status: 1.8.1
  - viewer: 2.2.0
  - weather_status: 1.8.0
  - workflowengine: 2.10.0
Disabled:
  - admin_audit: 1.18.0
  - bruteforcesettings: 2.8.0
  - encryption: 2.16.0
  - files_external: 1.20.0
  - suspicious_login: 6.0.0
  - twofactor_totp: 10.0.0-beta.2
  - user_ldap: 1.19.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

None.

Additional info

None.

meonkeys avatar Feb 14 '24 05:02 meonkeys

Hi! We are experiencing the same behaviour in our Nextcloud instance. Same version, same issue.

After enabling option Allow users on this server to send shares to other servers (this option also allows WebDAV access to public shares) PDF preview in public shares work again.

Thank you!

radasys avatar Feb 14 '24 14:02 radasys

Hi,

same issue with our Nextcloud Enterprise v28.0.2.

The workaround with the one federated sharing option enabled, works for our customer.

Pushing this to raise the awareness of this issue!

theQuestionmark avatar Feb 16 '24 12:02 theQuestionmark

Same Issue for us with V28.0.2. The workaround described by @radasys also works for us.

handkerchief333 avatar Feb 19 '24 20:02 handkerchief333

Cannot reproduce anymore on v28.0.3rc2

skjnldsv avatar Feb 28 '24 09:02 skjnldsv

Actually duplicate of https://github.com/nextcloud/server/issues/43287

skjnldsv avatar Feb 28 '24 09:02 skjnldsv

Verified fixed in stable community Docker image, v28.0.3.2

meonkeys avatar Mar 06 '24 20:03 meonkeys