wars2k / booktracker

Selfhosted app for organizing your library and tracking your reading habits.
MIT License
42 stars 1 forks source link

Unexpected end of JSON input #29

Open oderyn opened 9 months ago

oderyn commented 9 months ago

It seems like 1 out of every 10 books is returning an "Unexpected end of JSON input" error.

This is the output in the console: search.js:38 SyntaxError: Unexpected end of JSON input (anonymous) @ search.js:38 Promise.catch (async) addBook @ search.js:38 onclick @ search.html:1

And this is from Booktracker's logs:

12/16/2023 2:09:56 PM Connection id "0HMVUDMTV7BIK", Request id "0HMVUDMTV7BIK:00000001": An unhandled exception was thrown by the application. 12/16/2023 2:09:56 PM System.InvalidOperationException: Value must be set. 12/16/2023 2:09:56 PM at Microsoft.Data.Sqlite.SqliteParameter.Bind(sqlite3_stmt stmt) 12/16/2023 2:09:56 PM at Microsoft.Data.Sqlite.SqliteParameterCollection.Bind(sqlite3_stmt stmt) 12/16/2023 2:09:56 PM at Microsoft.Data.Sqlite.SqliteCommand.GetStatements(Stopwatch timer)+MoveNext() 12/16/2023 2:09:56 PM at Microsoft.Data.Sqlite.SqliteDataReader.NextResult() 12/16/2023 2:09:56 PM at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior) 12/16/2023 2:09:56 PM at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery() 12/16/2023 2:09:56 PM at bookTrackerApi.DB.addNewEntry(VolumeInfo content) in /app/DB.cs:line 111 12/16/2023 2:09:56 PM at bookTrackerApi.Api.<>c.<b__1_6>d.MoveNext() in /app/Api.cs:line 128 12/16/2023 2:09:56 PM --- End of stack trace from previous location --- 12/16/2023 2:09:56 PM at Microsoft.AspNetCore.Http.RequestDelegateFactory.ExecuteTaskResult[T](Task1 task, HttpContext httpContext) 12/16/2023 2:09:56 PM at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) 12/16/2023 2:09:56 PM at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) 12/16/2023 2:09:56 PM at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) 12/16/2023 2:09:56 PM at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication1 application)

I've been able to consistently replicate the error with this book: Harry Potter Magical Places & Characters Coloring Book https://www.google.com/books/edition/_/caqDjgEACAAJ?hl=en

wars2k commented 9 months ago

Thanks for calling this out. I'll try to get it fixed in the next release.