janeczku / calibre-web

:books: Web app for browsing, reading and downloading eBooks stored in a Calibre database
GNU General Public License v3.0
12.69k stars 1.33k forks source link

Kobo Sync token contents do not follow the expected json schema #3017

Closed wietsedv closed 6 months ago

wietsedv commented 6 months ago

Describe the bug/problem

Since a couple of weeks synchronisation with Kobo does not work anymore and if I keep wifi on on my Kobo, the battery drains in a day. It appears that the Kobo Sync Token that Kobo gives in request headers cannot be parsed by Calibre Web. Calibre-Web nor Kobo have been updated since it last worked, so I am assuming that this will be hard to reproduce.

Has anyone experienced a similar issue before?

I have tried:

Logfile

Endless repetitions of the following sequence:

Mar 10 11:32:17 homelab calibre-web[4193091]: [2024-03-10 11:32:17,085] DEBUG {cps.ub:84} Found stored session: 3a6e8f8f10293033f41dccff03ac2440f01b000811d699d88974030560913c5941a3473bc284e086c4c0240b81a3c2ab4185443ae363b4618aabe532c0fba268
Mar 10 11:32:17 homelab calibre-web[4193091]: [2024-03-10 11:32:17,085] ERROR {cps.services.SyncToken:126} Sync token contents do not follow the expected json schema.
Mar 10 11:32:17 homelab calibre-web[4193091]: [2024-03-10 11:32:17,085]  INFO {cps.kobo:143} Kobo library sync request received.
Mar 10 11:32:17 homelab calibre-web[4193091]: [2024-03-10 11:32:17,085] DEBUG {cps.kobo:144} SyncToken: 0001-01-01 00:00:00,0001-01-01 00:00:00,0001-01-01 00:00:00,0001-01-01 00:00:00,0001-01-01 00:00:00,
Mar 10 11:32:17 homelab calibre-web[4193091]: [2024-03-10 11:32:17,085] DEBUG {cps.kobo:145} Download link format http://192.168.0.1:8083/kobo/6d559739f510d466c496de21e2aa87a3/download/[bookid]/[bookformat]
Mar 10 11:32:17 homelab calibre-web[4193091]: [2024-03-10 11:32:17,085] DEBUG {cps.kobo:147} Kobo: Received unproxied request, changed request port to external server port
Mar 10 11:32:17 homelab calibre-web[4193091]: [2024-03-10 11:32:17,097] DEBUG {cps.kobo:204} Books to Sync: 0
Mar 10 11:32:17 homelab calibre-web[4193091]: [2024-03-10 11:32:17,101] DEBUG {cps.kobo:258} Remaining books to Sync: 0

Environment (please complete the following information):

wietsedv commented 6 months ago

Of course I managed to identify the problem just minutes after posting this issue. I do not have a definitive solution, but my issue is caused by the calibre-web distribution of nixos-unstable. When I switch to the nixos-2311 package, the problem is solved. I will look into fixing the nixos-unstable version later, but since both are calibre-web 0.6.21, it is not a real calibre-web issue. Might be something about python or other package version compatibility.