sim0n00ps / OF-DL

C# console app to download all of the media from Onlyfans accounts with DRM video downloading support
569 stars 54 forks source link

SQLite exceptions due to held lock #309

Closed jimbob198 closed 1 month ago

jimbob198 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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.

melithine commented 3 months ago

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.