Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get Kobo Sync to work, device fails no error in log #2991

Closed
Everett115 opened this issue Jan 28, 2024 · 9 comments
Closed

Can't get Kobo Sync to work, device fails no error in log #2991

Everett115 opened this issue Jan 28, 2024 · 9 comments

Comments

@Everett115
Copy link

Everett115 commented Jan 28, 2024

Describe the bug/problem

I cannot get Kobo sync working on my docker compose install of calibre web. I have added the following lines to my NGINX Reverse proxy as stated in the wiki:
`proxy_hide_header X-Frame-Options;

proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;

location /kobo {
set $upstream_calibreweb $forward_scheme://$server:$port;
proxy_set_header X-Forwarded-Host $http_host;
proxy_pass $upstream_calibreweb;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
}
`

In the admin settings for the server port I have tried port 8083, 80, & 443.

For the sync token link i have tried http & https and adding /v1/library/sync to the end and nothing works.

Log file shows a sync request when I open the api endpoint in a browser, not on my Kobo device.
INFO {cps.kobo:143} Kobo library sync request received.

Kobo device just says "Sync Failed. Please try again."

When i open the default api endoint in a browser it just shows brackets - {}. When I add /v1/library/sync to the address the browser shows the following:

[{"ChangedReadingState": {"ReadingState": {"EntitlementId": "fb62e865-685b-4d7d-adbe-1301ebda21f7", "Created": "2022-10-30T14:49:30Z", "LastModified": "2024-01-28T03:42:02Z", "PriorityTimestamp": "2024-01-28T03:42:02Z", "StatusInfo": {"LastModified": "2024-01-28T03:42:02Z", "Status": "ReadyToRead", "TimesStartedReading": 0}, "Statistics": {"LastModified": "2024-01-28T03:42:02Z"}, "CurrentBookmark": {"LastModified": "2024-01-28T03:42:02Z"}}}}, {"ChangedReadingState": {"ReadingState": {"EntitlementId": "2317e84f-c831-4da1-9732-85215948992d", "Created": "2022-10-30T14:49:35Z", "LastModified": "2024-01-28T03:42:02Z", "PriorityTimestamp": "2024-01-28T03:42:02Z", "StatusInfo": {"LastModified": "2024-01-28T03:42:02Z", "Status": "ReadyToRead", "TimesStartedReading": 0}, "Statistics": {"LastModified": "2024-01-28T03:42:02Z"}, "CurrentBookmark": {"LastModified": "2024-01-28T03:42:02Z"}}}}, {"ChangedReadingState": {"ReadingState": {"EntitlementId": "0b459ad9-5e4a-48a4-91a2-b2dce640113c", "Created": "2022-10-30T14:49:59Z", "LastModified": "2024-01-28T03:42:02Z", "PriorityTimestamp": "2024-01-28T03:42:02Z", "StatusInfo": {"LastModified": "2024-01-28T03:42:02Z", "Status": "ReadyToRead", "TimesStartedReading": 0}, "Statistics": {"LastModified": "2024-01-28T03:42:02Z"}, "CurrentBookmark": {"LastModified": "2024-01-28T03:42:02Z"}}}}, {"ChangedReadingState": {"ReadingState": {"EntitlementId": "3d750f94-0d0f-43a0-9a78-57c4885cf7a4", "Created": "2022-10-30T14:51:35Z", "LastModified": "2024-01-28T03:42:02Z", "PriorityTimestamp": "2024-01-28T03:42:02Z", "StatusInfo": {"LastModified": "2024-01-28T03:42:02Z", "Status": "ReadyToRead", "TimesStartedReading": 0}, "Statistics": {"LastModified": "2024-01-28T03:42:02Z"}, "CurrentBookmark": {"LastModified": "2024-01-28T03:42:02Z"}}}}, {"ChangedReadingState": {"ReadingState": {"EntitlementId": "3a8a0b2d-89d3-4ed1-8db2-1bd3788710a4", "Created": "2024-01-28T02:24:03Z", "LastModified": "2024-01-28T03:42:02Z", "PriorityTimestamp": "2024-01-28T03:42:02Z", "StatusInfo": {"LastModified": "2024-01-28T03:42:02Z", "Status": "ReadyToRead", "TimesStartedReading": 0}, "Statistics": {"LastModified": "2024-01-28T03:42:02Z"}, "CurrentBookmark": {"LastModified": "2024-01-28T03:42:02Z"}}}}, {"ChangedReadingState": {"ReadingState": {"EntitlementId": "591b4a96-2f97-4499-a10a-083868096439", "Created": "2024-01-28T02:24:11Z", "LastModified": "2024-01-28T03:42:02Z", "PriorityTimestamp": "2024-01-28T03:42:02Z", "StatusInfo": {"LastModified": "2024-01-28T03:42:02Z", "Status": "ReadyToRead", "TimesStartedReading": 0}, "Statistics": {"LastModified": "2024-01-28T03:42:02Z"}, "CurrentBookmark": {"LastModified": "2024-01-28T03:42:02Z"}}}}, {"ChangedReadingState": {"ReadingState": {"EntitlementId": "9dc6cf35-b9a5-4222-9f7d-dc5686d1015a", "Created": "2024-01-28T02:24:21Z", "LastModified": "2024-01-28T03:42:02Z", "PriorityTimestamp": "2024-01-28T03:42:02Z", "StatusInfo": {"LastModified": "2024-01-28T03:42:02Z", "Status": "ReadyToRead", "TimesStartedReading": 0}, "Statistics": {"LastModified": "2024-01-28T03:42:02Z"}, "CurrentBookmark": {"LastModified": "2024-01-28T03:42:02Z"}}}}, {"NewTag": {"Tag": {"Created": "2024-01-28T03:06:58Z", "Id": "61c75d59-3509-4387-8d5f-0cd5c01bc30c", "Items": [{"RevisionId": "3e9b945d-17b6-47ee-bd5a-2e1d9be99ada", "Type": "ProductRevisionTagItem"}, {"RevisionId": "9dc6cf35-b9a5-4222-9f7d-dc5686d1015a", "Type": "ProductRevisionTagItem"}, {"RevisionId": "591b4a96-2f97-4499-a10a-083868096439", "Type": "ProductRevisionTagItem"}, {"RevisionId": "3a8a0b2d-89d3-4ed1-8db2-1bd3788710a4", "Type": "ProductRevisionTagItem"}, {"RevisionId": "2317e84f-c831-4da1-9732-85215948992d", "Type": "ProductRevisionTagItem"}, {"RevisionId": "fb62e865-685b-4d7d-adbe-1301ebda21f7", "Type": "ProductRevisionTagItem"}, {"RevisionId": "0b459ad9-5e4a-48a4-91a2-b2dce640113c", "Type": "ProductRevisionTagItem"}, {"RevisionId": "3d750f94-0d0f-43a0-9a78-57c4885cf7a4", "Type": "ProductRevisionTagItem"}], "LastModified": "2024-01-28T03:39:06Z", "Name": "Kobo Sync", "Type": "UserTag"}}}]

