Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query fails due to SQLITE_BUSY error #395

Closed
dappelt opened this issue Jan 23, 2017 · 3 comments
Closed

Query fails due to SQLITE_BUSY error #395

dappelt opened this issue Jan 23, 2017 · 3 comments

Comments

@dappelt
Copy link

dappelt commented Jan 23, 2017

If the ILP kit is running with sqlite, sometimes a SQL query of the ledger fails (full log here):

ilp-kit[Wallet1] [ledger] 2017-01-23T10:26:22.426Z ledger:error-handler error { Error: update "L_TRANSFERS" set "EXECUTION_CONDITION" = 'cc:0:3:huknQrkt5DT-MI0hJf3b_xZhoDl5KT-07BFzWzaAuf0:32', "EXPIRES_DTTM" = '2017-01-23 11:26:32.348', "LEDGER" = 'https://wallet1.example/ledger', "PREPARED_DTTM" = '2017-01-23 11:26:22.374', "PROPOSED_DTTM" = '2017-01-23 11:26:22.362', "STATUS_ID" = 1, "TRANSFER_UUID" = '59c1c239-f6eb-4369-88c6-b657794cb1c3' where "TRANSFER_UUID" = '59c1c239-f6eb-4369-88c6-b657794cb1c3' - SQLITE_BUSY: database is locked
ilp-kit[Wallet1] [ledger]     at Error (native) errno: 5, code: 'SQLITE_BUSY' }
ilp-kit[Wallet1] [ledger] 2017-01-23T10:26:22.428Z ledger:error-handler error Error: update "L_TRANSFERS" set "EXECUTION_CONDITION" = 'cc:0:3:huknQrkt5DT-MI0hJf3b_xZhoDl5KT-07BFzWzaAuf0:32', "EXPIRES_DTTM" = '2017-01-23 11:26:32.348', "LEDGER" = 'https://wallet1.example/ledger', "PREPARED_DTTM" = '2017-01-23 11:26:22.374', "PROPOSED_DTTM" = '2017-01-23 11:26:22.362', "STATUS_ID" = 1, "TRANSFER_UUID" = '59c1c239-f6eb-4369-88c6-b657794cb1c3' where "TRANSFER_UUID" = '59c1c239-f6eb-4369-88c6-b657794cb1c3' - SQLITE_BUSY: database is locked
ilp-kit[Wallet1] [ledger]     at Error (native)

ILP kit, plugin-virtual, and ledger both use the same database. This error seems to happen if two processes try to modify the database at the same time.

@dappelt
Copy link
Author

dappelt commented Mar 14, 2017

It turns out that sqlite does not support concurrent access to a database. Therefore, we should drop support for sqlite in ILP kit for production environments.

@dappelt dappelt closed this as completed Mar 14, 2017
@justmoon
Copy link
Contributor

@dappelt

We already don't support it for production environments. I forget the exact reason, but I remember us concluding that SQLite would not be safe to use outside of testing and development. That's why we don't have migrations for SQLite, only for Postgres - for SQLite you just have to reset the DB when you upgrade.

I'd say it's time to consider dropping all support for SQLite.

@dappelt
Copy link
Author

dappelt commented Mar 14, 2017

I'd say it's time to consider dropping all support for SQLite.

Fine with me. Let me know if this decision is final. I am currently adding support for postgres in five-bells-service-manager. So the integration tests do not require sqlite anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants