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

Playback Reporting plugin breaks dashboard restart button #89

Closed
solidsnake1298 opened this issue Jul 10, 2024 · 11 comments · Fixed by #98
Closed

Playback Reporting plugin breaks dashboard restart button #89

solidsnake1298 opened this issue Jul 10, 2024 · 11 comments · Fixed by #98
Labels
bug This PR or Issue describes or fixes something that isn't working confirmed This Issue describes a bug that has been confirmed by a org member

Comments

@solidsnake1298
Copy link
Member

solidsnake1298 commented Jul 10, 2024

When the playback reporting plugin is installed, when a restart from the dashboard is initiated it causes the server to fail to restart. The resulting error appears in the log.

[2024-07-10 17:59:33.475 +00:00] [FTL] Error while starting server
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 8: 'attempt to write a readonly database'.
   at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
   at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
   at Emby.Server.Implementations.Data.SqliteExtensions.Execute(SqliteConnection sqliteConnection, String commandText)
   at Emby.Server.Implementations.Data.ManagedConnection.Execute(String commandText)
   at Emby.Server.Implementations.Data.BaseSqliteRepository.Initialize()
   at Emby.Server.Implementations.Data.SqliteItemRepository.Initialize()
   at Emby.Server.Implementations.ApplicationHost.InitializeServices()
   at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)

Uninstalling the plugin resolved the issue. I was able to re-produce the problem when I re-installed the plugin.

Ubuntu 24.04 - bare metal
Jellyfin 10.9.7 - package install

I was also able to replicate on a Docker instance I have for testing.

@p37307
Copy link

p37307 commented Jul 10, 2024

I was able to produce and reproduce the problem also by activating and deactivating the plugin.

@solidsnake1298 solidsnake1298 added bug This PR or Issue describes or fixes something that isn't working confirmed This Issue describes a bug that has been confirmed by a org member labels Jul 10, 2024
@solidsnake1298
Copy link
Member Author

solidsnake1298 commented Jul 10, 2024

One thing I noticed was that a package install directly on Ubuntu will not attempt to restart after the fatal database error. But the docker instance will restart again and appears to recover on its own.

@bin101
Copy link

bin101 commented Oct 10, 2024

I added Restart = always to the systemd service because the generic linux install guide mentioned it and the docker guide also. This remedies the symptoms but not the cause

@minoskt
Copy link

minoskt commented Nov 10, 2024

I have the same issue, also reported here.

@ethaldeman
Copy link

For me this problem only seems to arise when you update the Jellyfin server version. So another work around is disable the plugin before updating Jellyfin server, restart server, update jellyfin server, restart server, enable plugin, and restart server. Now the plugin should no longer prevent restarts.

If you are currently experiencing the issue, try following the above instructions (minus the jellyfin server udpate) and it may resolve the issue until you update jellyfin server again.

@Hello-World-Traveler
Copy link

Disable then restart server and it should update the plugin to 15.0.0.0 from 14.0.0.0

@minoskt
Copy link

minoskt commented Nov 25, 2024

That worked! Thank you for your help.

@bin101
Copy link

bin101 commented Nov 26, 2024

But 15.0.0.0 still has this issue

@Hello-World-Traveler
Copy link

Hello-World-Traveler commented Jan 1, 2025

Playback Reporting was breaking the restart of the server. NO plugin should stop the server from booting. I had it fixed but after a few weeks it stopped restarting.

Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'database is locked For more information on this error code see https://www.sqlite.org/rescode.html'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteConnection.Deactivate()
   at Microsoft.Data.Sqlite.SqliteConnection.Close()
   at System.Data.Common.DbConnection.CloseAsync()
--- End of stack trace from previous location ---
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.CloseAsync()
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.CloseAsync()
   at Microsoft.EntityFrameworkCore.Storage.RelationalDataReader.DisposeAsync()
   at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)
   at Jellyfin.Server.Implementations.Trickplay.TrickplayManager.GetTrickplayResolutions(Guid itemId)
   at Jellyfin.Server.Implementations.Trickplay.TrickplayManager.GetTrickplayResolutions(Guid itemId)
   at Jellyfin.Server.Implementations.Trickplay.TrickplayManager.GetTrickplayManifest(BaseItem item)
   at Emby.Server.Implementations.Dto.DtoService.AttachBasicFields(BaseItemDto dto, BaseItem item, BaseItem owner, DtoOptions options)
   at Emby.Server.Implementations.Dto.DtoService.GetBaseItemDtoInternal(BaseItem item, DtoOptions options, User user, BaseItem owner)
   at Jellyfin.Api.Controllers.UserLibraryController.GetItem(Nullable`1 userId, Guid itemId)
   at lambda_method1194(Closure, Object)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Jellyfin.Api.Middleware.ServerStartupMessageMiddleware.Invoke(HttpContext httpContext, IServerApplicationHost serverApplicationHost, ILocalizationManager localizationManager)
   at Jellyfin.Api.Middleware.WebSocketHandlerMiddleware.Invoke(HttpContext httpContext, IWebSocketManager webSocketManager)
   at Jellyfin.Api.Middleware.IPBasedAccessValidationMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager)
   at Jellyfin.Api.Middleware.LanFilteringMiddleware.Invoke(HttpContext httpContext, INetworkManager networkManager, IServerConfigurationManager serverConfigurationManager)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Api.Middleware.QueryStringDecodingMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.ReDoc.ReDocMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Jellyfin.Api.Middleware.RobotsRedirectionMiddleware.Invoke(HttpContext httpContext)
   at Jellyfin.Api.Middleware.LegacyEmbyRouteRewriteMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at Jellyfin.Api.Middleware.ResponseTimeMiddleware.Invoke(HttpContext context, IServerConfigurationManager serverConfigurationManager)
   at Jellyfin.Api.Middleware.ExceptionMiddleware.Invoke(HttpContext context)

[ERR] An error occurred using the connection to database '"main"' on server '"/var/lib/jellyfin/data/jellyfin.db"'.
[ERR] An exception occurred while iterating over the results of a query for context type '"Jellyfin.Server.Implementations.JellyfinDbContext"'."
""Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'not an error'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteConnection.Open()
   at System.Data.Common.DbConnection.OpenAsync(CancellationToken cancellationToken)
--- End of stack trace from previous location ---
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()"
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'not an error'.
   at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
   at Microsoft.Data.Sqlite.SqliteConnection.Open()
   at System.Data.Common.DbConnection.OpenAsync(CancellationToken cancellationToken)
--- End of stack trace from previous location ---
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleOrDefaultAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at Jellyfin.Server.Implementations.Security.AuthorizationContext.GetAuthorizationInfoFromDictionary(Dictionary`2 auth, IHeaderDictionary headers, IQueryCollection queryString)
   at Jellyfin.Server.Implementations.Security.AuthorizationContext.GetAuthorizationInfoFromDictionary(Dictionary`2 auth, IHeaderDictionary headers, IQueryCollection queryString)
   at Jellyfin.Server.Implementations.Security.AuthorizationContext.GetAuthorizationInfo(HttpRequest requestContext)

This was in the log, not sure if it's the cause. Trickplay error?

I think this should be moved to Jellyfin server issues? @Bond-009 @thornbill

@thornbill

This comment has been minimized.

@Hello-World-Traveler

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This PR or Issue describes or fixes something that isn't working confirmed This Issue describes a bug that has been confirmed by a org member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants