Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5.3.0 sqlite opened readonly #116

Open
brianegge opened this issue Jan 29, 2024 · 3 comments
Open

v5.3.0 sqlite opened readonly #116

brianegge opened this issue Jan 29, 2024 · 3 comments

Comments

@brianegge
Copy link

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)

@mlapaglia
Copy link
Owner

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
Copy link
Owner

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.

@brianegge
Copy link
Author

brianegge commented Jan 30, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants