Fails to load sqlite_extension, bails out

Bug #1935747 reported by Guido Falsi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Invalid
Undecided
Unassigned

Bug Description

I'm the maintainer of the FreeBSD calibre port.

I'm testing update of the port to 5.23.0. When I try to run calibre I get this error:

calibre, version 5.23.0
ERROR: Bad database location: Bad database location '###'. calibre will now quit.

Traceback (most recent call last):
  File "/usr/local/lib/calibre/calibre/gui2/main.py", line 304, in initialize_db_stage2
    db = LibraryDatabase(candidate)
  File "/usr/local/lib/calibre/calibre/db/legacy.py", line 188, in __init__
    backend = self.backend = create_backend(library_path, default_prefs=default_prefs,
  File "/usr/local/lib/calibre/calibre/db/legacy.py", line 45, in create_backend
    return DB(library_path, default_prefs=default_prefs,
  File "/usr/local/lib/calibre/calibre/db/backend.py", line 463, in __init__
    if self.user_version == 0:
  File "/usr/local/lib/calibre/calibre/db/backend.py", line 1214, in user_version
    return self.conn.get('pragma user_version;', all=False)
  File "/usr/local/lib/calibre/calibre/db/backend.py", line 927, in conn
    self._conn = Connection(self.dbpath)
  File "/usr/local/lib/calibre/calibre/db/backend.py", line 342, in __init__
    plugins.load_apsw_extension(self, 'sqlite_extension')
  File "/usr/local/lib/calibre/calibre/constants.py", line 325, in load_apsw_extension
    conn.enableloadextension(True)
AttributeError: 'Connection' object has no attribute 'enableloadextension'

Looks like the Connection object is not bein gproperly initialized, I took a lok at the code but I can't really understand why.

The recent changes in src/calibre/db/backend.py:342 seem to be the cause, but I am unable to find a fix.

Thanks in advance.

Guido Falsi (madpilot78)
summary: - Fails to load sqlite_extension, bailss out
+ Fails to load sqlite_extension, bails out
Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1935747

See the line
AttributeError: 'Connection' object has no attribute 'enableloadextension'

you need to build apsw with sqlite extension loading enabled.

 status invalid

Changed in calibre:
status: New → Invalid
Revision history for this message
Guido Falsi (madpilot78) wrote :

Thanks a lot for pointing me in the right direction. It would have taken me some time to find out this.

I'll see if the default can be switched for python apsw in the FreeBSD ports tree.

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.