mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-23 23:20:51 +01:00
[Nightly] efcore Migrations SIGTERM on startup #1699
Labels
No labels
area:database
awaiting-feedback
backend
blocked
breaking change: web api
bug
build
ci
confirmed
discussion needed
dotnet future
downstream
duplicate
EFjellyfin.db
enhancement
feature
future
github-actions
good first issue
hdr
help wanted
invalid
investigation
librarydb
live-tv
lyrics
media playback
music
needs testing
nuget
performance
platform
pull-request
question
regression
release critical
requires-web
roadmap
security
security
stale
support
syncplay
ui & ux
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: starred/jellyfin#1699
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Artiume on GitHub (May 16, 2020).
[2020-05-16 00:29:01.038 +00:00] [INF] [1] Main: Jellyfin version: "10.6.0"
[2020-05-16 00:29:01.064 +00:00] [INF] [1] Main: Environment Variables: ["[DOTNET_SYSTEM_GLOBALIZATION_INVARIANT, 1]", "[JELLYFIN_LOG_DIR, /config/log]"]
[2020-05-16 00:29:01.068 +00:00] [INF] [1] Main: Arguments: ["/jellyfin/jellyfin.dll", "--datadir", "/config", "--cachedir", "/cache", "--ffmpeg", "/usr/lib/jellyfin-ffmpeg/ffmpeg"]
[2020-05-16 00:29:01.069 +00:00] [INF] [1] Main: Operating system: "Linux"
[2020-05-16 00:29:01.069 +00:00] [INF] [1] Main: Architecture: X64
[2020-05-16 00:29:01.070 +00:00] [INF] [1] Main: 64-Bit Process: True
[2020-05-16 00:29:01.070 +00:00] [INF] [1] Main: User Interactive: True
[2020-05-16 00:29:01.070 +00:00] [INF] [1] Main: Processor count: 24
[2020-05-16 00:29:01.070 +00:00] [INF] [1] Main: Program data path: "/config"
[2020-05-16 00:29:01.070 +00:00] [INF] [1] Main: Web resources path: "/jellyfin/jellyfin-web"
[2020-05-16 00:29:01.071 +00:00] [INF] [1] Main: Application directory: "/jellyfin/"
[2020-05-16 00:29:01.291 +00:00] [INF] [1] ServerConfigurationManager: Setting cache path: "/cache"
[2020-05-16 00:29:01.301 +00:00] [INF] [1] Emby.Server.Implementations.ApplicationHost: Loading assemblies
[2020-05-16 00:29:33.918 +00:00] [WRN] [1] Microsoft.EntityFrameworkCore.Model.Validation: The entity type '"ActivityLog"' is configured to use schema '"jellyfin"'. SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[2020-05-16 00:29:34.163 +00:00] [ERR] [1] Microsoft.EntityFrameworkCore.Database.Command: Failed executing DbCommand ("2"ms) [Parameters=[""], CommandType='Text', CommandTimeout='30']"
""CREATE TABLE "ActivityLogs" (
"Id" INTEGER NOT NULL CONSTRAINT "PK_ActivityLogs" PRIMARY KEY AUTOINCREMENT,
"Name" TEXT NOT NULL,
"Overview" TEXT NULL,
"ShortOverview" TEXT NULL,
"Type" TEXT NOT NULL,
"UserId" TEXT NOT NULL,
"ItemId" TEXT NULL,
"DateCreated" TEXT NOT NULL,
"LogSeverity" INTEGER NOT NULL,
"RowVersion" INTEGER NOT NULL
);"
[2020-05-16 00:29:34.168 +00:00] [ERR] [1] Emby.Server.Implementations.ApplicationHost: Error creating "MediaBrowser.Api.System.ActivityLogWebSocketListener"
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'table "ActivityLogs" already exists'.
at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
at Microsoft.Data.Sqlite.SqliteCommand.GetStatements(Stopwatch timer)+MoveNext()
at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary
2 parameterValues) at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable1 migrationCommands, IRelationalConnection connection)at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)
at Jellyfin.Server.Implementations.JellyfinDbProvider..ctor(IServiceProvider serviceProvider)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument)at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument)at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
at Emby.Server.Implementations.ApplicationHost.CreateInstanceSafe(Type type)
[2020-05-16 00:29:34.965 +00:00] [ERR] [1] Microsoft.EntityFrameworkCore.Database.Command: Failed executing DbCommand ("0"ms) [Parameters=[""], CommandType='Text', CommandTimeout='30']"
""CREATE TABLE "ActivityLogs" (
"Id" INTEGER NOT NULL CONSTRAINT "PK_ActivityLogs" PRIMARY KEY AUTOINCREMENT,
"Name" TEXT NOT NULL,
"Overview" TEXT NULL,
"ShortOverview" TEXT NULL,
"Type" TEXT NOT NULL,
"UserId" TEXT NOT NULL,
"ItemId" TEXT NULL,
"DateCreated" TEXT NOT NULL,
"LogSeverity" INTEGER NOT NULL,
"RowVersion" INTEGER NOT NULL
);"
[2020-05-16 00:29:34.967 +00:00] [FTL] [1] Main: Error while starting server.
Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'table "ActivityLogs" already exists'.
at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
at Microsoft.Data.Sqlite.SqliteCommand.GetStatements(Stopwatch timer)+MoveNext()
at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary
2 parameterValues) at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable1 migrationCommands, IRelationalConnection connection)at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)
at Jellyfin.Server.Implementations.JellyfinDbProvider..ctor(IServiceProvider serviceProvider)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor
2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor2.VisitCallSite(ServiceCallSite callSite, TArgument argument)at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.b__0(ServiceProviderEngineScope scope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
at Jellyfin.Server.Migrations.MigrationRunner.<>c__DisplayClass1_0.b__0(Type m)
at System.Linq.Enumerable.SelectArrayIterator
2.MoveNext() at System.Linq.Enumerable.OfTypeIterator[TResult](IEnumerable source)+MoveNext() at System.Collections.Generic.LargeArrayBuilder1.AddRange(IEnumerable1 items) at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable1 source)at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Jellyfin.Server.Migrations.MigrationRunner.Run(CoreAppHost host, ILoggerFactory loggerFactory)
at Jellyfin.Server.Program.StartApp(StartupOptions options)
[2020-05-16 00:29:34.973 +00:00] [INF] [1] Emby.Server.Implementations.ApplicationHost: Disposing "CoreAppHost"
[2020-05-16 00:29:34.974 +00:00] [INF] [1] Emby.Server.Implementations.ApplicationHost: Disposing "SessionInfoWebSocketListener"
[2020-05-16 00:29:34.976 +00:00] [INF] [1] Emby.Server.Implementations.ApplicationHost: Disposing "ScheduledTasksWebSocketListener"
[2020-05-16 00:29:34.977 +00:00] [INF] [1] Emby.Server.Implementations.ApplicationHost: Disposing "SessionWebSocketListener"
[2020-05-16 00:29:34.978 +00:00] [INF] [1] Emby.Server.Implementations.ApplicationHost: Disposing "EmbyTV"
[2020-05-16 00:29:34.979 +00:00] [INF] [2] Main: Received a SIGTERM signal, shutting down
@mark-monteiro commented on GitHub (May 16, 2020):
@Artiume Did you test the PR for the activity db migration earlier than a few days ago? If yes, you need to delete your new database so it gets initialized again.
There was a change in the initial EF migration that creates the
ActivityLogstable (renamed the table fromActivityLogtoActivityLogs), that forces resetting the database, but this will only affect people that were testing the PR code before that change was committed.cc @barronpm
@Artiume commented on GitHub (May 16, 2020):
Yeah, I think this build probably was tested with the initial PR. so I restored the original activitylog and removed the entry in the migrations.xml but it's still erroring on the table in activitylogs.
@mark-monteiro commented on GitHub (May 16, 2020):
Neither of those previous steps is required, this is an issue with the EF migration which is separate from the other migration framework that's specific to Jellyfin (it's confusing I know, lol).
Instead, you need to delete the new Sqlite database that was created to hold the migrated activity data (I think it's
jellyfin.db, but I can't check right now sorry)@Artiume commented on GitHub (May 16, 2020):
removing jellyfin.db fixed it