backstage: π Bug Report: Backend failed to start up SqliteError: database is locked
π Description
I try to use the sqlite database with a file and get this error:
[1] Backend failed to start up SqliteError: create table `backstage_backend_tasks__knex_migrations` (`id` integer not null primary key autoincrement, `name` varchar(255), `batch` integer, `migration_time` datetime) - database is locked
[1] at Client_BetterSQLite3._query (/Users/Benedikt.Keil/development/github.com/otto-ec/si_backstage/src/node_modules/knex/lib/dialects/better-sqlite3/index.js:39:38)
[1] at executeQuery (/Users/Benedikt.Keil/development/github.com/otto-ec/si_backstage/src/node_modules/knex/lib/execution/internal/query-executioner.js:37:17)
[1] at Client_BetterSQLite3.query (/Users/Benedikt.Keil/development/github.com/otto-ec/si_backstage/src/node_modules/knex/lib/client.js:146:12)
[1] at Runner.query (/Users/Benedikt.Keil/development/github.com/otto-ec/si_backstage/src/node_modules/knex/lib/execution/runner.js:123:36)
[1] at Runner.queryArray (/Users/Benedikt.Keil/development/github.com/otto-ec/si_backstage/src/node_modules/knex/lib/execution/runner.js:217:21)
[1] at ensureConnectionCallback (/Users/Benedikt.Keil/development/github.com/otto-ec/si_backstage/src/node_modules/knex/lib/execution/internal/ensure-connection-callback.js:11:19)
[1] at Runner.ensureConnection (/Users/Benedikt.Keil/development/github.com/otto-ec/si_backstage/src/node_modules/knex/lib/execution/runner.js:300:20)
[1] at async Runner.run (/Users/Benedikt.Keil/development/github.com/otto-ec/si_backstage/src/node_modules/knex/lib/execution/runner.js:30:19)
[1] at async listCompleted (/Users/Benedikt.Keil/development/github.com/otto-ec/si_backstage/src/node_modules/knex/lib/migrations/migrate/migration-list-resolver.js:12:3)
[1] at async Promise.all (index 1) {
[1] code: 'SQLITE_BUSY'
[1] }
π Expected behavior
The system should start
π Actual Behavior with Screenshots
Try one of there configs
backend:
database:
client: better-sqlite3
plugin:
test:
connection:
directory: database
filename: catalog.sqlite
or
backend:
database:
client: better-sqlite3
connection:
directory: database
π Reproduction steps
- Configure the database
- start the application
π Provide the context for the Bug.
No response
π₯οΈ Your Environment
No response
π Have you spent some time to check if this bug has been raised before?
- I checked and didnβt find similar issue
π’ Have you read the Code of Conduct?
- I have read the Code of Conduct
Are you willing to submit PR?
Yes I am willing to submit a PR!
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 23 (15 by maintainers)
I set the pool max to 1 and solved it!
https://github.com/knex/knex/issues/3176
came here to report the same thing on backstage 1.13.0 and adding just the
GithubOrgEntityProvider
entity provider, again when using sqlite not in memory. Canβt replicate with in memory sqlite.Could it be that you are missing an
await
on a promise when creating those scheduled providers? Such that it tries to run two migrations at the same time.Iβll add here too, that we donβt officially support file based sqlite. The entire driver was originally only intended for quick and dirty in-memory local dev and testing use. The only officially supported drivers are postgres, and in-memory sqlite. If you or others in the community find bugs with the use of on-disk sqlite and fix them, weβre of course super happy to keep up that best-effort support and help get those pull requests merged.