YunoHost-Apps / calibreweb_ynh

Calibre-web package for YunoHost
GNU General Public License v3.0
18 stars 8 forks source link

Kobo Sync fails #124

Open colmoneill opened 1 year ago

colmoneill commented 1 year ago

Kobo Sync on YNH Calibre Web fails

Firstly, let me just thank the devs who are porting calibre-web to ynh, I really appreciate all this work!

Hi, I recently installed calibreweb on my ynh instance in hopes to sync my kobo device with that library. Unfortunately, after following the configuration steps, the sync fails

Context

Steps to reproduce

  1. Tick 'Enable Kobo Sync' in calibre-web admin > basic configuration > feature configuration
  2. Server external port set to 443 (calibre-web is served via a LetsEncrypt singned subdomain (https://library.domain.tld)
  3. in user settings section (not Admin section) click button create/view under 'Kobo Sync Token' which displays a modal with configuration information, described in following step
  4. on the Kobo device itself, add the api_endpoint= line to the .kobo/Kobo/Kobo eReader.conf file
  5. eject Kobo device and press the sync button on the eReader device, top right of the 'Home' screen.
  6. Task fails after about 15 seconds of the sync icon spinning. Dialog says 'Sync to download new items and software updates' button on that modal says 'Retry sync'.

Expected behavior

I expected the Kobo device to connect to my calibre-web library and download the KEPUB books that are available there or alternatively sync from a selected shelf (I have tried both and neither work).

Logs

Full Calibreweb log (since app installation): https://paste.yunohost.org/faboyuravu.swift Full Calibreweb-access log (all I have): https://paste.yunohost.org/uwujokuyot.php

Additional information / attempts

Thank you for any support you could provide!

Best regards

Krakinou commented 1 year ago

Hello and thanks for the detailed report, I myself also struggled to make it work asks I have the feeling that it was sheer luck... Looking at the logs, I can see 3 things:

colmoneill commented 1 year ago

Thanks @Krakinou

Looking to activate debug logs, but I can't see any button for that, is that something I can access outside of Calibre itself, via ssh maybe?

Cheers

colmoneill commented 1 year ago

Sorry, I found it, I was looking for a checkbox to enable, and not a dropdown to toggle the log levels.

In the meantime, something really weird was happening whereby I could not login to my calibreweb instance. All the other apps on my ynh instance (including the webadmin) all worked fine and I could log in, but not on calibre web. So I reinstalled it (I only had one book in it) and the issue persists after regenerating a new sync token and updating the kobo with it.

Here are the current logs in calibreweb.log

[2023-05-06 19:02:52,004]  INFO {cps:176} Starting Calibre Web...
[2023-05-06 19:02:52,213]  WARN {py.warnings:109} /var/www/calibreweb/venv/lib/python3.9/site-packages/flask_limiter/extension.py:293: UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend.
  warnings.warn(

[2023-05-06 19:02:52,630]  INFO {apscheduler.scheduler:171} Scheduler started
[2023-05-06 19:02:52,631]  WARN {py.warnings:109} /var/www/calibreweb/venv/lib/python3.9/site-packages/apscheduler/util.py:428: PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495). For more details on migrating to a PEP 495-compliant implementation, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
  return tzinfo.localize(dt)

[2023-05-06 19:02:52,631]  INFO {apscheduler.scheduler:885} Added job "end scheduled task" to job store "default"
[2023-05-06 19:02:53,496]  INFO {cps.server:207} Starting Gevent server on [::]:8083
[2023-05-06 19:10:34,989]  INFO {cps.server:284} webserver stop (restart=True)
[2023-05-06 19:10:34,990]  INFO {apscheduler.scheduler:202} Scheduler has been shut down
[2023-05-06 19:10:34,994]  INFO {cps.server:265} Performing restart of Calibre-Web
[2023-05-06 19:10:35,852]  INFO {cps:176} Starting Calibre Web...
[2023-05-06 19:10:36,004] DEBUG {cps.services:49} Cannot import gmail, sending books via Gmail Oauth2 Verification will not work: No module named 'google_auth_oauthlib'
[2023-05-06 19:10:36,029]  WARN {py.warnings:109} /var/www/calibreweb/venv/lib/python3.9/site-packages/flask_limiter/extension.py:293: UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend.
  warnings.warn(

[2023-05-06 19:10:36,133] DEBUG {cps.gdriveutils:81} Cannot import pydrive, httplib2, using gdrive will not work: No module named 'pydrive'
[2023-05-06 19:10:36,426]  INFO {apscheduler.scheduler:171} Scheduler started
[2023-05-06 19:10:36,427]  WARN {py.warnings:109} /var/www/calibreweb/venv/lib/python3.9/site-packages/apscheduler/util.py:428: PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495). For more details on migrating to a PEP 495-compliant implementation, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
  return tzinfo.localize(dt)

[2023-05-06 19:10:36,427]  INFO {apscheduler.scheduler:885} Added job "end scheduled task" to job store "default"
[2023-05-06 19:10:36,655] DEBUG {cps.admin:80} Cannot import Flask-Dance, login with Oauth will not work: No module named 'flask_dance'
[2023-05-06 19:10:36,660] DEBUG {cps.gdrive:44} Cannot import googleapiclient, using GDrive will not work: No module named 'googleapiclient'
[2023-05-06 19:10:37,186]  INFO {cps.server:207} Starting Gevent server on [::]:8083
[2023-05-06 19:11:00,925] DEBUG {cps.config_sql:373} _ConfigSQL updating storage
[2023-05-06 19:11:00,945] DEBUG {cps.config_sql:373} _ConfigSQL updating storage
[2023-05-06 19:11:00,945]  INFO {cps.server:284} webserver stop (restart=True)
[2023-05-06 19:11:00,946]  INFO {apscheduler.scheduler:202} Scheduler has been shut down
[2023-05-06 19:11:00,950]  INFO {cps.server:265} Performing restart of Calibre-Web
[2023-05-06 19:11:01,757]  INFO {cps:176} Starting Calibre Web...
[2023-05-06 19:11:01,914] DEBUG {cps.services:49} Cannot import gmail, sending books via Gmail Oauth2 Verification will not work: No module named 'google_auth_oauthlib'
[2023-05-06 19:11:01,936]  WARN {py.warnings:109} /var/www/calibreweb/venv/lib/python3.9/site-packages/flask_limiter/extension.py:293: UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend.
  warnings.warn(

[2023-05-06 19:11:02,027] DEBUG {cps.gdriveutils:81} Cannot import pydrive, httplib2, using gdrive will not work: No module named 'pydrive'
[2023-05-06 19:11:02,309]  INFO {apscheduler.scheduler:171} Scheduler started
[2023-05-06 19:11:02,310]  WARN {py.warnings:109} /var/www/calibreweb/venv/lib/python3.9/site-packages/apscheduler/util.py:428: PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495). For more details on migrating to a PEP 495-compliant implementation, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html
  return tzinfo.localize(dt)

[2023-05-06 19:11:02,311]  INFO {apscheduler.scheduler:885} Added job "end scheduled task" to job store "default"
[2023-05-06 19:11:02,573] DEBUG {cps.admin:80} Cannot import Flask-Dance, login with Oauth will not work: No module named 'flask_dance'
[2023-05-06 19:11:02,580] DEBUG {cps.gdrive:44} Cannot import googleapiclient, using GDrive will not work: No module named 'googleapiclient'
[2023-05-06 19:11:03,126]  INFO {cps.server:207} Starting Gevent server on [::]:8083
[2023-05-06 19:13:37,153] DEBUG {cps.updater:329} Stable version: {'version': '0.6.20'}
[2023-05-06 19:16:05,408] DEBUG {cps.updater:329} Stable version: {'version': '0.6.20'}
[2023-05-06 19:16:09,191]  INFO {cps.ub:898} 0 sync entries deleted
[2023-05-06 19:16:40,460]  INFO {cps.ub:898} 0 sync entries deleted
colmoneill commented 1 year ago

Later logs since last post do not seem to show anything very useful:

[2023-05-07 04:10:00,102]  INFO {apscheduler.executors.default:123} Running job "end scheduled task (trigger: cron[hour='4', minute='10'], next run at: 2023-05-08 04:10:00 IST)" (scheduled at 2023-05-07 04:10:00+01:00)
[2023-05-07 04:10:00,129]  INFO {apscheduler.executors.default:144} Job "end scheduled task (trigger: cron[hour='4', minute='10'], next run at: 2023-05-08 04:10:00 IST)" executed successfully
[2023-05-07 08:31:24,911] DEBUG {cps.updater:329} Stable version: {'version': '0.6.20'}
[2023-05-07 08:32:34,505]  INFO {cps.shelf:336} Shelf Kobo created
[2023-05-07 08:32:38,382]  INFO {cps.shelf:336} Shelf Kobo changed
[2023-05-07 08:32:47,672] DEBUG {cps.updater:329} Stable version: {'version': '0.6.20'}
[2023-05-07 08:32:59,199]  INFO {cps.ub:898} 0 sync entries deleted
[2023-05-07 08:33:17,295]  INFO {cps.shelf:336} Shelf Kobo changed
[2023-05-07 08:33:43,636] DEBUG {cps.web:1472} Profile updated
[2023-05-07 08:33:52,432] DEBUG {cps.updater:329} Stable version: {'version': '0.6.20'}
[2023-05-08 04:10:00,079]  INFO {apscheduler.executors.default:123} Running job "end scheduled task (trigger: cron[hour='4', minute='10'], next run at: 2023-05-09 04:10:00 IST)" (scheduled at 2023-05-08 04:10:00+01:00)
[2023-05-08 04:10:00,080]  INFO {apscheduler.executors.default:144} Job "end scheduled task (trigger: cron[hour='4', minute='10'], next run at: 2023-05-09 04:10:00 IST)" executed successfully
[2023-05-08 10:04:21,408] DEBUG {cps.updater:329} Stable version: {'version': '0.6.20'}
[2023-05-08 10:06:05,861]  INFO {cps.shelf:336} Shelf Kobo changed
[2023-05-08 10:06:47,548] DEBUG {cps.updater:329} Stable version: {'version': '0.6.20'}