Skip to content

500 error from /Write/message (Add retry to database work sections) #122

@12Me21

Description

@12Me21

This only happened once, and the request succeeded when I tried again

Unhandled exception: System.ObjectDisposedException: Safe handle has been closed.
Object name: 'SafeHandle'.
   at System.StubHelpers.StubHelpers.SafeHandleAddRef(SafeHandle pHandle, Boolean& success)
   at SQLitePCL.SQLite3Provider_e_sqlite3.NativeMethods.sqlite3_prepare_v2(sqlite3 db, Byte* pSql, Int32 nBytes, IntPtr& stmt, Byte*& ptrRemain)
   at SQLitePCL.SQLite3Provider_e_sqlite3.SQLitePCL.ISQLite3Provider.sqlite3_prepare_v2(sqlite3 db, ReadOnlySpan`1 sql, IntPtr& stm, ReadOnlySpan`1& tail)
   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.ExecuteNonQuery()
   at Microsoft.Data.Sqlite.SqliteConnectionExtensions.ExecuteNonQuery(SqliteConnection connection, String commandText, SqliteParameter[] parameters)
   at Microsoft.Data.Sqlite.SqliteTransaction..ctor(SqliteConnection connection, IsolationLevel isolationLevel, Boolean deferred)
   at Microsoft.Data.Sqlite.SqliteConnection.BeginTransaction(IsolationLevel isolationLevel, Boolean deferred)
   at contentapi.Main.DbWriter.DatabaseWork_Message(DbWorkUnit`1 work) in /home/csanchez/projects/contentapi/contentapi/Main/DbWriter.cs:line 818
   at contentapi.Main.DbWriter.GenericWorkAsync[T](T view, UserView requester, UserAction action, String message) in /home/csanchez/projects/contentapi/contentapi/Main/DbWriter.cs:line 506
   at contentapi.Main.DbWriter.WriteAsync[T](T view, Int64 requestUserId, String message) in /home/csanchez/projects/contentapi/contentapi/Main/DbWriter.cs:line 103
   at contentapi.Controllers.WriteController.<>c__DisplayClass3_0.<<WriteMessageAsync>b__0>d.MoveNext() in /home/csanchez/projects/contentapi/contentapi/Controllers/WriteController.cs:line 36
--- End of stack trace from previous location ---
   at contentapi.Controllers.BaseController.MatchExceptions[T](Func`1 perform) in /home/csanchez/projects/contentapi/contentapi/Controllers/BaseController.cs:line 113

Metadata

Metadata

Assignees

No one assigned

    Labels

    lowpriorityThis may be worked on but it'll come after other things

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions