Calibre will not start up

Bug #2011586 reported by Tony Costo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

I'm not sure this is a bug, however My Calibre library is over 60,000 books. I'm running version 6.04. When I start it up I get an error with this error message:

 "raceback (most recent call last):
  File "calibre\gui2\ui.py", line 868, in library_moved
  File "calibre\db\legacy.py", line 199, in __init__
  File "calibre\db\cache.py", line 179, in __init__
  File "calibre\db\cache.py", line 446, in initialize_fts
  File "calibre\db\cache.py", line 457, in start_fts_pool
  File "calibre\db\cache.py", line 77, in call_func_with_lock
  File "calibre\db\cache.py", line 570, in queue_next_fts_job
  File "calibre\db\cache.py", line 472, in _update_fts_indexing_numbers
  File "calibre\db\fts\connect.py", line 70, in number_dirtied
  File "calibre\db\fts\connect.py", line 59, in get_connection
  File "calibre\db\fts\connect.py", line 42, in initialize
  File "calibre\db\backend.py", line 393, in execute
apsw.SQLError: SQLError: near "s": syntax error

I've tried the Calibre restore process twice now, each ran 30+ hours and I get the same error. Is there a way to force Calibre to start up so I can manually go in and delete the book(s) causing the problem? I'm dead in the water here and I could use some help. feel free to email me directly at <email address hidden>. Thanks.

Tony Costo

Revision history for this message
Kovid Goyal (kovid) wrote :

Make sure calibre is shutdown. Then open the calibre library folder and
delete the full-text-search.db and then start calibre.

Changed in calibre:
status: New → Fix Released
Revision history for this message
Tony Costo (alc4ever) wrote : Re: [Bug 2011586] Re: Calibre will not start up

 I deleted that file. I get the same error when I try to start up that Calibre library -

Traceback (most recent call last): File "calibre\gui2\ui.py", line 868, in library_moved File "calibre\db\legacy.py", line 199, in __init__ File "calibre\db\cache.py", line 179, in __init__ File "calibre\db\cache.py", line 446, in initialize_fts File "calibre\db\cache.py", line 457, in start_fts_pool File "calibre\db\cache.py", line 77, in call_func_with_lock File "calibre\db\cache.py", line 570, in queue_next_fts_job File "calibre\db\cache.py", line 472, in _update_fts_indexing_numbers File "calibre\db\fts\connect.py", line 70, in number_dirtied File "calibre\db\fts\connect.py", line 59, in get_connection File "calibre\db\fts\connect.py", line 42, in initialize File "calibre\db\backend.py", line 393, in executeapsw.SQLError: SQLError: near "s": syntax error
What would you recommend now?

full-text-search.db

-----Original Message-----
From: Kovid Goyal <email address hidden>
To: <email address hidden>
Sent: Tue, Mar 14, 2023 10:15 am
Subject: [Bug 2011586] Re: Calibre will not start up

Make sure calibre is shutdown. Then open the calibre library folder and
delete the full-text-search.db and then start calibre.

** Changed in: calibre
      Status: New => Fix Released

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/2011586

Title:
  Calibre will not start up

Status in calibre:
  Fix Released

Bug description:
  I'm not sure this is a bug, however My Calibre library is over 60,000
  books. I'm running version 6.04. When I start it up I get an  error
  with this error message:

  "raceback (most recent call last):
    File "calibre\gui2\ui.py", line 868, in library_moved
    File "calibre\db\legacy.py", line 199, in __init__
    File "calibre\db\cache.py", line 179, in __init__
    File "calibre\db\cache.py", line 446, in initialize_fts
    File "calibre\db\cache.py", line 457, in start_fts_pool
    File "calibre\db\cache.py", line 77, in call_func_with_lock
    File "calibre\db\cache.py", line 570, in queue_next_fts_job
    File "calibre\db\cache.py", line 472, in _update_fts_indexing_numbers
    File "calibre\db\fts\connect.py", line 70, in number_dirtied
    File "calibre\db\fts\connect.py", line 59, in get_connection
    File "calibre\db\fts\connect.py", line 42, in initialize
    File "calibre\db\backend.py", line 393, in execute
  apsw.SQLError: SQLError: near "s": syntax error

  I've tried the Calibre restore process twice now, each ran 30+ hours
  and I get the same error. Is there a way to force Calibre to start up
  so I can manually go in and delete the book(s) causing the problem?
  I'm dead in the water here and I could use some help. feel free to
  email me directly at <email address hidden>. Thanks.

  Tony Costo

