Sqlite database locked

Hello!

We’re using drone to run some integration tests. Our build config requires about dozen of services to be started before running the build pipeline. Unfortuanetly, as we add more services, some of them aren’t started at random, so that builds randomly fail. I’ve looked into drone container logs, and I see a lots of messages like this:

error: rpc.update: cannot find pproc with id 16247: database is locked
error: rpc.update: cannot find pproc with id 16285: database is locked
error: rpc.update: cannot find pproc with id 16285: database is locked
error: rpc.update: cannot find pproc with id 16285: database is locked
error: rpc.update: cannot find pproc with id 16285: database is locked

I’d bet that the issue is we’re using SQLite as a backend and it cannot be accessed concurrently. The problem appears only when there’s a lot of things happening in parallel – which is a case for numerous services starting in the very same moment. I think that this should be considered a bug.

I was thinking about migrating drone DB to postgres – is this possible to do this without starting from scratch?

We’re using drone 0.7 right now.

FYI, version 0.8 is affected too. We had quite large SQLite db (over 200 MB). I’ve migrated DB to postgres and it looks like the issue is resolved for now.

@kfigiela, I’m curious, did you migrate your data, or have to start over? If you migrated, could you share what/how you did it? I’m in a similar situation. Thanks!

I migrated. I used drone to create db schema in postgres, then I used pgloader to migrate data. Possibly I did some adjustments manually, but in general it went smooth.

1 Like