Jellyfin constantly restarts when run as a service, works when run from a terminal - benhudson - 2024-03-05
I have been having some trouble setting up Jellyfin on a fresh Arch install.
I installed version 10.8.13.0 using pacman (jellyfin-web, jellyfin-server, and jellyfin-ffmeg), and enabled and started jellyfin.service with systemctl. There were no unusual errors at any point.
When I try to connect with the Android client I get the error "Tried 2 candidates for input, without success. Unable to reach server"
When I try to connect in the browser to [IP]:8086, I get the error "ERR_CONNECTION_REFUSED"
However, if I run 'jellyfin' from the terminal on the server, it starts correctly and everything seems to work fine:
Code: [media@media ~]$ jellyfin
[21:36:21] [INF] [1] Main: Jellyfin version: 10.8.13
[21:36:21] [INF] [1] Main: Environment Variables: ["[JELLYFIN_LOG_DIR, /home/media/.local/share/jellyfin/log]"]
[21:36:21] [INF] [1] Main: Arguments: ["/usr/lib/jellyfin/jellyfin.dll"]
[21:36:21] [INF] [1] Main: Operating system: Linux
[21:36:21] [INF] [1] Main: Architecture: X64
[21:36:21] [INF] [1] Main: 64-Bit Process: True
[21:36:21] [INF] [1] Main: User Interactive: True
[21:36:21] [INF] [1] Main: Processor count: 4
[21:36:21] [INF] [1] Main: Program data path: /home/media/.local/share/jellyfin
[21:36:21] [INF] [1] Main: Web resources path: /usr/share/jellyfin-web
[21:36:21] [INF] [1] Main: Application directory: /usr/lib/jellyfin/
[21:36:21] [INF] [1] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Setting cache path: /home/media/.cache/jellyfin
[21:36:21] [INF] [1] Emby.Server.Implementations.ApplicationHost: Loading assemblies
[21:36:21] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN addresses : [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
[21:36:21] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN exclusions : []
[21:36:21] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using LAN addresses: [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
[21:36:21] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using bind addresses: []
[21:36:21] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using bind exclusions: []
[21:36:23] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: TMDb 10.8.13.0
[21:36:23] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: Studio Images 10.8.13.0
[21:36:23] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: OMDb 10.8.13.0
[21:36:23] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: MusicBrainz 10.8.13.0
[21:36:23] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: AudioDB 10.8.13.0
[21:36:23] [INF] [1] Main: Kestrel listening on Any IP4 Address
[21:36:24] [INF] [1] Emby.Server.Implementations.ApplicationHost: Running startup tasks
[21:36:24] [INF] [1] Emby.Server.Implementations.ScheduledTasks.TaskManager: Daily trigger for Extract Chapter Images set to fire at 2024-03-06 02:00:00.000 +00:00, which is 04:23:35.8808544 from now.
[21:36:24] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Found ffmpeg version 6.1.1
[21:36:24] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available decoders: ["libdav1d", "av1", "av1_cuvid", "av1_qsv", "h264", "h264_qsv", "h264_cuvid", "hevc", "hevc_qsv", "hevc_cuvid", "mpeg2video", "mpeg2_qsv", "mpeg2_cuvid", "mpeg4", "mpeg4_cuvid", "msmpeg4", "vc1_qsv", "vc1_cuvid", "vp8", "libvpx", "vp8_cuvid", "vp8_qsv", "vp9", "libvpx-vp9", "vp9_cuvid", "vp9_qsv", "aac", "ac3", "dca", "flac", "mp3", "truehd"]
[21:36:24] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available encoders: ["libx264", "h264_amf", "h264_nvenc", "h264_qsv", "h264_v4l2m2m", "h264_vaapi", "libx265", "hevc_amf", "hevc_nvenc", "hevc_qsv", "hevc_vaapi", "mpeg4", "msmpeg4", "libvpx", "libvpx-vp9", "aac", "ac3", "dca", "flac", "libmp3lame", "libopus", "truehd", "libvorbis", "srt"]
[21:36:24] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available filters: ["deinterlace_qsv", "deinterlace_vaapi", "hwupload_cuda", "overlay_opencl", "overlay_qsv", "overlay_vaapi", "overlay_cuda", "procamp_vaapi", "scale_cuda", "scale_qsv", "scale_vaapi", "tonemap_opencl", "tonemap_vaapi", "vpp_qsv", "yadif_cuda", "zscale"]
[21:36:24] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: tonemap_cuda with option GPU accelerated HDR to SDR tonemapping is not available
[21:36:24] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available hwaccel types: ["vdpau", "cuda", "vaapi", "qsv", "drm", "opencl", "vulkan"]
[21:36:25] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: FFmpeg: ffmpeg
[21:36:25] [INF] [1] Emby.Server.Implementations.ApplicationHost: ServerId: 522e14a70c4d49cba44ae8885ace1545
[21:36:25] [INF] [1] Emby.Server.Implementations.ApplicationHost: Executed all pre-startup entry points in 0:00:00.0991509
[21:36:25] [INF] [1] Emby.Server.Implementations.ApplicationHost: Core startup complete
[21:36:25] [INF] [1] Emby.Server.Implementations.EntryPoints.ExternalPortForwarding: Starting NAT discovery
[21:36:25] [INF] [8] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /mnt/media/music
[21:36:25] [INF] [1] Emby.Server.Implementations.ApplicationHost: Executed all post-startup entry points in 0:00:00.2230387
[21:36:25] [INF] [1] Main: Startup complete 0:00:04.7128554
[21:36:27] [INF] [8] Emby.Server.Implementations.ScheduledTasks.TaskManager: StartupTrigger fired for task: Update Plugins
[21:36:27] [INF] [8] Emby.Server.Implementations.ScheduledTasks.TaskManager: Queuing task PluginUpdateTask
[21:36:27] [INF] [11] Emby.Server.Implementations.ScheduledTasks.TaskManager: Executing Update Plugins
[21:36:27] [INF] [18] Emby.Server.Implementations.ScheduledTasks.TaskManager: Update Plugins Completed after 0 minute(s) and 0 seconds
[21:36:27] [INF] [18] Emby.Server.Implementations.ScheduledTasks.TaskManager: ExecuteQueuedTasks
And for as long as it's running in the terminal, it works as planned. But when it's cancelled, it's back to how it was before.
Because the service seems to be the problem, I checked
Code: sudo systemctl status jellyfin.service
This gives a slightly different result each time it's run, but this is typical:
Code: ● jellyfin.service - Jellyfin Media Server
Loaded: loaded (/usr/lib/systemd/system/jellyfin.service; enabled; preset: disabled)
Active: active (running) since Tue 2024-03-05 21:15:09 UTC; 2s ago
Main PID: 1212 (jellyfin)
Tasks: 18 (limit: 4543)
Memory: 54.3M (peak: 54.4M)
CPU: 2.091s
CGroup: /system.slice/jellyfin.service
└─1212 /usr/bin/jellyfin --restartpath=/usr/lib/jellyfin/restart.sh --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg
Mar 05 21:15:10 media jellyfin[1212]: [21:15:10] [INF] [1] Main: Web resources path: /usr/share/jellyfin-web
Mar 05 21:15:10 media jellyfin[1212]: [21:15:10] [INF] [1] Main: Application directory: /usr/lib/jellyfin/
Mar 05 21:15:10 media jellyfin[1212]: [21:15:10] [INF] [1] Jellyfin.Server.Migrations.MigrationRunner: Marking following migrations as applied because this is a fresh install: ["CreateNetworkConfiguration"]
Mar 05 21:15:10 media jellyfin[1212]: [21:15:10] [INF] [1] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Setting cache path: /var/cache/jellyfin
Mar 05 21:15:10 media jellyfin[1212]: [21:15:10] [INF] [1] Emby.Server.Implementations.ApplicationHost: Loading assemblies
Mar 05 21:15:10 media jellyfin[1212]: [21:15:10] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN addresses : [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
Mar 05 21:15:10 media jellyfin[1212]: [21:15:10] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN exclusions : []
Mar 05 21:15:10 media jellyfin[1212]: [21:15:10] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using LAN addresses: [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
Mar 05 21:15:10 media jellyfin[1212]: [21:15:10] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using bind addresses: []
Mar 05 21:15:10 media jellyfin[1212]: [21:15:10] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using bind exclusions: []
The 'running since' time is always very recent - less than 3s and often just a few ms. This leads me to believe that the service is stopping and restarting constantly; but for some reason when run in the terminal it runs stably and works as expected.
I recently tried it again and the first time I ran...
Code: sudo systemctl status jellyfin.service
... I got a result that looked more like an error:
Code: ● jellyfin.service - Jellyfin Media Server
Loaded: loaded (/usr/lib/systemd/system/jellyfin.service; enabled; preset: disabled)
Active: activating (auto-restart) (Result: core-dump) since Tue 2024-03-05 21:14:35 UTC; 32ms ago
Process: 892 ExecStart=/usr/bin/jellyfin $JELLYFIN_WEB_OPT $JELLYFIN_RESTART_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLYFIN_ADDITIONAL_OPTS (code=dumped, signal=ABRT)
Main PID: 892 [b](code=dumped, signal=ABRT)[/b]
CPU: 2.441s
But subsequent status checks were more like the ones above.
Looking in the journal:
Code: [media@media ~]$ sudo journalctl -r -u jellyfin
Mar 05 21:53:35 media jellyfin[20493]: [21:53:35] [INF] [1] Main: Application directory: /usr/lib/jellyfin/
Mar 05 21:53:35 media jellyfin[20493]: [21:53:35] [INF] [1] Main: Web resources path: /usr/share/jellyfin-web
Mar 05 21:53:35 media jellyfin[20493]: [21:53:35] [INF] [1] Main: Program data path: /var/lib/jellyfin
Mar 05 21:53:35 media jellyfin[20493]: [21:53:35] [INF] [1] Main: Processor count: 4
Mar 05 21:53:35 media jellyfin[20493]: [21:53:35] [INF] [1] Main: User Interactive: True
Mar 05 21:53:35 media jellyfin[20493]: [21:53:35] [INF] [1] Main: 64-Bit Process: True
Mar 05 21:53:35 media jellyfin[20493]: [21:53:35] [INF] [1] Main: Architecture: X64
Mar 05 21:53:35 media jellyfin[20493]: [21:53:35] [INF] [1] Main: Operating system: Linux
Mar 05 21:53:35 media jellyfin[20493]: [21:53:35] [INF] [1] Main: Arguments: ["/usr/lib/jellyfin/jellyfin.dll", "--restartpath=/usr/lib/jellyfin/restart.sh", "--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg"]
Mar 05 21:53:35 media jellyfin[20493]: [21:53:35] [INF] [1] Main: Environment Variables: ["[JELLYFIN_CACHE_DIR, /var/cache/jellyfin]", "[JELLYFIN_RESTART_OPT, --restartpath=/usr/lib/jellyfin/restart.sh]", "[JELLYFIN_FFMPEG_OPT, --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg]", "[JELLYFIN_LOG_DIR, /var/log/jellyfin]", "[JELLYFIN_CONFIG_DIR, /etc/jellyfin]", "[JELLYFIN_DATA_DIR, /var/lib/jellyfin]"]
Mar 05 21:53:35 media jellyfin[20493]: [21:53:35] [INF] [1] Main: Jellyfin version: 10.8.13
Mar 05 21:53:35 media (jellyfin)[20493]: jellyfin.service: Referenced but unset environment variable evaluates to an empty string: JELLYFIN_ADDITIONAL_OPTS, JELLYFIN_NOWEBAPP_OPT, JELLYFIN_SERVICE_OPT, JELLYFIN_WEB_OPT
Mar 05 21:53:35 media systemd[1]: Started Jellyfin Media Server.
Mar 05 21:53:35 media systemd[1]: jellyfin.service: Scheduled restart job, restart counter is at 716.
Mar 05 21:53:35 media systemd[1]: jellyfin.service: Consumed 2.433s CPU time.
Mar 05 21:53:35 media systemd[1]: jellyfin.service: Failed with result 'core-dump'.
Mar 05 21:53:35 media systemd[1]: jellyfin.service: Main process exited, code=dumped, status=6/ABRT
Mar 05 21:53:34 media jellyfin[20465]: at Jellyfin.Server.Program.<Main>(String[] args)
Mar 05 21:53:34 media jellyfin[20465]: at Jellyfin.Server.Program.StartApp(StartupOptions options)
Mar 05 21:53:34 media jellyfin[20465]: at Emby.Server.Implementations.ApplicationHost.DisposeAsync()
Mar 05 21:53:34 media jellyfin[20465]: at Emby.Server.Implementations.ApplicationHost.DisposeAsyncCore()
Mar 05 21:53:34 media jellyfin[20465]: Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
Mar 05 21:53:34 media jellyfin[20465]: at Jellyfin.Server.Program.<Main>(String[] args)
Mar 05 21:53:34 media jellyfin[20465]: at Jellyfin.Server.Program.StartApp(StartupOptions options)
Mar 05 21:53:34 media jellyfin[20465]: at Emby.Server.Implementations.ApplicationHost.DisposeAsync()
Mar 05 21:53:34 media jellyfin[20465]: at Emby.Server.Implementations.ApplicationHost.DisposeAsyncCore()
Mar 05 21:53:34 media jellyfin[20465]: System.NullReferenceException: Object reference not set to an instance of an object.
Mar 05 21:53:34 media jellyfin[20465]: [21:53:34] [FTL] [1] Main: Unhandled Exception
Mar 05 21:53:34 media jellyfin[20465]: [21:53:34] [INF] [1] Emby.Server.Implementations.ApplicationHost: Disposing CoreAppHost
Mar 05 21:53:34 media jellyfin[20465]: [21:53:34] [INF] [1] Main: Running query planner optimizations in the database... This might take a while
Mar 05 21:53:34 media jellyfin[20465]: at Jellyfin.Server.Program.StartApp(StartupOptions options)
Mar 05 21:53:34 media jellyfin[20465]: at Emby.Server.Implementations.ApplicationHost.InitializeServices()
Mar 05 21:53:34 media jellyfin[20465]: at Emby.Server.Implementations.ApplicationHost.Resolve[T]()
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
Mar 05 21:53:34 media jellyfin[20465]: at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
Mar 05 21:53:34 media jellyfin[20465]: at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Mar 05 21:53:34 media jellyfin[20465]: at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
Mar 05 21:53:34 media jellyfin[20465]: at Jellyfin.Server.Implementations.Users.UserManager..ctor(JellyfinDbProvider dbProvider, IEventManager eventManager, ICryptoProvider cryptoProvider, INetworkManager networkManager, IApplicationHost appHost, IImageProcessor imageProcessor, ILogger`1 logger)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.EntityFrameworkCore.Storage.NonRetryingExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.<>c.<MoveNext>b__19_0(DbContext _, Enumerator enumerator)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.InitializeReader(Enumerator enumerator)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
Mar 05 21:53:34 media jellyfin[20465]: at System.Data.Common.DbCommand.ExecuteReader()
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReader(CommandBehavior behavior)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Data.Sqlite.SqliteCommand.GetStatements(Stopwatch timer)+MoveNext()
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
Mar 05 21:53:34 media jellyfin[20465]: at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
Mar 05 21:53:34 media jellyfin[20465]: Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'no such column: u.EasyPassword'.
Mar 05 21:53:34 media jellyfin[20465]: [21:53:34] [FTL] [1] Main: Error while starting server.
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using bind exclusions: []
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using bind addresses: []
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using LAN addresses: [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN exclusions : []
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN addresses : [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Emby.Server.Implementations.ApplicationHost: Loading assemblies
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Setting cache path: /var/cache/jellyfin
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Jellyfin.Server.Migrations.MigrationRunner: Marking following migrations as applied because this is a fresh install: ["CreateNetworkConfiguration"]
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Main: Application directory: /usr/lib/jellyfin/
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Main: Web resources path: /usr/share/jellyfin-web
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Main: Program data path: /var/lib/jellyfin
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Main: Processor count: 4
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Main: User Interactive: True
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Main: 64-Bit Process: True
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Main: Architecture: X64
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Main: Operating system: Linux
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Main: Arguments: ["/usr/lib/jellyfin/jellyfin.dll", "--restartpath=/usr/lib/jellyfin/restart.sh", "--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg"]
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Main: Environment Variables: ["[JELLYFIN_FFMPEG_OPT, --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg]", "[JELLYFIN_RESTART_OPT, --restartpath=/usr/lib/jellyfin/restart.sh]", "[JELLYFIN_LOG_DIR, /var/log/jellyfin]", "[JELLYFIN_DATA_DIR, /var/lib/jellyfin]", "[JELLYFIN_CACHE_DIR, /var/cache/jellyfin]", "[JELLYFIN_CONFIG_DIR, /etc/jellyfin]"]
Mar 05 21:53:32 media jellyfin[20465]: [21:53:32] [INF] [1] Main: Jellyfin version: 10.8.13
Mar 05 21:53:32 media (jellyfin)[20465]: jellyfin.service: Referenced but unset environment variable evaluates to an empty string: JELLYFIN_ADDITIONAL_OPTS, JELLYFIN_NOWEBAPP_OPT, JELLYFIN_SERVICE_OPT, JELLYFIN_WEB_OPT
Mar 05 21:53:32 media systemd[1]: Started Jellyfin Media Server.
Mar 05 21:53:32 media systemd[1]: jellyfin.service: Scheduled restart job, restart counter is at 715.
Mar 05 21:53:32 media systemd[1]: jellyfin.service: Consumed 2.397s CPU time.
Mar 05 21:53:32 media systemd[1]: jellyfin.service: Failed with result 'core-dump'.
Mar 05 21:53:32 media systemd[1]: jellyfin.service: Main process exited, code=dumped, status=6/ABRT
Mar 05 21:53:31 media jellyfin[20438]: at Jellyfin.Server.Program.<Main>(String[] args)
Mar 05 21:53:31 media jellyfin[20438]: at Jellyfin.Server.Program.StartApp(StartupOptions options)
Mar 05 21:53:31 media jellyfin[20438]: at Emby.Server.Implementations.ApplicationHost.DisposeAsync()
Mar 05 21:53:31 media jellyfin[20438]: at Emby.Server.Implementations.ApplicationHost.DisposeAsyncCore()
Mar 05 21:53:31 media jellyfin[20438]: Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
Mar 05 21:53:31 media jellyfin[20438]: at Jellyfin.Server.Program.<Main>(String[] args)
Mar 05 21:53:31 media jellyfin[20438]: at Jellyfin.Server.Program.StartApp(StartupOptions options)
Mar 05 21:53:31 media jellyfin[20438]: at Emby.Server.Implementations.ApplicationHost.DisposeAsync()
Mar 05 21:53:31 media jellyfin[20438]: at Emby.Server.Implementations.ApplicationHost.DisposeAsyncCore()
Mar 05 21:53:31 media jellyfin[20438]: System.NullReferenceException: Object reference not set to an instance of an object.
Mar 05 21:53:31 media jellyfin[20438]: [21:53:31] [FTL] [1] Main: Unhandled Exception
Mar 05 21:53:31 media jellyfin[20438]: [21:53:31] [INF] [1] Emby.Server.Implementations.ApplicationHost: Disposing CoreAppHost
Mar 05 21:53:31 media jellyfin[20438]: [21:53:31] [INF] [1] Main: Running query planner optimizations in the database... This might take a while
Mar 05 21:53:31 media jellyfin[20438]: at Jellyfin.Server.Program.StartApp(StartupOptions options)
Mar 05 21:53:31 media jellyfin[20438]: at Emby.Server.Implementations.ApplicationHost.InitializeServices()
Mar 05 21:53:31 media jellyfin[20438]: at Emby.Server.Implementations.ApplicationHost.Resolve[T]()
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
Mar 05 21:53:31 media jellyfin[20438]: at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type serviceType)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
Mar 05 21:53:31 media jellyfin[20438]: at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
Mar 05 21:53:31 media jellyfin[20438]: at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
Mar 05 21:53:31 media jellyfin[20438]: at Jellyfin.Server.Implementations.Users.UserManager..ctor(JellyfinDbProvider dbProvider, IEventManager eventManager, ICryptoProvider cryptoProvider, INetworkManager networkManager, IApplicationHost appHost, IImageProcessor imageProcessor, ILogger`1 logger)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.EntityFrameworkCore.Storage.NonRetryingExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.<>c.<MoveNext>b__19_0(DbContext _, Enumerator enumerator)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.InitializeReader(Enumerator enumerator)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
Mar 05 21:53:31 media jellyfin[20438]: at System.Data.Common.DbCommand.ExecuteReader()
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Data.Sqlite.SqliteCommand.ExecuteDbDataReader(CommandBehavior behavior)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Data.Sqlite.SqliteCommand.GetStatements(Stopwatch timer)+MoveNext()
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements(Stopwatch timer)+MoveNext()
Mar 05 21:53:31 media jellyfin[20438]: at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
Mar 05 21:53:31 media jellyfin[20438]: Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 1: 'no such column: u.EasyPassword'.
Mar 05 21:53:31 media jellyfin[20438]: [21:53:31] [FTL] [1] Main: Error while starting server.
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using bind exclusions: []
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using bind addresses: []
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using LAN addresses: [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN exclusions : []
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN addresses : [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Emby.Server.Implementations.ApplicationHost: Loading assemblies
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Setting cache path: /var/cache/jellyfin
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Jellyfin.Server.Migrations.MigrationRunner: Marking following migrations as applied because this is a fresh install: ["CreateNetworkConfiguration"]
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Main: Application directory: /usr/lib/jellyfin/
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Main: Web resources path: /usr/share/jellyfin-web
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Main: Program data path: /var/lib/jellyfin
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Main: Processor count: 4
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Main: User Interactive: True
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Main: 64-Bit Process: True
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Main: Architecture: X64
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Main: Operating system: Linux
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Main: Arguments: ["/usr/lib/jellyfin/jellyfin.dll", "--restartpath=/usr/lib/jellyfin/restart.sh", "--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg"]
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Main: Environment Variables: ["[JELLYFIN_CONFIG_DIR, /etc/jellyfin]", "[JELLYFIN_FFMPEG_OPT, --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg]", "[JELLYFIN_RESTART_OPT, --restartpath=/usr/lib/jellyfin/restart.sh]", "[JELLYFIN_DATA_DIR, /var/lib/jellyfin]", "[JELLYFIN_CACHE_DIR, /var/cache/jellyfin]", "[JELLYFIN_LOG_DIR, /var/log/jellyfin]"]
Mar 05 21:53:29 media jellyfin[20438]: [21:53:29] [INF] [1] Main: Jellyfin version: 10.8.13
Mar 05 21:53:29 media (jellyfin)[20438]: jellyfin.service: Referenced but unset environment variable evaluates to an empty string: JELLYFIN_ADDITIONAL_OPTS, JELLYFIN_NOWEBAPP_OPT, JELLYFIN_SERVICE_OPT, JELLYFIN_WEB_OPT
Mar 05 21:53:29 media systemd[1]: Started Jellyfin Media Server.
Mar 05 21:53:28 media systemd[1]: jellyfin.service: Scheduled restart job, restart counter is at 714.
Mar 05 21:53:28 media systemd[1]: jellyfin.service: Consumed 2.414s CPU time.
Mar 05 21:53:28 media systemd[1]: jellyfin.service: Failed with result 'core-dump'.
Mar 05 21:53:28 media systemd[1]: jellyfin.service: Main process exited, code=dumped, status=6/ABRT
Mar 05 21:53:28 media jellyfin[20411]: at Jellyfin.Server.Program.<Main>(String[] args)
Mar 05 21:53:28 media jellyfin[20411]: at Jellyfin.Server.Program.StartApp(StartupOptions options)
Mar 05 21:53:28 media jellyfin[20411]: at Emby.Server.Implementations.ApplicationHost.DisposeAsync()
... and so on ad infinitum. The yellow errors are:
Code: jellyfin.service: Referenced but unset environment variable evaluates to an empty string: JELLYFIN_ADDITIONAL_OPTS, JELLYFIN_NOWEBAPP_OPT, JELLYFIN_SERVICE_OPT, JELLYFIN_WEB_OPT
Code: jellyfin.service: Failed with result 'core-dump'.
and
Code: jellyfin.service: Main process exited, code=dumped, status=6/ABRT
And that is as far as I've got - I'm curious to know what the next stages might be.
Some things that I don't think are relevant but mentioning just in case:- I'm using a Tailscale VPN to allow my other devices to access the server from different networks without having to open ports (but I've also tried a setup without Tailscale, and with firewall off / ports forwarded, and it was much the same)
- The server is headless and I'm installing / testing everything via ssh; I have also tried installing and running with a screen and keyboard physically on the server with no difference. The server is a Thinkcentre M710q micro PC connected to the modem with an ethernet cable.
- I also tried uninstalling and installing the AUR version (jellyfin-server-git etc) and had the same result
RE: Jellyfin constantly restarts when run as a service, works when run from a terminal - gnattu - 2024-03-05
Can you check if /var/lib/jellyfin exists and if the user jellyfin has read/write access to it?
It seems like Jellyfin failed to create its database
RE: Jellyfin constantly restarts when run as a service, works when run from a terminal - benhudson - 2024-03-07
Thanks for your reply - it does exist, and the permissions look okay to me:
Code: $ sudo ls -l /var/lib/jellyfin
total 24
drwxr-xr-x 2 jellyfin jellyfin 4096 Mar 4 16:08 config
drwxr-xr-x 4 jellyfin jellyfin 4096 Mar 5 14:08 data
drwxr-xr-x 2 jellyfin jellyfin 4096 Mar 5 02:00 log
drwxr-xr-x 6 jellyfin jellyfin 4096 Mar 4 17:14 metadata
drwxr-xr-x 3 jellyfin jellyfin 4096 Mar 4 16:01 plugins
drwxr-xr-x 3 jellyfin jellyfin 4096 Mar 4 16:01 root
Code: $ stat /var/lib/jellyfin
File: /var/lib/jellyfin
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 259,3 Inode: 6423159 Links: 9
Access: (0750/drwxr-x---) Uid: ( 972/jellyfin) Gid: ( 972/jellyfin)
Access: 2024-03-07 20:17:24.196642617 +0000
Modify: 2024-03-04 16:01:41.940285676 +0000
Change: 2024-03-05 21:14:13.917184036 +0000
Birth: 2024-03-04 15:59:56.456948530 +0000
RE: Jellyfin constantly restarts when run as a service, works when run from a terminal - TheDreadPirate - 2024-03-07
How is your disk partitioned? Just one big / partition? Or does /var have its own partition? How big is it? Did it fill up?
RE: Jellyfin constantly restarts when run as a service, works when run from a terminal - benhudson - 2024-03-07
It's one 469 GB root partition (plus 1MB BIOS boot partition and 8GB swap). There's less than 20GB on there at the moment, of which about 9G is in /var
RE: Jellyfin constantly restarts when run as a service, works when run from a terminal - TheDreadPirate - 2024-03-07
Can you try renaming /var/lib/jellyfin/data/jellyfin.db and library.db? So that it recreates them.
RE: Jellyfin constantly restarts when run as a service, works when run from a terminal - benhudson - 2024-03-07
Thanks for the suggestion - this seems to have fixed it. The service now starts on boot and runs stably, and it isn't necessary to start the process in the terminal.
There was one final odd thing - when I first went to the server address in a browser on my laptop (after doing the above), the server was displayed but when I clicked I got the new error "We're unable to connect to the selected server right now. Please ensure it is running and try again." Deleting the server and trying to re-add it didn't work either.
But after that I tried on the Android app which took me directly to the setup wizard, and once I had successfully gone through that I was able to log on in a new tab in the browser as well.
Thanks both for your help.
RE: Jellyfin constantly restarts when run as a service, works when run from a terminal - TheDreadPirate - 2024-03-08
That was almost certainly caused by browser caching.
|