OpenAlprWebhookProcessor icon indicating copy to clipboard operation
OpenAlprWebhookProcessor copied to clipboard

v5.3.0 sqlite opened readonly

Open brianegge opened this issue 2 years ago • 3 comments

Run in docker, I get errors the DB is readonly. I attempted to remove the WAL and SHM files, but the result was the same.

024-01-29 16:17:04 [21:17:04 INF] Executing endpoint 'OpenAlprWebhookProcessor.Users.UsersController.RefreshToken (OpenAlprWebhookProcessor.Server)' 2024-01-29 16:17:04 [21:17:04 ERR] Failed executing DbCommand (3ms) [Parameters=[@p3='?' (DbType = Int32), @p0='?' (Size = 172), @p1='?' (DbType = DateTime), @p2='?' (Size = 10)], CommandType='Text', CommandTimeout='30'] 2024-01-29 16:17:04 UPDATE "RefreshToken" SET "ReplacedByToken" = @p0, "Revoked" = @p1, "RevokedByIp" = @p2 2024-01-29 16:17:04 WHERE "Id" = @p3 2024-01-29 16:17:04 RETURNING 1; 2024-01-29 16:17:04 [21:17:04 ERR] An exception occurred in the database while saving changes for context type 'OpenAlprWebhookProcessor.Users.Data.UsersContext'. 2024-01-29 16:17:04 Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details. 2024-01-29 16:17:04 ---> Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 8: 'attempt to write a readonly database'. 2024-01-29 16:17:04 at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db) 2024-01-29 16:17:04 at Microsoft.Data.Sqlite.SqliteDataReader.NextResult() 2024-01-29 16:17:04 at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior) 2024-01-29 16:17:04 at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) 2024-01-29 16:17:04 at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)

brianegge avatar Jan 29 '24 21:01 brianegge

hmm, what OS are you running on? maybe the upgrade to .net8 has changed some permission checks. if you start a fresh install do the read/write permissions match between the two?

mlapaglia avatar Jan 30 '24 01:01 mlapaglia

i think it might be caused by this change https://github.com/mlapaglia/OpenAlprWebhookProcessor/blob/develop/OpenAlprWebhookProcessor.Server/Dockerfile#L4

i took the dockerfile from the example solution. i believe this is best practice, if you do a fresh install and see who the new db is installed you should be able to copy that to your existing db and it will work.

mlapaglia avatar Jan 30 '24 01:01 mlapaglia

I’m running Windows 10, with the data volume on a local NTFS. I’ll try running without my DB tomorrow. On Jan 29, 2024, at 8:37 PM, Matt LaPaglia @.***> wrote: hmm, what OS are you running on? maybe the upgrade to .net8 has changed some permission checks. if you start a fresh install do the read/write permissions match between the two?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

brianegge avatar Jan 30 '24 03:01 brianegge