When trying to sync from my Kobo the only message that shows up in the logs is DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
Logfile

[2024-01-28 11:21:29,153]  INFO {cps.server:284} webserver stop (restart=False)
[2024-01-28 11:21:29,154]  INFO {apscheduler.scheduler:212} Scheduler has been shut down
[2024-01-28 11:21:29,155]  INFO {cps.server:262} Performing shutdown of Calibre-Web
[2024-01-28 11:21:41,324]  WARN {cps.config_sql:352} Log path  not valid, falling back to default
[2024-01-28 11:21:41,363]  INFO {cps:168} *** "pytz" version does not meet the requirements. Should: available, Found: Not available, please consider installing required version ***
[2024-01-28 11:21:41,363]  INFO {cps:177} Starting Calibre Web...
[2024-01-28 11:21:41,820]  WARN {py.warnings:109} /lsiopy/lib/python3.10/site-packages/flask_limiter/extension.py:308: 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(

[2024-01-28 11:21:42,060]  INFO {apscheduler.scheduler:181} Scheduler started
[2024-01-28 11:21:42,061]  INFO {apscheduler.scheduler:895} Added job "backup metadata" to job store "default"
[2024-01-28 11:21:42,061]  INFO {apscheduler.scheduler:895} Added job "delete superfluous book covers" to job store "default"
[2024-01-28 11:21:42,062]  INFO {apscheduler.scheduler:895} Added job "generate book covers" to job store "default"
[2024-01-28 11:21:42,062]  INFO {apscheduler.scheduler:895} Added job "end scheduled task" to job store "default"
[2024-01-28 11:21:44,101]  INFO {cps.server:207} Starting Gevent server on [::]:8083
[2024-01-28 11:21:59,247] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:21:59,339] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:21:59,425] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:21:59,519] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:21:59,604] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:21:59,707] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:22:02,795] DEBUG {cps.helper:980} unrar version 6.24
[2024-01-28 11:22:02,804] DEBUG {cps.config_sql:376} _ConfigSQL updating storage
[2024-01-28 11:22:02,812]  WARN {cps.config_sql:352} Log path  not valid, falling back to default
[2024-01-28 11:22:12,394] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:22:12,496] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:22:12,595] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:22:12,683] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:22:12,783] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:22:12,901] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:22:39,657]  INFO {cps.server:284} webserver stop (restart=False)
[2024-01-28 11:22:39,658]  INFO {apscheduler.scheduler:212} Scheduler has been shut down
[2024-01-28 11:22:39,659]  INFO {cps.server:262} Performing shutdown of Calibre-Web
[2024-01-28 11:23:19,114]  WARN {cps.config_sql:352} Log path  not valid, falling back to default
[2024-01-28 11:23:19,160]  INFO {cps:177} Starting Calibre Web...
[2024-01-28 11:23:19,553]  WARN {py.warnings:109} /lsiopy/lib/python3.10/site-packages/flask_limiter/extension.py:336: 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(

[2024-01-28 11:23:19,805]  INFO {apscheduler.scheduler:181} Scheduler started
[2024-01-28 11:23:19,806]  INFO {apscheduler.scheduler:895} Added job "backup metadata" to job store "default"
[2024-01-28 11:23:19,806]  INFO {apscheduler.scheduler:895} Added job "delete superfluous book covers" to job store "default"
[2024-01-28 11:23:19,807]  INFO {apscheduler.scheduler:895} Added job "generate book covers" to job store "default"
[2024-01-28 11:23:19,807]  INFO {apscheduler.scheduler:895} Added job "end scheduled task" to job store "default"
[2024-01-28 11:23:22,064]  INFO {cps.server:218} Starting Gevent server on [::]:8083
[2024-01-28 11:23:34,550] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:23:34,656] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:23:34,753] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:23:34,832] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:23:34,924] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:23:35,056] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:25:50,240] DEBUG {cps.updater:329} Stable version: {'version': '0.6.22 Beta'}
[2024-01-28 11:25:59,297] DEBUG {cps.helper:980} unrar version 6.24
[2024-01-28 11:25:59,309] DEBUG {cps.config_sql:376} _ConfigSQL updating storage
[2024-01-28 11:25:59,318]  WARN {cps.config_sql:352} Log path  not valid, falling back to default
[2024-01-28 11:26:10,120] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:26:10,209] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:26:10,298] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:26:10,378] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:26:10,457] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:26:10,560] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:26:19,309] DEBUG {cps.helper:980} unrar version 6.24
[2024-01-28 11:26:19,310] DEBUG {cps.config_sql:376} _ConfigSQL updating storage
[2024-01-28 11:26:19,314]  WARN {cps.config_sql:352} Log path  not valid, falling back to default
[2024-01-28 11:26:22,819] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:26:22,896] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:26:22,980] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:26:23,076] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:26:23,157] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:26:23,265] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:26:47,803] DEBUG {cps.ub:84} Found stored session: 76b8db349a172f0b83f2b69b359e4e8516a80a737fd2a6a3b8697bd223a43735fbf272eabecf200186594648f1de9a3c48933bf00edd4375b7305ee3c4f87e12
[2024-01-28 11:26:47,804]  INFO {cps.kobo:146} Kobo library sync request received
[2024-01-28 11:26:47,804] DEBUG {cps.kobo:147} 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,
[2024-01-28 11:26:47,804] DEBUG {cps.kobo:148} Download link format http://calibre.everettgreenwood.com/kobo/5e11d35d7860a22e0a52fab3a0a07cd7/download/%5Bbookid%5D/%5Bbookformat%5D
[2024-01-28 11:26:47,833] DEBUG {cps.kobo:207} Books to Sync: 7
[2024-01-28 11:26:48,207] DEBUG {cps.kobo:261} Remaining books to Sync: 0
[2024-01-28 11:26:48,483] DEBUG {cps.kobo:105} Content: b'<!doctype html>\n<html lang="en-us">\n<head>\n<title> Snapshot of 1/28/2024 5:26:48 PM</title>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8">\n<style type="text/css">\nBODY, H1, H2, H3, H4, H5, H6, DL, DT, DD {\n  margin: 0;\n  padding: 0;\n  color: #444;\n  font: 13px/15px Arial, Verdana, Helvetica;\n}\nH1 {\n  text-align: center;\n  font: 24px Helvetica, Verdana, Arial;\n  padding: 20px 0 10px 0;\n  background: #FBFBFB;\n  border-bottom: solid 1px #fff;\n}\n#lnks {\n  border-top: solid 1px #dfdfdf;\n  border-bottom: solid 1px #dfdfdf;\n  margin: 0 0 10px 0;\n  padding: 5px;\n  background: #f1f1f1;\n  line-height: 20px;\n  text-align: center;\n}\n#lnks B {\n  padding: 0 3px;\n}\n#body {\n  padding: 20px;\n}\nH1 B {\n  font-weight: normal;\n  color: #069;\n}\nH1 A {\n  color: #0E8F13;\n  text-decoration: underline;\n}\nH1 I {\n  font-style: normal;\n  color: #0E8F13;\n}\nA {\n  color: #00C;\n  text-decoration: none;\n}\nA:hover {\n  text-decoration: underline;\n}\n.ib {\n    position: relative;\n    display: -moz-inline-box;\n    display: inline-block;\n}\n* html .ib {\n    display: inline;\n}\n*:first-child + html .ib {\n    display: inline;\n}\nTABLE {\n  border-collapse:collapse;\n  border: solid 1px #ccc;\n  clear: left;\n}\nTH {\n  text-align: left;\n  padding: 4px 8px;\n  text-shadow: #fff 1px 1px -1px;\n  background: #f1f1f1;\n  white-space:nowrap;\n  cursor:pointer;\n  font-weight: bold;\n}\nTH, TD, TD DT, TD DD {\n  font-size: 13px;\n  font-family: Arial;\n}\nTD {\n  padding: 8px 8px 0 8px;\n  vertical-align: top;\n}\nDL {\n  clear: left;\n}\nDT {\n  margin: 10px 0 5px 0;\n  font: bold 18px Helvetica, Verdana, Arial;\n  min-width: 200px;\n  overflow: hidden;\n  clear: left;\n  float: left;\n  display:block;\n  white-space:nowrap;\n}\nDD {\n  margin: 5px 10px;\n  font: 18px Arial;\n  padding: 2px;\n  display: block;\n  float: left;\n}\nDL DL DT { \n  font: bold 16px Arial;\n}\nDL DL DD {\n  font: 16px Arial;\n}\nHR {\n    display:none;\n}\nTD DL HR\n{\n    display:block;\n    padding: 0;\n    clear: left;\n    border: none;\n}\nTD DL\n{\n    padding: 4px;\n    margin: 0;\n    height:100%;\n    max-width: 700px;\n}\nDL TD DL DT {\n  padding: 2px;\n  margin: 0 10px 0 0;\n  font-weight: bold;\n  font-size: 13px;\n  width: 120px;\n  overflow: hidden;\n  clear: left;\n  float: left;\n  display:block;\n}\nDL TD DL DD {  \n  margin: 0;\n  padding: 2px;\n  font-size: 13px;\n  display: block;\n  float: left;\n}\nTBODY>TR:last-child>TD {\n  padding: 8px;\n}\nTHEAD\n{\n  -webkit-user-select:none;\n  -moz-user-select:none;\n}\n.desc, .asc {\n  background-color: #FAFAD2;\n}\n.desc {\n  background-color: #D4EDC9;\n}\nTH B {\n  display:block;\n  float:right;\n  margin: 0 0 0 5px;\n  width: 0;\n  height: 0;\n\n  border-left: 5px solid transparent;\n  border-right: 5px solid transparent;\n  border-top: 5px solid #ccc;\n  border-bottom: none;\n}\n.asc B {\n  border-left: 5px solid transparent;\n  border-right: 5px solid transparent;\n  border-top: 5px solid #333;\n  border-bottom: none;\n}\n.desc B {\n  border-left: 5px solid transparent;\n  border-right: 5px solid transparent;\n  border-bottom: 5px solid #333;\n  border-top: none;\n}\n#show-json {\n  display:none;\n}\n#mask {  \n  display: none;\n  position:absolute;\n  top:0;\n  left:0;\n  height:100%;\n  width:100%; \n  background: rgba(0,0,0,0.7);\n  z-index: 1;\n}\n.show-json #show-json, .show-json #mask {\n  display:block;\n}\n#show-json {\n  position: absolute;\n  left: 50%;\n  margin: 0 0 0 -350px;\n  border: solid 4px #ccc;\n  padding: 10px 20px;\n  background: #fff;\n  text-align: center;\n  float: left;  \n  z-index: 2;\n}\nH3 {\n  font-size: 18px;\n  margin: 0 0 10px 0;\n}\n#show-json TEXTAREA {\n  width: 750px;\n  height: 400px;\n  overflow:visible;\n  display: block;\n}\n#show-json BUTTON {\n  margin: 10px 0 0 0;\n  padding: 5px 10px;\n  clear: left;\n}\n</style>\n\n</head>\n<body>\n\n<div id="mask"></div>\n\n<h1>Snapshot of <i></i> generated by <a href="http://www.servicestack.net">ServiceStack</a> on <b>1/28/2024 5:26:48 PM</b></h1>\n\n<div id="lnks">\n  <a href="javascript:showJson()">view json datasource</a>\n  <b>from original url:</b>\n  <a href=""></a>\n  <b>in other formats:</b>\n  <a href="format=json">json</a>\n  <a href="format=xml">xml</a>\n  <a href="format=csv">csv</a>\n  <a href="format=jsv">jsv</a>\n</div>\n\n<div id="body">\n  \n  <div id="show-json">\n    <h3>This reports json data source</h3>\n    <textarea></textarea>\n    <button onclick="doc.body.className=null;">Close Window</button>\n  </div>\n  \n  <div id="content"></div>\n\n</div>\n\n<script>    !window.JSON && document.write(unescape(\'%3Cscript src="http://ajax.cdnjs.com/ajax/libs/json2/20110223/json2.js"%3E%3C/script%3E\'))</script>\n\n<script type="text/javascript">\n// <![CDATA[\n\nvar doc = document, win = window,\n    $ = function(id) { return doc.getElementById(id); },\n    $$ = function(sel) { return doc.getElementsByTagName(sel); },\n    $each = function(fn) { for (var i=0,len=this.length; i<len; i++) fn(i, this[i], this); };\n\n$.each = function(arr, fn) { $each.call(arr, fn); };\n\nvar splitCase = function(t) { return typeof t != \'string\' ? t : t.replace(/([A-Z]|[0-9]+)/g, \' $1\'); },\n    uniqueKeys = function(m){ var h={}; for (var i=0,len=m.length; i<len; i++) for (var k in m[i]) if (show(k)) h[k] = k; return h; },\n    keys = function(o){ var a=[]; for (var k in o) if (show(k)) a.push(k); return a; }\nvar tbls = [];\n\nfunction val(m) {\n  if (m == null) return \'\';\n  if (typeof m == \'number\') return num(m);\n  if (typeof m == \'string\') return str(m);\n  if (typeof m == \'boolean\') return m ? \'true\' : \'false\';\n  return m.length ? arr(m) : obj(m);\n}\nfunction num(m) { return m; }\nfunction strFact(showFullDate){\n\n  function shortDate(m){\n    return m.substr(0,6) == \'/Date(\' ? dmft(date(m)) : m;\n  }\n\n  function fullDate(m){\n    return m.substr(0,6) == \'/Date(\' ? dmfthm(date(m)) : m;\n  }\n  return showFullDate ? fullDate : shortDate;  \n}\nstr = strFact(location.hash.indexOf(\'show=\') != -1 && location.hash.indexOf(\'fulldates\') != -1);\nfunction date(s) { return new Date(parseFloat(/Date\\(([^)]+)\\)/.exec(s)[1])); }\nfunction pad(d) { return d < 10 ? \'0\'+d : d; }\nfunction dmft(d) { return d.getFullYear() + \'/\' + pad(d.getMonth() + 1) + \'/\' + pad(d.getDate()); }\nfunction dmfthm(d) { return d.getFullYear() + \'/\' + pad(d.getMonth() + 1) + \'/\' + pad(d.getDate()) + \' \' + pad(d.getHours()) + ":" + pad(d.getMinutes()); }\nfunction show(k) { return typeof k != \'string\' || k.substr(0,2) != \'__\'; }\nfunction obj(m) {\n  var sb = \'<dl>\';\n  for (var k in m) if (show(k)) sb += \'<dt class="ib">\' + splitCase(k) + \'</dt><dd>\' + val(m[k]) + \'</dd>\';\n  sb += \'</dl>\';\n  return sb;\n}\nfunction arr(m) {\n  if (typeof m[0] == \'string\' || typeof m[0] == \'number\') return m.join(\', \');\n  var id=tbls.length, h=uniqueKeys(m);\n  var sb = \'<table id="tbl-\' + id + \'"><caption></caption><thead><tr>\';\n  tbls.push(m);\n  var i=0;\n  for (var k in h) sb += \'<th id="h-\' + id + \'-\' + (i++) + \'"><b></b>\' + splitCase(k) + \'</th>\';\n  sb += \'</tr></thead><tbody>\' + makeRows(h,m) + \'</tbody></table>\';\n  return sb;\n}\n\nfunction makeRows(h,m) {\n  var sb = \'\';\n  for (var r=0,len=m.length; r<len; r++) {\n    sb += \'<tr>\';\n    var row = m[r];\n    for (var k in h) if (show(k)) sb += \'<td>\' + val(row[k]) + \'</td>\';\n    sb += \'</tr>\';\n  }  \n  return sb;\n}\n\nvar model = {"ResponseStatus":{"ErrorCode":"UnauthorizedAccessException","Message":"Unauthorized Request. Missing authentication token."}},\n    txt = $$(\'TEXTAREA\')[0],\n    isIE = /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);\n\n$("content").innerHTML = val(model);  \ntxt.innerHTML=JSON.stringify(model);\n\nfunction showJson(){ doc.body.className=\'show-json\'; txt.select(); txt.focus(); }\n\ndoc.onclick = function(e) {\n    e = e || window.event, el = e.target || e.srcElement, cls = el.className;\n    if (el.tagName == \'B\') el = el.parentNode;\n    if (el.tagName != \'TH\') return;\n    el.className = cls == \'asc\' ? \'desc\' : (cls == \'desc\' ? null : \'asc\');\n    $.each($$(\'TH\'), function(i,th){ if (th == el) return; th.className = null; });\n    clearSel();\n    var ids=el.id.split(\'-\'), tId=ids[1], cId=ids[2];\n\tif (!tbls[tId]) return;\n    var tbl=tbls[tId].slice(0), h=uniqueKeys(tbl), col=keys(h)[cId], tbody=el.parentNode.parentNode.nextSibling;\n    if (!el.className){ setTableBody(tbody, makeRows(h,tbls[tId])); return; }\n    var d=el.className==\'asc\'?1:-1;\n    tbl.sort(function(a,b){ return cmp(a[col],b[col]) * d; });\n    setTableBody(tbody, makeRows(h,tbl));\n}\n\nfunction setTableBody(tbody, html) {\n  if (!isIE) { tbody.innerHTML = html; return; }\n  var temp = tbody.ownerDocument.createElement(\'div\');\n  temp.innerHTML = \'<table>\' + html + \'</table>\';\n  tbody.parentNode.replaceChild(temp.firstChild.firstChild, tbody);\n}\n\nfunction clearSel() {\n  if (doc.selection && doc.selection.empty) doc.selection.empty();\n  else if(win.getSelection) {\n    var sel=win.getSelection();\n    if (sel && sel.removeAllRanges) sel.removeAllRanges();\n  }\n}\n\nfunction cmp(v1, v2){\n  var f1, f2, f1=parseFloat(v1), f2=parseFloat(v2);\n  if (!isNaN(f1) && !isNaN(f2)) v1=f1, v2=f2;\n  if (typeof v1 == \'string\' && v1.substr(0,6) == \'/Date(\') v1=date(v1), v2=date(v2);\n  if (v1 == v2) return 0;\n  return v1 > v2 ? 1 : -1;\n}\n\n// ]]>\n</script>\n</body>\n</html>'
[2024-01-28 11:26:48,483] DEBUG {cps.kobo:106} StatusCode: 401
[2024-01-28 11:26:48,483] ERROR {cps.kobo:321} Failed to receive or parse response from Kobo's sync endpoint: Expecting value: line 1 column 1 (char 0)
[2024-01-28 11:28:06,119]  INFO {cps.ub:911} 7 sync entries deleted
[2024-01-28 11:28:11,655] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:28:11,727] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:28:11,799] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:28:11,874] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:28:11,956] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:28:12,071] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:28:18,975] DEBUG {cps.helper:980} unrar version 6.24
[2024-01-28 11:28:18,988] DEBUG {cps.config_sql:376} _ConfigSQL updating storage
[2024-01-28 11:28:18,997]  WARN {cps.config_sql:352} Log path  not valid, falling back to default
[2024-01-28 11:29:43,562] DEBUG {cps.helper:980} unrar version 6.24
[2024-01-28 11:29:43,566] DEBUG {cps.config_sql:376} _ConfigSQL updating storage
[2024-01-28 11:29:43,575]  WARN {cps.config_sql:352} Log path  not valid, falling back to default
[2024-01-28 11:30:07,284] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:30:07,360] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:30:07,427] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:30:07,501] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:30:07,582] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:30:07,697] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:31:17,641]  INFO {cps.ub:911} successfully deleted Shelf Kobo Sync
[2024-01-28 11:31:29,794]  INFO {cps.shelf:347} Shelf Kobo created
[2024-01-28 11:31:41,079]  INFO {cps.ub:911} 0 sync entries deleted
[2024-01-28 11:31:45,498] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:31:45,577] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:31:45,657] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:31:45,738] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:31:45,827] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:31:45,927] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:31:53,587] DEBUG {cps.updater:323} Nightly version: c2267b690293bc3932dc2588df1d907a7d365f28, 2024-01-22T13:17:27+01:00
[2024-01-28 11:32:00,118] DEBUG {cps.helper:980} unrar version 6.24
[2024-01-28 11:32:00,120] DEBUG {cps.config_sql:376} _ConfigSQL updating storage
[2024-01-28 11:32:00,125]  WARN {cps.config_sql:352} Log path  not valid, falling back to default
[2024-01-28 11:32:02,632] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:32:02,704] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:32:02,779] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:32:02,884] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:32:02,954] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:32:03,033] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:34:55,827] DEBUG {cps.helper:980} unrar version 6.24
[2024-01-28 11:34:55,828] DEBUG {cps.config_sql:376} _ConfigSQL updating storage
[2024-01-28 11:34:55,833]  WARN {cps.config_sql:352} Log path  not valid, falling back to default
[2024-01-28 11:35:15,553] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:35:15,647] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:35:15,757] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:35:15,828] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:35:15,914] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:35:16,037] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:35:20,924] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:35:21,017] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:35:21,098] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:35:21,187] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:35:21,264] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:35:21,350] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:35:29,344] DEBUG {cps.helper:980} unrar version 6.24
[2024-01-28 11:35:29,348] DEBUG {cps.config_sql:376} _ConfigSQL updating storage
[2024-01-28 11:35:29,355]  WARN {cps.config_sql:352} Log path  not valid, falling back to default
[2024-01-28 11:36:08,080] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:36:08,192] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:36:08,310] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:36:08,430] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:36:08,551] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'
[2024-01-28 11:36:08,711] DEBUG {cps.babel:26} Could not parse locale "*": expected only letters, got '*'

