calibre-web icon indicating copy to clipboard operation
calibre-web copied to clipboard

Kobo sync failure @ v1/user/add-device

Open cgudea opened this issue 1 year ago • 6 comments

Describe the bug/problem Unable to sync on second kobo device utilizing a new user account.

I am able to sync with another device of the same time (Kobo Libra 2) with the same firmware to my original account. Attempting to sync using the original account also fails on the newer device.

To Reproduce Steps to reproduce the behavior:

  1. Add new user to calibre web with full rights (admin, add/delete, etc)
  2. Edit Kobo eReader.conf to have api_endpoint and image urls with appropriate token
  3. Reboot kobo device
  4. Attempt sync
  5. Sync failure (404 at v1/user/add-device)

Logfile These logs are directly from the Kobo device. The calibre web log does not contain the failure at v1/user/add-device

Jul  5 09:25:24 nickel: (  1383.453 @ 0x3273dd0 / sync.debug) =================== SYNC QUEUE [ SyncClient(0x2fe45d0) ] ====================
Jul  5 09:25:24 nickel: (  1383.454 @ 0x3273dd0 / sync.debug)  ----- Queued -------
Jul  5 09:25:24 nickel: (  1383.454 @ 0x3273dd0 / sync.debug)  [ AddDeviceCommand(0x7050a298) ]
Jul  5 09:25:24 nickel: (  1383.454 @ 0x3273dd0 / sync.debug)  [ SyncLibraryCommand(0x70504140) ]
Jul  5 09:25:24 nickel: (  1383.454 @ 0x3273dd0 / sync.debug)  [ OverDriveSyncCommand(0x70509cd8) ]
Jul  5 09:25:24 nickel: (  1383.455 @ 0x3273dd0 / sync.debug)  [ PocketSyncCommand(0x7050fdf0) ]
Jul  5 09:25:24 nickel: (  1383.455 @ 0x3273dd0 / sync.debug)  [ UpdateAllRelatedItemsCommand(0x7050a1b8) ]
Jul  5 09:25:24 nickel: (  1383.455 @ 0x3273dd0 / sync.debug)  [ UpdateNextInSeriesCommand(0x7051feb0) ]
Jul  5 09:25:24 nickel: (  1383.455 @ 0x3273dd0 / sync.debug)  [ SyncRecommendationsCommand(0x7051b140) ]
Jul  5 09:25:24 nickel: (  1383.455 @ 0x3273dd0 / sync.debug)  [ SyncTopPicksCommand(0x7050af38) ]
Jul  5 09:25:24 nickel: (  1383.456 @ 0x3273dd0 / sync.debug)  [ SyncMostPopularTabCommand(0x705b0dc8) ]
Jul  5 09:25:24 nickel: (  1383.456 @ 0x3273dd0 / sync.debug)  [ SyncFontsAndResourcesCommand(0x705b4c10) ]
Jul  5 09:25:24 nickel: (  1383.456 @ 0x3273dd0 / sync.debug)  [ SubmitAnalyticsEventsCommand(0x705069c0) ]
Jul  5 09:25:24 nickel: (  1383.456 @ 0x3273dd0 / sync.debug)  [ ReviewsSyncCommand(0x705b37a0) ]
Jul  5 09:25:24 nickel: (  1383.456 @ 0x3273dd0 / sync.debug)  [ SyncUserGuideCommand(0x705b4ae8) ]
Jul  5 09:25:24 nickel: (  1383.457 @ 0x3273dd0 / sync.debug)  [ SyncDictionariesCommand(0x7050ee18) ]
Jul  5 09:25:24 nickel: (  1383.457 @ 0x3273dd0 / sync.debug)  [ FrictionlessReadingCommand(0x705b35a8) ]
Jul  5 09:25:24 nickel: (  1383.457 @ 0x3273dd0 / sync.debug)  [ DownloadQueuedBooksCommand(0x70506a78) ]
Jul  5 09:25:24 nickel: (  1383.457 @ 0x3273dd0 / sync.debug)  [ CleanupCommand(0x70502ea8) ]
Jul  5 09:25:24 nickel: (  1383.457 @ 0x3273dd0 / sync.debug) ===================================================
Jul  5 09:25:24 nickel: (  1383.458 @ 0x3273dd0 / sync.debug)
Jul  5 09:25:24 nickel: (  1383.458 @ 0x3273dd0 / sync.debug) pumping with 17 pending commands and 0 active commands
Jul  5 09:25:24 nickel: (  1383.458 @ 0x3273dd0 / sync.debug) executing AddDeviceCommand(0x7050a298)
Jul  5 09:25:24 nickel: (  1383.458 @ 0x3273dd0 / sync.debug) virtual void AuthenticatedCommand::execute()
Jul  5 09:25:24 nickel: (  1383.458 @ 0x3273dd0 / sync.debug) virtual void AddDeviceCommand::authenticatedExecute()
Jul  5 09:25:24 nickel: (  1383.498 @ 0x3273dd0 / packetdump.warning) "https://<DOMAIN>/kobo/<TOKEN>/v1/user/add-device" => "Error downloading https://<DOMAIN>/kobo/<TOKEN>/v1/user/add-device - server replied: Not Found"
Jul  5 09:25:24 nickel: (  1383.499 @ 0x3273dd0 / packetdump.warning) HTTP Status Code: 404
Jul  5 09:25:24 nickel: (  1383.499 @ 0x3273dd0 / packetdump.warning) Error: 203
Jul  5 09:25:24 nickel: (  1383.500 @ 0x3273dd0 / packetdump.warning) Source: "https://<DOMAIN>/kobo/<TOKEN>/v1/user/add-device"
Jul  5 09:25:24 nickel: (  1383.501 @ 0x3273dd0 / packetdump.warning) "<!DOCTYPE html> <html class="http-error">   <head>     <title>Calibre | HTTP Error (Error 404)</title>     <meta charset="utf-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">     <meta name="apple-mobile-web-app-capable" content="yes">      <!-- Bootstrap -->     <link rel="apple-touch-icon" sizes="140x140" href="/static/favicon.ico">     <link rel="shortcut icon" href="/static/favicon.ico">     <link href="/static/css/libs/bootstrap.min.css" rel="stylesheet" media="screen">     <link href="/static/css/style.css" rel="stylesheet" media="screen">             <link href="/static/css/caliBlur.css" rel="stylesheet" media="screen">        </head>   <body>   <div class="container-fluid">   <div class="row">     <div class="col">         <h1  class="text-center">Calibre</h1>         <h1  class="text-center">Error 404</h1>         <h3>Not Found</h3>     </div>   </div>   <div class="row">     <div class="col-md-offset-4 text-left">                     </div>    </div>        <div class="row">       <div class="col errorlink">                <a href="/" title="Return to Home">Return to Home</a>              </div>     </div>   </div>   </body> </html>"
Jul  5 09:25:24 nickel: (  1383.502 @ 0x2bb4758 / ui.warning) virtual bool QDebugSyncErrorFilter::applyFilter(SyncError&) "WebRequestErr"
Jul  5 09:25:24 nickel: (  1383.509 @ 0x3273dd0 / sync.debug) virtual void QueuedSyncCommand::cancel() SyncClient(0x2fe45d0) AddDeviceCommand(0x7050a298)
Jul  5 09:25:24 nickel: (  1383.510 @ 0x3273dd0 / sync.debug) =================== SYNC QUEUE [ SyncClient(0x2fe45d0) ] ====================

