E200030: BUSY error explained

As I wrote in my previous post, Subversion 1.7 keeps all working copy metadata in .svn/wc.db SQLite database. I earlier working copy formats (versions <= 1.6) every subdirectory of a working copy could be considered independently. In particular, one could run 2 processes/threads which could modify different working copy subdirectories at the same time. With SVN 1.7 one cannot.

Every SVN 1.7 write operation (add, copy, mv, rm, …) locks .svn/wc.db database. When another process tries to obtain a write lock on the same .svn/wc.db at the same time, it fails with an error.

Let’s reproduce the problem to make things clear. First, install SQLite library and development packages.

$ sudo aptitude install libsqlite3-0 libsqlite3-dev

Let’s write a small program that would lock our database:

#include <sqlite3.h>
#include <stdio.h>

int main(int argc, char** argv) {
    sqlite3 *db;

    if (argc != 2) {
        fprintf(stderr, "Usage: %s <sqlite_database.db>\n", argv[0]);
        return 1;

    sqlite3_open_v2(argv[1], &db, SQLITE_OPEN_READWRITE, NULL);
    sqlite3_exec(db, "PRAGMA locking_mode = EXCLUSIVE;",
        NULL, NULL, NULL);
    sqlite3_exec(db, "BEGIN TRANSACTION;", NULL, NULL, NULL);
    sqlite3_exec(db, "DELETE FROM NODES;", NULL, NULL, NULL);

    while (1) {

    return 0;

Don’t worry, without “COMMIT” statement it won’t execute the query. But anyway I wouldn’t recommend you to run it on .svn/wc.db, that it important for you: every software contains a bug.

Let’s compile and try it:

$ gcc lock_sqlite.c -lsqlite3 -o lock_sqlite
$ ./lock_sqlite .svn/wc.db

While the program is running, our SQLite database is locked. Let’s try to modify .svn/wc.db with SVN. SVN says

$ svn add file
svn: E155004: Working copy '/tmp/test-co' locked
svn: E200033: sqlite: database is locked
svn: E200033: sqlite: database is locked
svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)

SVNKit is a pure Java SVN implementation (actually, there’re only 2 SVN implentations: native SVN and SVNKit). Nearly all Java programs that work with Subversion use SVNKit. Let’s try to modify .svn/wc.db with SVNKit:

$ jsvn add file
svn: E200030: BUSY

So if you use Java-based SVN client and see this message there’re 2 explanations:

  1. You have a backgroud process that tries to access your working copy at the same time.
  2. Your SVN client tries to access the working copy from several threads. Then it’s a bug, report it to the client developers.

Comments are closed.