Environment (please complete the following information):

 - OS: Ubuntu
 - Python version: 3.10.12
 - Calibre-Web version: 0.6.21
 - Docker container: lscr.io/linuxserver/calibre-web:latest
 - Browser: Chrome
@YasserAntonio
Copy link

same issue

@MReschenberg
Copy link

I'm having this issue as well

@mekanics
Copy link

mekanics commented Jun 4, 2024

I had that issue as well.

After rebooting my Kobo, everything worked like a charm...

@BorisAnthony
Copy link

Same, thought without any nginx or special local network setup, just straight to my laptop's IP (for now until I actually get this work).
Factory reset device (Kobo Libra 2). Followed all steps carefully.
Nada. Including after reboot.

@YasserAntonio
Copy link

Try to turn on the dev mode in kobo. It worked for me: https://goodereader.com/blog/kobo-ereader-news/how-to-access-the-secret-kobo-developer-options

@BorisAnthony
Copy link

DevMode enambled (still fails)
Checked in calibre-web logs and found in the access log:

[2024-06-12 11:17:47,019] 200 GET /kobo/TOKEN/v1/initialization (192.168.178.38) 266.29ms
[2024-06-12 11:17:47,091] 307 GET /kobo/TOKEN/v1/user/profile (192.168.178.38) 7.16ms
[2024-06-12 11:17:47,755] 307 GET /kobo/TOKEN/v1/user/loyalty/benefits (192.168.178.38) 3.84ms
[2024-06-12 11:17:48,167] 307 GET /kobo/TOKEN/v1/deals (192.168.178.38) 6.00ms
[2024-06-12 11:17:48,943] 200 POST /kobo/TOKEN/v1/analytics/gettests (192.168.178.38) 373.09ms
[2024-06-12 11:17:49,154] 500 GET /kobo/TOKEN/v1/library/sync?Filter=ALL&DownloadUrlFilter=Generic,Android&PrioritizeRecentReads=true (192.168.178.38) 78.28ms