Expected behavior Sync should function

Environment (please complete the following information):

  • OS: Unraid 6.10.3
  • Calibre-Web version: 0.6.18
  • Docker container: LinuxServer

Additional context The device is a recently purchased Kobo Libra 2. It came installed with the latest firmware (4.33.19611). My older device is also a Kobo Libra 2 with the same firmware installed.

I see in kobo.py that there is no /v1/user/add-device endpoint.

Is this an issue with my kobo device sync api changing slightly and breaking for calibre-web? If so why does the sync work on the same firmware of an older device? Any advice is greatly appreciated.

cgudea avatar Jul 07 '22 17:07 cgudea

I think I might be having the same issue. How did you pull logs directly from your Kobo device?

MaartenMol avatar Jul 10 '22 13:07 MaartenMol

You connect to the device using telnet/ncat and can see the logs there. The basic steps are:

  1. enable dev mode
  2. turn on Sync logging in the dev menu
  3. telnet <KOBO_IP) 5001
  4. perform sync
  5. use logread to observe failure/copy log
  6. disable dev mode (for safety since dev mode gives anyone root access to the device if they know the IP)

cgudea avatar Jul 10 '22 15:07 cgudea

@MaartenMol were you able to confirm if you have the same issue?

cgudea avatar Jul 19 '22 19:07 cgudea

@MaartenMol were you able to confirm if you have the same issue?

I was, it was the same. However.... it was fixed after I fully deleted the container and ran the latest version again. Never had the issue again. I use the linuxserver latest image on Docker Hub.

MaartenMol avatar Jul 19 '22 19:07 MaartenMol

Did you delete the config directory or just docker stop <CALIBRE> && docker rm <CALIBRE> and pull the latest?

Either way I'll test when I get access to my ereader. Thanks for the quick reply.

cgudea avatar Jul 19 '22 19:07 cgudea

Did you delete the config directory or just docker stop <CALIBRE> && docker rm <CALIBRE> and pull the latest?

Either way I'll test when I get access to my ereader. Thanks for the quick reply.

No data removed, just the container!

MaartenMol avatar Jul 19 '22 19:07 MaartenMol