Relatively rarely, while starting a transaction on a concurrently modified SQLite database in WAL mode, I get a SQLITE_BUSY_SNAPSHOT error for just-prepared "BEGIN IMMEDIATE" statement. When I look at the list of statements with sqlite3_stmt_next, I cannot find any busy statement. Is it possible that a "BEGIN IMMEDIATE" statement by itself fails with this error code? This is a bit suprising. I would have expected a regular SQLITE_BUSY because this is not exactly a snapshot upgrade failure as far as the application is concerned (it is possible to try again immediately and succeed).
This is with SQLite 3.8.7.1 from Debian jessie.