rdkit / mmpdb

A package to identify matched molecular pairs and use them to predict property changes.
Other
197 stars 55 forks source link

Error of "sqlite3.OperationalError: database is locked" #60

Closed chengthefang closed 2 months ago

chengthefang commented 2 months ago

Hi all,

I was trying to use the mmpdb version 3 for the fragmentation. However, I came across an error when implementing it on Linux:

The code I ran is mmpdb fragment test_data.smi -o test_data.fragdb

The error is: `Failed to execute the following SQL: -- Version 3.0 switched to a SQLite database to store the fragments. -- Earlier versions used JSON-Lines. -- The SQLite database improves I/O time, reduces memory use, and -- simplifies the development of fragment analysis tools.

-- NOTE: There is configuration information in three files! -- 1) fragment_types.py -- the data types -- 2) fragment_schema.sql -- (this file) defines the SQL schema -- 3) fragment_db.py -- defines the mapping from SQL to the data types

CREATE TABLE options ( id INTEGER NOT NULL, version INTEGER, cut_smarts VARCHAR(1000), max_heavies INTEGER, max_rotatable_bonds INTEGER, method VARCHAR(20), num_cuts INTEGER, rotatable_smarts VARCHAR(1000), salt_remover VARCHAR(200), min_heavies_per_const_frag INTEGER, min_heavies_total_const_frag INTEGER, max_up_enumerations INTEGER, PRIMARY KEY (id) ); Traceback (most recent call last): File "/miniconda3/envs/mmpdb31/bin/mmpdb", line 8, in sys.exit(main()) File "/.local/lib/python3.9/site-packages/click/core.py", line 1130, in call return self.main(args, kwargs) File "/.local/lib/python3.9/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/.local/lib/python3.9/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/.local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "/.local/lib/python3.9/site-packages/click/core.py", line 760, in invoke return __callback(args, kwargs) File "/miniconda3/envs/mmpdb31/lib/python3.9/site-packages/mmpdblib/cli/fragment_click.py", line 215, in make_fragment_options_wrapper return command(kwargs) File "/miniconda3/envs/mmpdb31/lib/python3.9/site-packages/mmpdblib/cli/smi_utils.py", line 98, in make_input_options_wrapper return command(*kwargs) File "/.local/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), args, **kwargs) File "/miniconda3/envs/mmpdb31/lib/python3.9/site-packages/mmpdblib/cli/fragment.py", line 256, in fragment with fragment_db.open_fragment_writer( File "/miniconda3/envs/mmpdb31/lib/python3.9/site-packages/mmpdblib/fragment_db.py", line 372, in open_fragment_writer init_fragdb(c, options) File "/miniconda3/envs/mmpdb31/lib/python3.9/site-packages/mmpdblib/fragment_db.py", line 92, in init_fragdb schema._execute_sql(c, get_schema_template()) File "/miniconda3/envs/mmpdb31/lib/python3.9/site-packages/mmpdblib/schema.py", line 129, in _execute_sql c.execute(statement) sqlite3.OperationalError: database is locked`

It probably has nothing to do with the MMPDB-v3 program since it is running fine on my Mac. If anyone has some advice/suggestions on how to solve it, it would be highly appreciated.

Thanks, Cheng

chengthefang commented 2 months ago

I figured out it was my Linux system error. It works when I changed the file location. Let me close the ticket