Kareadita / Kavita

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.
http://www.kavitareader.com
GNU General Public License v3.0
6.12k stars 316 forks source link

Kavita OPDS in KOReader returns error: "Cannot get catalog. Server refuses to serve uncompressed content." #1678

Closed eniad closed 1 year ago

eniad commented 1 year ago

Describe the bug

I am attempting to get content from Kavita via KOReader. However, I'm getting a "Cannot get catalog. Server refuses to serve uncompressed content." error. This might be incorrect settings on my part rather than a bug. Can I set Kavita to only serve uncompressed content?

To Reproduce

Steps to reproduce the behavior:

  1. Install Kavita via Docker
  2. Install KOReader on Android: https://github.com/koreader/koreader/releases
  3. Connect OPDS in KOReader to Kavita ODPS api endpoint
  4. See error "Cannot get catalog. Server refuses to serve uncompressed content."

Expected behavior

KOReader should connect to Kavita's OPDS server.

Kavita's ODPS api endpoint works successfully in the Tachiyomi app. I verified both apps are using the same API key in the URL.

KOReader is successfully connected to the Calibre OPDS catalog.

Devices

Additional context

This error was previously reported by andycarlberg in Kavita's repo as Kareadita/Kavita#1199. In that discussion, an issue was also opened in KOReader's repo as koreader/koreader#8971. In that case the error cleared up on its own. I waited a few days and restarted for client and server multiple times. I also turned on debugging in KOReader to see if that was some how the fix in the original bug report. There was no change in behavior. I also can't find the KOReader log file on Android.

In Kavita, the logs are below. Debug logging level provides the same lines as info.

[Kavita] [2022-12-06 15:43:09.834 -05:00  30] [Information] Serilog.AspNetCore.RequestLoggingMiddleware HTTP HEAD /api/opds/<apikey> responded 200 in 1.6113 ms

[Kavita] [2022-12-06 15:43:09.941 -05:00  30] [Information] Serilog.AspNetCore.RequestLoggingMiddleware HTTP GET /api/opds/<apikey> responded 406 in 86.0732 ms

Server and device are on the same local network. Server is not exposed to the internet.

The "Cannot get catalog. Server refuses to serve uncompressed content." is a 406. See KOReader's opdsbrowser.lua line 302.

Internet searches hinted that a 406 error sometimes occurs on pdf > html conversion (although the context was dubious). Removing all pdfs from my Kavita library resulted in no change in behavior.

majora2007 commented 1 year ago

If I recall, the previous user's error was due to their reverse proxy compressing response to KOReader. From the logs attached, the server is responding with valid output, this seems more like something KOReader should be looking into. Kavita is serving valid OPDS Spec XML, hence why the other readers work fine.

majora2007 commented 1 year ago

I just downloaded KOReader and added my OPDS url and it's working 100%. Are you sure you're following our instructions and using JUST your OPDS url from your user settings?

eniad commented 1 year ago

It's working now! Thank you for the support. I figured it was something I over looked.


I did another read of the instructions at https://wiki.kavitareader.com/en/guides/settings/opds

I had skipped the turning on of the OPDS for two reasons:

  1. OPDS worked in another App
  2. The instructions pointed me to the wrong page

I made an assumption that the documentation was out of date. Sorry for that assumption!

eniad commented 1 year ago

I put in a PR for the Wiki: https://github.com/Kareadita/Wiki/pull/27

majora2007 commented 1 year ago

You were using Tachiyomi and assumed it used OPDS is what I'm hearing lol