OF-DL icon indicating copy to clipboard operation
OF-DL copied to clipboard

SQLite exceptions due to held lock

Open jimbob198 opened this issue 1 year ago • 4 comments

Hi, I've been trying to run this a few times on the latest release, and I'm noticing the DBHelper keeps throwing exceptions about the DB already being locked. I've rm'd both the users.db and the per-user DBs multiple times now, so the only process that can be looking at either is the OF downloader. Away from the PC right now, can attach stack traces later.

jimbob198 avatar Mar 21 '24 01:03 jimbob198

First one:

Scraping Data for XXXXX
Folder for XXXXX already created
Exception caught: SQLite Error 5: 'database is locked'.

                                                       StackTrace:    at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
   at Microsoft.Data.Sqlite.SqliteCommand.GetStatements(Stopwatch timer)+MoveNext()
   at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
   at System.Data.Common.DbCommand.ExecuteNonQueryAsync(CancellationToken cancellationToken)
--- End of stack trace from previous location ---
   at OF_DL.Helpers.DBHelper.CreateDB(String folder)
Getting Paid Posts
Found 0 Paid Posts
Getting Posts

jimbob198 avatar Mar 21 '24 02:03 jimbob198

I believe this is being thrown on the first command, to create the medias table, since when I .dump the db all I get is PRAGMA foreign_key=false; BEGIN TRANSACTION; COMMIT;

jimbob198 avatar Mar 24 '24 08:03 jimbob198

Think this might have been a weird WSL error, but unsure; was using a symlinked WSL folder as the destination. As soon as I pointed back to a regular folder, it worked again. Using the WSL link was fine in the past though, so I'm not sure what changed.

jimbob198 avatar Mar 30 '24 13:03 jimbob198

I regularly use the plan9 access from inside WSL with ofdl. Haven't seen any issues with it so far, but it could have been locked by something in Windows reading it, like anti-virus software or such.

melithine avatar Mar 30 '24 14:03 melithine