Accessing that last one from my laptop browser returned this error (in a web page, not raw)

Traceback (most recent call last):
File "/path/CalibreWeb/venv/lib/python3.12/site-packages/flask/app.py", line 2190, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/CalibreWeb/venv/lib/python3.12/site-packages/flask/app.py", line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/CalibreWeb/venv/lib/python3.12/site-packages/flask/app.py", line 1484, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/path/CalibreWeb/venv/lib/python3.12/site-packages/flask/app.py", line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/CalibreWeb/venv/lib/python3.12/site-packages/calibreweb/cps/kobo_auth.py", line 168, in inner
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/path/CalibreWeb/venv/lib/python3.12/site-packages/calibreweb/cps/web.py", line 122, in inner
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/path/CalibreWeb/venv/lib/python3.12/site-packages/calibreweb/cps/kobo.py", line 213, in HandleSyncRequest
"BookMetadata": get_metadata(book.Books),
^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/CalibreWeb/venv/lib/python3.12/site-packages/calibreweb/cps/kobo.py", line 475, in get_metadata
"Language": get_language(book),
^^^^^^^^^^^^^^^^^^
File "/path/CalibreWeb/venv/lib/python3.12/site-packages/calibreweb/cps/kobo.py", line 430, in get_language
return isoLanguages.get(part3=book.languages[0].lang_code).part1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/path/CalibreWeb/venv/lib/python3.12/site-packages/iso639/iso639.py", line 265, in get
return getattr(self, key)[value]
^^^^^^^^^^^^^^^^^^
File "/path/CalibreWeb/venv/lib/python3.12/site-packages/iso639/iso639.py", line 105, in __get__
val = self.f(instance)
^^^^^^^^^^^^^^^^
File "/path/CalibreWeb/venv/lib/python3.12/site-packages/iso639/iso639.py", line 186, in part3
return dict((x.part3, x) for x in self.languages if x.part3)
^^^^^^^^^^^^^^
File "/path/CalibreWeb/venv/lib/python3.12/site-packages/iso639/iso639.py", line 105, in __get__
val = self.f(instance)
^^^^^^^^^^^^^^^^
File "/path/CalibreWeb/venv/lib/python3.12/site-packages/iso639/iso639.py", line 174, in languages
l, i, m, p5, p2, p1 = _fabtabular()
^^^^^^^^^^^^^
File "/path/CalibreWeb/venv/lib/python3.12/site-packages/iso639/iso639.py", line 20, in _fabtabular
from pkg_resources import resource_filename
ModuleNotFoundError: No module named 'pkg_resources'

