# Sqlite database locked

**URL:** <https://drone.discourse.group/t/sqlite-database-locked/9160>\
**Category:** Drone Support\
**Created:** [September 8, 2017, 11:47am UTC](https://drone.discourse.group/t/sqlite-database-locked/9160 "2017-09-08T11:47:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kfigiela](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/kfigiela/32/4089_2.png) [@kfigiela](https://drone.discourse.group/u/kfigiela)\
**Post date:** [September 8, 2017, 11:47am UTC](https://drone.discourse.group/t/sqlite-database-locked/9160/1 "2017-09-08T11:47:14Z")

</div>

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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![kfigiela](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/kfigiela/32/4089_2.png) [@kfigiela](https://drone.discourse.group/u/kfigiela)\
**Post date:** [September 11, 2017, 3:41pm UTC](https://drone.discourse.group/t/sqlite-database-locked/9160/2 "2017-09-11T15:41:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jesselang](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/jesselang/32/3760_2.png) [@jesselang](https://drone.discourse.group/u/jesselang)\
**Post date:** [October 20, 2017, 5:02am UTC](https://drone.discourse.group/t/sqlite-database-locked/9160/3 "2017-10-20T05:02:27Z")

</div>

@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!

---

<div class="post-metadata">

**Author:** ![kfigiela](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/kfigiela/32/4089_2.png) [@kfigiela](https://drone.discourse.group/u/kfigiela)\
**Post date:** [October 20, 2017, 8:48am UTC](https://drone.discourse.group/t/sqlite-database-locked/9160/4 "2017-10-20T08:48:50Z")

</div>

I migrated. I used drone to create db schema in postgres, then I used [pgloader](http://pgloader.io) to migrate data. Possibly I did some adjustments manually, but in general it went smooth.