To manage notifications about this bug go to:
https://bugs.launchpad.net/calibre/+bug/2011586/+subscriptions

Revision history for this message
Tony Costo (alc4ever) wrote :

Calibre is not active on my system. I located and deleted the file you said to delete. I then tried to start up that calibre Library and get the same error -

Traceback (most recent call last):
  File "calibre\gui2\ui.py", line 868, in library_moved
  File "calibre\db\legacy.py", line 199, in __init__
  File "calibre\db\cache.py", line 179, in __init__
  File "calibre\db\cache.py", line 446, in initialize_fts
  File "calibre\db\cache.py", line 457, in start_fts_pool
  File "calibre\db\cache.py", line 77, in call_func_with_lock
  File "calibre\db\cache.py", line 570, in queue_next_fts_job
  File "calibre\db\cache.py", line 472, in _update_fts_indexing_numbers
  File "calibre\db\fts\connect.py", line 70, in number_dirtied
  File "calibre\db\fts\connect.py", line 59, in get_connection
  File "calibre\db\fts\connect.py", line 42, in initialize
  File "calibre\db\backend.py", line 393, in execute
apsw.SQLError: SQLError: near "s": syntax error

It's this Library that is having the issue. I do have a couple of small special libraries that come up just fine. What should I try next?

Revision history for this message
Kovid Goyal (kovid) wrote :

Run
calibre-debug -c "from calibre.library import db; db = db(); db.new_api.set_pref('fts_enabled', False)"

in a command prompt and you should be fine

Revision history for this message
Kovid Goyal (kovid) wrote :

Note that the command to run is one single line

Revision history for this message
Tony Costo (alc4ever) wrote :

Sorry, but I'm not really PC savvy. I know how to get a command prompt. The library in question is Tony's Library. So should the command be:

Run
calibre-debug -c "from 'Tony's.library' import db; db = db(); db.new_api.set_pref('fts_enabled', False)"

Revision history for this message
Kovid Goyal (kovid) wrote :

No just copy paste exactly what I wrote

Revision history for this message
Tony Costo (alc4ever) wrote :
Download full text (5.2 KiB)

I ran the command you wrote. Here's the result

Microsoft Windows [Version 10.0.19044.2604]
(c) Microsoft Corporation. All rights reserved.

C:\Users\alc4e>Run
'Run' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\alc4e>calibre-debug -c "from calibre.library import db; db = db(); db.new_api.set_pref('fts_enabled', False)"
Failed to initialize plugin: 'C:\\Users\\alc4e\\AppData\\Roaming\\calibre\\plugins\\Beam Ebooks.zip'
Traceback (most recent call last):
  File "calibre\customize\ui.py", line 777, in initialize_plugins
  File "calibre\customize\ui.py", line 64, in load_plugin
  File "calibre\customize\zipplugin.py", line 307, in load
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "calibre\customize\zipplugin.py", line 206, in exec_module
  File "calibre_plugins.beam_ebooks_metadata.__init__", line 12, in <module>
ImportError: cannot import name 'quote' from 'urllib' (C:\Program Files\Calibre2\app\bin\python-lib.bypy.frozen\urllib\__init__.pyc)
Failed to initialize plugin: 'C:\\Users\\alc4e\\AppData\\Roaming\\calibre\\plugins\\Read MP3 AudioBook metadata.zip'
Traceback (most recent call last):
  File "calibre\customize\ui.py", line 777, in initialize_plugins
  File "calibre\customize\ui.py", line 64, in load_plugin
  File "calibre\customize\zipplugin.py", line 307, in load
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "calibre\customize\zipplugin.py", line 206, in exec_module
  File "calibre_plugins.audiobookmetadatareader.__init__", line 8, in <module>
ModuleNotFoundError: No module named 'common'