I tried accessing the others which were getting proxied to Kobo, and failing authentication (I guess because CalibreWeb proxy strips the auth credentials or whatever). Disabled "Proxy unknown requests to Kobo Store" and still no love.

@BorisAnthony
Copy link

So based on the above error, in kobo.py, I "hacked" that book lang function to just return "en" (for now).
This seems to have "fixed" that issue and we can continue...

I increased the book limit to 1000 (770 kepub books)

Restarted calibre-web.

"Force full kobo sync" (this is important if one hits the api endpoint in a webbrowser because that's faking it and calibre-web thinks it's synched)

Now, for the first time, the sync didn't just fail right away. It ran "checking for updates" for about 2 minutes, then failed with "no internet" (which is … odd… wifi icon indicates it is up).
Calibre-web thinks it's synched:

[2024-06-12 11:55:26,560] DEBUG {cps.kobo:209} Books to Sync: 770
[2024-06-12 11:55:28,954] DEBUG {cps.kobo:267} Remaining books to Sync: 0

But there's nothing on the device.

I then tried using the "sync only this shelf" feature with one book. This worked flawlessly. Great!
But I want the the whole library sync :)

So, disabled the shelf feature again.
"Force kobo full sync"
On Kobo, developer settings, force Wifi to stay on…
(because I am guessing the network times out trying to transfer a Gig+ of files?)
… and no love. Calibre-web thinks it sync'ed but nothing got transfered.

