cblaster icon indicating copy to clipboard operation
cblaster copied to clipboard

sqlite3.OperationalError: unable to open database file, when building local database

Open INFINITY1993 opened this issue 1 year ago • 3 comments

Hi,

I am trying to create a local database but sqlite3 keeps showing this error.

This ts the log file: cblaster_makedb.14511790.4294967294.log

This is the code: cblaster makedb
--cpus 24
--name cmx_nob_genomes_db
AB588176.1.gbk

This is the working directory: 1733904397404

Please help me solve this issue! Big thanks!

INFINITY1993 avatar Dec 11 '24 08:12 INFINITY1993

As another thread mentioned, this might be a problem with your libsqlite. What version do you have installed?

Also, just a hint, but you don't need to use 24 cpus to build a database from one genome!!

drboothtj avatar Mar 19 '25 14:03 drboothtj

Hi!

So I did some more digging. The most reliable fix was to roll back to cblaster version 1.3.10. I'm not sure what was changed that broke the database creation in the recent versions but I will try and take a look.

FYI @gamcil

drboothtj avatar Mar 20 '25 09:03 drboothtj

So, I did a bit more digging with a colleague of mine and we discovered that this is a problem with genomicsqlite. Since, you don't actually need it to run cblaster (it will fallback to pythons default sqlite). So the easiest fix to use the current version is to use:

pip uninstall genomicsqlite

drboothtj avatar Mar 20 '25 12:03 drboothtj

I think this may have been fixed by https://github.com/gamcil/cblaster/pull/111 which explicitly forces sqlite transactions to be committed. I can reproduce the issue using the current v1.3.20 release, but not on the current master with that change. Otherwise, @drboothtj is correct that genomicsqlite is not necessary and cblaster will fall back to the default Python library if genomicsqlite is not found, so uninstalling it is also an option, but this can lead to another problem on the searching side since a database created with genomicsqlite cannot be used with the default sqlite library.

gamcil avatar Oct 22 '25 07:10 gamcil