Kareadita / Kavita

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.
http://www.kavitareader.com
GNU General Public License v3.0
6.22k stars 322 forks source link

400 Error - There was an issue saving progress #2236

Closed TheQwenton closed 1 year ago

TheQwenton commented 1 year ago

If this is a feature request, request here instead. Feature requests will be deleted from Github.

Please put as much information as possible to help me understand your issue. OS, browser, version are very important!

Describe the bug The error "Error 400 - There was an issue saving progress" keeps appearing when I am reading manga while on Chrome on Window 11, safari on the Ipad mini 6th generation (newest). This has been happening for some time now and has never gone away. Unraid is running in a docker container on my Unraid server.

Unraid configuration settings image

Steps to reproduce the behavior

  1. Log in
  2. Open up manga or book to read
  3. Read Manga, and continue to click through pages
  4. Error appears consistently in bottom right corner

Expected behavior

  1. Error does not appear when clicking through pages

Screenshots image

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional Information Pulled logs from logs folder. This is the error message that keeps occuring [Kavita] [2023-08-24 22:36:49.996 -05:00 192] [Error] API.Services.ReaderService Could not save progress Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details. ---> Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'database is locked'. at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db) at Microsoft.Data.Sqlite.SqliteDataRecord.Dispose() at Microsoft.Data.Sqlite.SqliteDataReader.NextResult() at System.Data.Common.DbDataReader.NextResultAsync(CancellationToken cancellationToken) --- End of stack trace from previous location --- at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ConsumeAsync(RelationalDataReader reader, CancellationToken cancellationToken) --- End of inner exception stack trace --- at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ConsumeAsync(RelationalDataReader reader, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList1 entriesToSave, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) at API.Data.UnitOfWork.CommitAsync() in /home/runner/work/Kavita/Kavita/API/Data/UnitOfWork.cs:line 87 at API.Services.ReaderService.SaveReadingProgress(ProgressDto progressDto, Int32 userId) in /home/runner/work/Kavita/Kavita/API/Services/ReaderService.cs:line 306

TheQwenton commented 1 year ago

Here is the full logs from today. kavita20230824.log

majora2007 commented 1 year ago

See our FAQ. You need to switch to WAL.

TheQwenton commented 1 year ago

See our FAQ. You need to switch to WAL I downloaded DB Browser and suggested and attempted the change. After switching now, my comic load incredibly slow and most of the time never at all. This was not an issue before. Does WAL have something to do with that?

TheQwenton commented 1 year ago

I was able to fix this issue by switching my data base to WAL. Did this in DB Browser (SQLite) by changing this option. I will open a separate issue for HTTP GET requests not going through. image

Melechtna commented 6 months ago

Would have been very nice if there was more here than "read our faq". On Linux, getting the same error, and no where in the entire guide can I see anything about creating or attaching a database.

Edit: Looks like it creates its own, which makes sense, but it looks like it's using SQLite3, after some more digging, I found out you can do so in the terminal with

sqlite3 /opt/Kavita/config/kavita.db

Adjust the directory above to whever you're doing this. It will then drop you in an sqlite shell, and you simply run,

PRAGMA journal_mode=WAL;

It should respond simply with, wal. And it's best to confirm that this set by running,

PRAGMA journal_mode;

And it should then return just, wal. From there it should start working properly.