C:\Users\alc4e>
C:\Users\alc4e>
Trying to switch from a small library to my main one (Tony's Library) still fails with:
Traceback (most recent call last): File "calibre\gui2\ui.py", line 868, in library_moved File "calibre\db\legacy.py", line 199, in __init__ File "calibre\db\cache.py", line 179, in __init__ File "calibre\db\cache.py", line 446, in initialize_fts File "calibre\db\cache.py", line 457, in start_fts_pool File "calibre\db\cache.py", line 77, in call_func_with_lock File "calibre\db\cache.py", line 570, in queue_next_fts_job File "calibre\db\cache.py", line 472, in _update_fts_indexing_numbers File "calibre\db\fts\connect.py", line 70, in number_dirtied File "calibre\db\fts\connect.py", line 59, in get_connection File "calibre\db\fts\connect.py", line 42, in initialize File "calibre\db\backend.py", line 393, in executeapsw.SQLError: SQLError: near "s": syntax error

...

Read more...

Revision history for this message
Kovid Goyal (kovid) wrote :

Ah that's because your current library is not the main one. Do this
instead

calibre-debug -c "from calibre.library import db; db = db('c:/the/full/path/to/your/problem/library/folder'); db.new_api.set_pref('fts_enabled', False)"

replace the full path to your problem librayr folder with the actual
path

Revision history for this message
Tony Costo (alc4ever) wrote :

Thank You. I will try that later this afternoon. Unfortunately I have appointments scheduled this morning that I need to attend.

-----Original Message-----
From: Kovid Goyal <email address hidden>
To: <email address hidden>
Sent: Wed, Mar 15, 2023 12:01 am
Subject: [Bug 2011586] Re: Calibre will not start up

Ah that's because your current library is not the main one. Do this
instead

calibre-debug -c "from calibre.library import db; db =
db('c:/the/full/path/to/your/problem/library/folder');
db.new_api.set_pref('fts_enabled', False)"

replace the full path to your problem librayr folder with the actual
path

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/2011586

Title:
  Calibre will not start up

Status in calibre:
  Fix Released

Bug description:
  I'm not sure this is a bug, however My Calibre library is over 60,000
  books. I'm running version 6.04. When I start it up I get an  error
  with this error message:

  "raceback (most recent call last):
    File "calibre\gui2\ui.py", line 868, in library_moved
    File "calibre\db\legacy.py", line 199, in __init__
    File "calibre\db\cache.py", line 179, in __init__
    File "calibre\db\cache.py", line 446, in initialize_fts
    File "calibre\db\cache.py", line 457, in start_fts_pool
    File "calibre\db\cache.py", line 77, in call_func_with_lock
    File "calibre\db\cache.py", line 570, in queue_next_fts_job
    File "calibre\db\cache.py", line 472, in _update_fts_indexing_numbers
    File "calibre\db\fts\connect.py", line 70, in number_dirtied
    File "calibre\db\fts\connect.py", line 59, in get_connection
    File "calibre\db\fts\connect.py", line 42, in initialize
    File "calibre\db\backend.py", line 393, in execute
  apsw.SQLError: SQLError: near "s": syntax error

  I've tried the Calibre restore process twice now, each ran 30+ hours
  and I get the same error. Is there a way to force Calibre to start up
  so I can manually go in and delete the book(s) causing the problem?
  I'm dead in the water here and I could use some help. feel free to
  email me directly at <email address hidden>. Thanks.

  Tony Costo

To manage notifications about this bug go to:
https://bugs.launchpad.net/calibre/+bug/2011586/+subscriptions

Revision history for this message
Tony Costo (alc4ever) wrote :

 I'm back. However one of my appointments was the 1st of 3 Eye Doctor exams. The drops they put in my eyes, I can hardly see the monitor. My Calibre libraries  are on my E drive, in folder Calirbe Libraries, member Tony's Library. Again. I am not very PC savvy. So could you please update your command with this information? Thanks
Tony Costo

-----Original Message-----
From: Kovid Goyal <email address hidden>
To: <email address hidden>
Sent: Wed, Mar 15, 2023 12:01 am
Subject: [Bug 2011586] Re: Calibre will not start up

Ah that's because your current library is not the main one. Do this
instead

calibre-debug -c "from calibre.library import db; db =
db('c:/the/full/path/to/your/problem/library/folder');
db.new_api.set_pref('fts_enabled', False)"

replace the full path to your problem librayr folder with the actual
path

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/2011586

Title:
  Calibre will not start up

Status in calibre:
  Fix Released

Bug description:
  I'm not sure this is a bug, however My Calibre library is over 60,000
  books. I'm running version 6.04. When I start it up I get an  error
  with this error message:

  "raceback (most recent call last):
    File "calibre\gui2\ui.py", line 868, in library_moved
    File "calibre\db\legacy.py", line 199, in __init__
    File "calibre\db\cache.py", line 179, in __init__
    File "calibre\db\cache.py", line 446, in initialize_fts
    File "calibre\db\cache.py", line 457, in start_fts_pool
    File "calibre\db\cache.py", line 77, in call_func_with_lock
    File "calibre\db\cache.py", line 570, in queue_next_fts_job
    File "calibre\db\cache.py", line 472, in _update_fts_indexing_numbers
    File "calibre\db\fts\connect.py", line 70, in number_dirtied
    File "calibre\db\fts\connect.py", line 59, in get_connection
    File "calibre\db\fts\connect.py", line 42, in initialize
    File "calibre\db\backend.py", line 393, in execute
  apsw.SQLError: SQLError: near "s": syntax error

  I've tried the Calibre restore process twice now, each ran 30+ hours
  and I get the same error. Is there a way to force Calibre to start up
  so I can manually go in and delete the book(s) causing the problem?
  I'm dead in the water here and I could use some help. feel free to
  email me directly at <email address hidden>. Thanks.

  Tony Costo

To manage notifications about this bug go to:
https://bugs.launchpad.net/calibre/+bug/2011586/+subscriptions

Revision history for this message
Kovid Goyal (kovid) wrote :

Never mind, just update calibre to the newly released 6.14.1 and you
will be fine. This issue was caused by the combination of the apostrophe
in the library folder name and having FTS enabled and a change to how
library database paths were escaped in the calibre backend.

Revision history for this message
Tony Costo (alc4ever) wrote :

Thank You!!!  That corrected the issue. I think there is a problem in Calibre and multiple libraries. For the last couple of months I've encountered issues like this. If I updated and entry in one of my small libraries I started getting errors like this when I tried to switch back to my main one. Doing the "Recover" process corrected the issue. This time that process did not work. I can not prove this, it's just seems strange. I went out and bought a Back up Tool that I will start using. daily.

Again, Thank You for your help.

-----Original Message-----
From: Kovid Goyal <email address hidden>
To: <email address hidden>
Sent: Wed, Mar 15, 2023 10:55 pm
Subject: [Bug 2011586] Re: Calibre will not start up

Never mind, just update calibre to the newly released 6.14.1 and you
will be fine. This issue was caused by the combination of the apostrophe
in the library folder name and having FTS enabled and a change to how
library database paths were escaped in the calibre backend.

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/2011586

Title:
  Calibre will not start up

Status in calibre:
  Fix Released

Bug description:
  I'm not sure this is a bug, however My Calibre library is over 60,000
  books. I'm running version 6.04. When I start it up I get an  error
  with this error message:

  "raceback (most recent call last):
    File "calibre\gui2\ui.py", line 868, in library_moved
    File "calibre\db\legacy.py", line 199, in __init__
    File "calibre\db\cache.py", line 179, in __init__
    File "calibre\db\cache.py", line 446, in initialize_fts
    File "calibre\db\cache.py", line 457, in start_fts_pool
    File "calibre\db\cache.py", line 77, in call_func_with_lock
    File "calibre\db\cache.py", line 570, in queue_next_fts_job
    File "calibre\db\cache.py", line 472, in _update_fts_indexing_numbers
    File "calibre\db\fts\connect.py", line 70, in number_dirtied
    File "calibre\db\fts\connect.py", line 59, in get_connection
    File "calibre\db\fts\connect.py", line 42, in initialize
    File "calibre\db\backend.py", line 393, in execute
  apsw.SQLError: SQLError: near "s": syntax error

  I've tried the Calibre restore process twice now, each ran 30+ hours
  and I get the same error. Is there a way to force Calibre to start up
  so I can manually go in and delete the book(s) causing the problem?
  I'm dead in the water here and I could use some help. feel free to
  email me directly at <email address hidden>. Thanks.

  Tony Costo

To manage notifications about this bug go to:
https://bugs.launchpad.net/calibre/+bug/2011586/+subscriptions

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.