I was going to try adding all books to a shelf and syncing that but I can't find a way to do that in a bulk action.

@BorisAnthony
Copy link

BorisAnthony commented Jun 12, 2024

Ok for completeness, I tried with a library of only 90 books and it worked.
So in my case:

  1. one or more of my books has a "language" issue which causes an error with the "iso639" package used by Calibre-web. This is a separate bug in itself.
  2. Known "large library" Kobo sync and large libraries #1276 issue I guess.

So I continued.

  • Context: I installed this via the python venv + pip route. Unclearly documented steps included having to manually run pip install -r for the requirements (after running pip install calibre-web kobo, which itself is incorrectly documented saying you must use the [] brackets, which fails)
  • After re-reading the "large library" issue, I diff'ed the kobo.py in the repo against the one that got installed here and found just some very minor seeming differences. However copying it over, restarting etc actually fixed the issue and now I have a full library sync.

I will try to file an issue for the book language error I got.

@OzzieIsaacs
Copy link
Collaborator

Regarding "Context" section: You need to install calibre-web with pip install calibreweb[kobo] without spaces between calibreweb and the "[", this is correct in the wiki. If you add a space it fails. Using pip install calibreweb kobo installs another package called "kobo", missing the needed parts for kobo sync in calibre-web, which results in having to manually install pip install -r optional-requirements.txt

The language error should be fixed now, so I'll close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants