Skip to content

Error writing the sqlite database file #172

@ganapatinatarajan

Description

@ganapatinatarajan

I am using ubuntu 18.04 on Windows subsystem for linux/python 2.7 and sqlalchemy 0.7.
I am running the example on 17 atom LJ system:
from pele.systems import LJCluster
natoms=17
system=LJCluster(natoms)
database=system.create_database('lj17.sqlite')
bh=system.get_basinhopping(database)
bh.run(10)

Doing this writes an empty database file and gives the error below:
traceback (most recent call last):
File "bh.py", line 4, in
database=system.create_database('lj17.sqlite')
File "/home/gn203/.local/lib/python2.7/site-
packages/pele/systems/basesystem.py", line 234, in create_database
db = Database(**kwargs)
File "/home/gn203/.local/lib/python2.7/site-packages/pele/storage/database.py", line 432, in init
self._check_schema_version()
File "/home/gn203/.local/lib/python2.7/site-packages/pele/storage/database.py", line 477, in _check_schema_version
"%d (%d). Please use migrate_db.py in pele/scripts to update database"%(schema, _schema_version))
IOError: database schema outdated, current (newest) version: 0 (2). Please use migrate_db.py

Running migrate_db.py on the empty lj17.sqlite error file generates a further error:

current version: 0
newest version: 2
migrating from database version 0 to 1
Traceback (most recent call last):
File "/home/gn203/pkg/pele-master/scripts/migrate_db.py", line 63, in
migrate(dbfile)
File "/home/gn203/pkg/pele-master/scripts/migrate_db.py", line 47, in migrate
schema = migrate_script[schema](connection, schema)
File "/home/gn203/pkg/pele-master/scripts/migrate_db.py", line 13, in from_0_to_1
connection.execute("ALTER TABLE tbl_minima ADD fvib FLOAT;")
File "/home/gn203/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1294, in execute
params)
File "/home/gn203/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1471, in _execute_text
statement, parameters
File "/home/gn203/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1535, in _execute_context
context)
File "/home/gn203/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1528, in _execute_context
context)
File "/home/gn203/.local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 325, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (OperationalError) no such table: tbl_minima 'ALTER TABLE tbl_minima ADD fvib FLOAT;' ()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions