A Calibre user of one of my plugins has been having an impossible time getting APSW to connect (ATTACH) to multiple Libraries sequentially. She uses OpenSUSE with btrfs, and has had no problems with Calibre until now with this very specific issue. APSW is spectacularly unhelpful as to why it gets an OpenError; debugging log shown nothing worthwhile.
The connection for attachment is supposed to look like this, but always throws an exception, OpenError, just after the "Attaching to New Source Library:" message, where the APSW SQL "ATTACH DATABASE 's:/calibre/calibrelibrarycodes/metadata.db' AS 'SOURCE' ;" is executed by APSW.
Code:
ATTACH DATABASE 's:/calibre/calibrelibrarycodes/metadata.db' AS 'SOURCE' ;
length of path: 42
Attaching to New Source Library: s:/calibre/calibrelibrarycodes/metadata.db
Now Attached to New Source Library: s:/calibre/calibrelibrarycodes/metadata.db
PRAGMA SOURCE.busy_timeout = 4000;
Finished: apsw_attach_to_source
So far, the closest random, odd issue might be found in:
https://btrfs.wiki.kernel.org/index.php/Gotchas regarding the Fragmentation of application databases. She is going to defrag her btrfs system and report back the results.
I don't use Linux except for my Raspberry Pi Manjaro/Arch Calibre server.
DaltonST