owncloud-apps icon indicating copy to clipboard operation
owncloud-apps copied to clipboard

Reader doesn't load in public shares (Nextcloud)

Open Jutosa opened this issue 6 years ago • 2 comments

I'm using Nextcloud 13 and the plugin version is 1.2.3

The reader works great for me while I'm in the regular Nextcloud user area.

However, when I create a public share link, it doesn't load on the share page.

I can still download the file but the area where the reader would show says:

Error The requested share does not exist anymore

Chrome shows me three errors in the console (I removed the domain):

core.js?v=9fa36c97-0:3
GET https://<domain removed>/nextcloud/apps/files_reader/?file=%2Fnextcloud%2Fs%2FCSCgwJg5TwAYPTd%2Fdownload&type=application%2Fepub%2Bzip 503 (Service Unavailable)
merged-share-backend.js?v=9fa36c97-0:24
Uncaught ReferenceError: oc_appconfig is not defined
    at merged-share-backend.js?v=9fa36c97-0:24
    at merged-share-backend.js?v=9fa36c97-0:80
merged-template-prepend.js?v=9fa36c97-0:1433
Uncaught TypeError: Cannot read property 'substring' of undefined
    at Object.filePath (merged-template-prepend.js?v=9fa36c97-0:1433)
    at viewer.js?v=9fa36c97-0:15

I thought maybe it had something to do with the rewrite rules for the pretty URLs. So I tried it without them but still got the same error.

Jutosa avatar Mar 10 '18 22:03 Jutosa

Do you have OPDS Catalog installed? If so, temporarily disable it and try again. If it now works the problem lies there, not in Reader - which uses OPDS Catalog (if installed) to gather metadata on EPUB and PDF. This is the only way I've been able to reproduce something resembling this problem, with a publication which had not yet been scanned by OPDS Catalog. A bug this is, for sure, to be solved in the next overhaul of OPDS Catalog 'R.S.N.'.

If you don't have OPDS Catalog installed I'll need more information to know what is going on here.

Yetangitu avatar Mar 11 '18 18:03 Yetangitu

I'm not using OPDS Catalog and I don't have installed so that's not it.

I can try to provide you with any information I can. The Nextcloud log doesn't show anything related to this.

My Apache version is 2.4.18-2ubuntu3.5 PHP version is 7.0.25-0ubuntu0.16.04.1

I'm on Ubuntu 16.04 LTS

The first error message looks different in Firefox than in Chrome, maybe that helps:

Content Security Policy: The page's settings blocked the loading of a resource at self. ("script-src https://<domain removed> 'unsafe-eval' 'nonce-Ty95YVNZQjRuenNOS1dXYXI2d1ZmTHhPWHVncXgvOHc1VnZXWGZ2OUUydz06V01qdGNPZ1N0RzBtZlFmVDdwNWRNc1Y3QnB4UXB0UUZsU1BsWkxhZVdCVT0='"). Source: (function (ERROR) {

    const V8_STACK_....

The error message in Firefox says 'https://<domain removed>' but shouldn't it say 'https://<domain removed>/nextcloud'? Not sure if that's relevant.

Jutosa avatar Mar 11 '18 20:03 Jutosa