Jellyfin Forum
Permissions issue: cannot start jellyfin.service after changing JELLYFIN_DATA_DIR - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: Permissions issue: cannot start jellyfin.service after changing JELLYFIN_DATA_DIR (/t-permissions-issue-cannot-start-jellyfin-service-after-changing-jellyfin-data-dir)



Permissions issue: cannot start jellyfin.service after changing JELLYFIN_DATA_DIR - alexauran - 2025-01-07

Jellyfin 10.10.3

Clean install on debian 12 in a proxmox VM using repo

I'm having trouble changing JELLYFIN_DATA_DIR.  I want it in a sub-folder in my user's (micro) home folder:

/home/micro/.databases/jellyfin

Here are all of my commands from a clean install.
Code:
sudo apt install -y extrepo
sudo extrepo enable jellyfin
sudo apt update
sudo apt upgrade -y
sudo apt install -y jellyfin

#verified jellyfin runs correctly through web; welcome/setup screen is accessible

sudo systemctl stop jellyfin
sudo usermod -aG micro jellyfin
sudo mkdir -pv /home/micro/.databases/jellyfin
sudo chown -Rv jellyfin:jellyfin /home/micro/.databases/jellyfin
sudo chmod -Rv 775 /home/micro/.databases
sudo chmod -Rv 775 /home/micro/.databases/jellyfin
sudo sed -i 's@/var/lib/jellyfin@/home/micro/.databases/jellyfin@g' /etc/default/jellyfin

#I have edited JELLYFIN_DATA_DIR using sed -i and manually; both files are identical
sudo systemctl start jellyfin
sudo systemctl status jellyfin

I expect the jellyfin.service to start and store the metadata in /home/micro/.databases/jellyfin.  What I got was:

Code:
× jellyfin.service - Jellyfin Media Server
    Loaded: loaded (/lib/systemd/system/jellyfin.service; enabled; preset: enabled)
    Drop-In: /etc/systemd/system/jellyfin.service.d
            └─jellyfin.service.conf
    Active: failed (Result: signal) since Tue 2025-01-07 00:51:36 CST; 2min 32s ago
  Duration: 184ms
    Process: 2809 ExecStart=/usr/bin/jellyfin $JELLYFIN_WEB_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLYFIN_ADDITIONAL_OPTS (code=killed, signal=ABRT)
  Main PID: 2809 (code=killed, signal=ABRT)
        CPU: 155ms

Jan 07 00:51:36 debian systemd[1]: jellyfin.service: Scheduled restart job, restart counter is at 5.
Jan 07 00:51:36 debian systemd[1]: Stopped jellyfin.service - Jellyfin Media Server.
Jan 07 00:51:36 debian systemd[1]: jellyfin.service: Start request repeated too quickly.
Jan 07 00:51:36 debian systemd[1]: jellyfin.service: Failed with result 'signal'.
Jan 07 00:51:36 debian systemd[1]: Failed to start jellyfin.service - Jellyfin Media Server.

Code:
micro@debian:~$ sudo journalctl -xeu jellyfin.service
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ Automatic restarting of the unit jellyfin.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Jan 07 00:51:36 debian systemd[1]: Stopped jellyfin.service - Jellyfin Media Server.
░░ Subject: A stop job for unit jellyfin.service has finished
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A stop job for unit jellyfin.service has finished.
░░
░░ The job identifier is 1242 and the job result is done.
Jan 07 00:51:36 debian systemd[1]: jellyfin.service: Start request repeated too quickly.
Jan 07 00:51:36 debian systemd[1]: jellyfin.service: Failed with result 'signal'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ The unit jellyfin.service has entered the 'failed' state with result 'signal'.
Jan 07 00:51:36 debian systemd[1]: Failed to start jellyfin.service - Jellyfin Media Server.
░░ Subject: A start job for unit jellyfin.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░
░░ A start job for unit jellyfin.service has finished with a failure.
░░
░░ The job identifier is 1242 and the job result is failed.


Code:
micro@debian:~/.databases$ stat /home/micro/.databases
  File: /home/micro/.databases
  Size: 4096            Blocks: 8          IO Block: 4096  directory
Device: 8,1    Inode: 1438999    Links: 3
Access: (0775/drwxrwxr-x)  Uid: (  102/jellyfin)  Gid: (  109/jellyfin)
Access: 2025-01-07 04:12:57.416128083 -0600
Modify: 2025-01-07 00:25:29.895040310 -0600
Change: 2025-01-07 00:26:34.643406271 -0600
Birth: 2025-01-07 00:25:29.895040310 -0600
micro@debian:~/.databases$ stat /home/micro/.databases/jellyfin
  File: /home/micro/.databases/jellyfin
  Size: 4096            Blocks: 8          IO Block: 4096  directory
Device: 8,1    Inode: 1439010    Links: 6
Access: (0775/drwxrwxr-x)  Uid: (  102/jellyfin)  Gid: (  109/jellyfin)
Access: 2025-01-07 00:54:03.724870806 -0600
Modify: 2025-01-07 00:59:47.799622262 -0600
Change: 2025-01-07 00:59:47.799622262 -0600
Birth: 2025-01-07 00:25:29.895040310 -0600
micro@debian:~/.databases$ id jellyfin
uid=102(jellyfin) gid=109(jellyfin) groups=109(jellyfin),44(video),105(render),1000(micro)
It runs from the new data directory if I edit /lib/systemd/system/jellyfin.service to:
User = root
Group = root

Any ideas?  I've been at it for hours, thanks!


RE: Permissions issue: cannot start jellyfin.service after changing JELLYFIN_DATA_DIR - TheDreadPirate - 2025-01-07

Share the output of these commands via pastebin.

Code:
sudo journalctl -u jellyfin -n 200 --no-pager
sudo systemctl show jellyfin



RE: Permissions issue: cannot start jellyfin.service after changing JELLYFIN_DATA_DIR - alexauran - 2025-01-07

First, thanks for your time and help!

Code:
micro@debian:~/.databases$ sudo journalctl -u jellyfin -n 200 --no-pager
Jan 07 10:45:51 debian systemd[1]: jellyfin.service: Scheduled restart job, restart counter is at 3.
Jan 07 10:45:51 debian systemd[1]: Stopped jellyfin.service - Jellyfin Media Server.
Jan 07 10:45:51 debian systemd[1]: jellyfin.service: Consumed 1.818s CPU time.
Jan 07 10:45:51 debian systemd[1]: Started jellyfin.service - Jellyfin Media Server.
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Jellyfin version: 10.10.3
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Environment Variables: ["[JELLYFIN_USER, jellyfin]", "[JELLYFIN_WEB_OPT, --webdir=/usr/share/jellyfin/web]", "[JELLYFIN_DATA_DIR, /home/micro/.databases/jellyfin]", "[JELLYFIN_FFMPEG_OPT, --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg]", "[JELLYFIN_ADDITIONAL_OPTS, ]", "[JELLYFIN_LOG_DIR, /var/log/jellyfin]", "[JELLYFIN_ARGS, $JELLYFIN_WEB_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLFIN_ADDITIONAL_OPTS --datadir $JELLYFIN_DATA_DIR --configdir $JELLYFIN_CONFIG_DIR --logdir $JELLYFIN_LOG_DIR --cachedir $JELLYFIN_CACHE_DIR]", "[JELLYFIN_CONFIG_DIR, /etc/jellyfin]", "[JELLYFIN_CACHE_DIR, /var/cache/jellyfin]"]
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Arguments: ["/usr/lib/jellyfin/bin/jellyfin.dll", "--webdir=/usr/share/jellyfin/web", "--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg"]
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Operating system: Debian GNU/Linux 12 (bookworm)
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Architecture: X64
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] 64-Bit Process: True
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] User Interactive: True
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Processor count: 12
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Program data path: /home/micro/.databases/jellyfin
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Log directory path: /var/log/jellyfin
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Config directory path: /etc/jellyfin
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Cache path: /var/cache/jellyfin
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Temp directory path: /tmp/jellyfin
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Web resources path: /usr/share/jellyfin/web
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Application directory: /usr/lib/jellyfin/bin/
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Marking following migrations as applied because this is a fresh install: ["CreateNetworkConfiguration", "MigrateMusicBrainzTimeout", "MigrateNetworkConfiguration", "MigrateEncodingOptions"]
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Setting cache path: /var/cache/jellyfin
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Loading assemblies
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Defined LAN subnets: ["127.0.0.1/8", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Defined LAN exclusions: []
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Used LAN subnets: ["127.0.0.1/8", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Filtered interface addresses: ["127.0.0.1", "192.168.9.48"]
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Bind Addresses ["0.0.0.0"]
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Remote IP filter is Allowlist
Jan 07 10:45:51 debian jellyfin[5486]: [10:45:51] [INF] Filtered subnets: []
Jan 07 10:45:52 debian jellyfin[5486]: [10:45:52] [ERR] Failed executing DbCommand (8ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
Jan 07 10:45:52 debian jellyfin[5486]: SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
Jan 07 10:45:52 debian jellyfin[5486]: [10:45:52] [FTL] Error while starting server
Jan 07 10:45:52 debian jellyfin[5486]: Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 8: 'attempt to write a readonly database'.
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements()+MoveNext()
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteCommand.GetStatements()+MoveNext()
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteScalar()
Jan 07 10:45:52 debian jellyfin[5486]:    at System.Data.Common.DbCommand.ExecuteScalarAsync(CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]: --- End of stack trace from previous location ---
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteScalarAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteScalarAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteScalarAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.ExistsAsync(CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.GetAppliedMigrationsAsync(CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.GetAppliedMigrationsAsync(DatabaseFacade databaseFacade, CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.GetPendingMigrationsAsync(DatabaseFacade databaseFacade, CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]:    at Emby.Server.Implementations.ApplicationHost.InitializeServices()
Jan 07 10:45:52 debian jellyfin[5486]:    at Emby.Server.Implementations.ApplicationHost.InitializeServices()
Jan 07 10:45:52 debian jellyfin[5486]:    at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)
Jan 07 10:45:52 debian jellyfin[5486]: [10:45:52] [INF] Running query planner optimizations in the database... This might take a while
Jan 07 10:45:52 debian jellyfin[5486]: [10:45:52] [ERR] Failed executing DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
Jan 07 10:45:52 debian jellyfin[5486]: PRAGMA optimize
Jan 07 10:45:52 debian jellyfin[5486]: [10:45:52] [INF] Disposing CoreAppHost
Jan 07 10:45:52 debian jellyfin[5486]: [10:45:52] [INF] Disposing PluginManager
Jan 07 10:45:52 debian jellyfin[5486]: [10:45:52] [FTL] Unhandled Exception
Jan 07 10:45:52 debian jellyfin[5486]: Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 8: 'attempt to write a readonly database'.
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements()+MoveNext()
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteCommand.GetStatements()+MoveNext()
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
Jan 07 10:45:52 debian jellyfin[5486]:    at System.Data.Common.DbCommand.ExecuteNonQueryAsync(CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]: --- End of stack trace from previous location ---
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.ExecuteSqlRawAsync(DatabaseFacade databaseFacade, String sql, IEnumerable`1 parameters, CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]:    at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)
Jan 07 10:45:52 debian jellyfin[5486]:    at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)
Jan 07 10:45:52 debian jellyfin[5486]:    at Jellyfin.Server.Program.StartApp(StartupOptions options)
Jan 07 10:45:52 debian jellyfin[5486]:    at Jellyfin.Server.Program.<Main>(String[] args)
Jan 07 10:45:52 debian jellyfin[5486]: Unhandled exception. Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 8: 'attempt to write a readonly database'.
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements()+MoveNext()
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteCommand.GetStatements()+MoveNext()
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
Jan 07 10:45:52 debian jellyfin[5486]:    at System.Data.Common.DbCommand.ExecuteNonQueryAsync(CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]: --- End of stack trace from previous location ---
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]:    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.ExecuteSqlRawAsync(DatabaseFacade databaseFacade, String sql, IEnumerable`1 parameters, CancellationToken cancellationToken)
Jan 07 10:45:52 debian jellyfin[5486]:    at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)
Jan 07 10:45:52 debian jellyfin[5486]:    at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)
Jan 07 10:45:52 debian jellyfin[5486]:    at Jellyfin.Server.Program.StartApp(StartupOptions options)
Jan 07 10:45:52 debian jellyfin[5486]:    at Jellyfin.Server.Program.<Main>(String[] args)
Jan 07 10:45:52 debian systemd[1]: jellyfin.service: Main process exited, code=killed, status=6/ABRT
Jan 07 10:45:52 debian systemd[1]: jellyfin.service: Failed with result 'signal'.
Jan 07 10:45:52 debian systemd[1]: jellyfin.service: Consumed 1.782s CPU time.
Jan 07 10:45:53 debian systemd[1]: jellyfin.service: Scheduled restart job, restart counter is at 4.
Jan 07 10:45:53 debian systemd[1]: Stopped jellyfin.service - Jellyfin Media Server.
Jan 07 10:45:53 debian systemd[1]: jellyfin.service: Consumed 1.782s CPU time.
Jan 07 10:45:53 debian systemd[1]: Started jellyfin.service - Jellyfin Media Server.
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Jellyfin version: 10.10.3
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Environment Variables: ["[JELLYFIN_WEB_OPT, --webdir=/usr/share/jellyfin/web]", "[JELLYFIN_CONFIG_DIR, /etc/jellyfin]", "[JELLYFIN_USER, jellyfin]", "[JELLYFIN_FFMPEG_OPT, --ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg]", "[JELLYFIN_ARGS, $JELLYFIN_WEB_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLFIN_ADDITIONAL_OPTS --datadir $JELLYFIN_DATA_DIR --configdir $JELLYFIN_CONFIG_DIR --logdir $JELLYFIN_LOG_DIR --cachedir $JELLYFIN_CACHE_DIR]", "[JELLYFIN_DATA_DIR, /home/micro/.databases/jellyfin]", "[JELLYFIN_ADDITIONAL_OPTS, ]", "[JELLYFIN_CACHE_DIR, /var/cache/jellyfin]", "[JELLYFIN_LOG_DIR, /var/log/jellyfin]"]
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Arguments: ["/usr/lib/jellyfin/bin/jellyfin.dll", "--webdir=/usr/share/jellyfin/web", "--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg"]
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Operating system: Debian GNU/Linux 12 (bookworm)
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Architecture: X64
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] 64-Bit Process: True
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] User Interactive: True
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Processor count: 12
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Program data path: /home/micro/.databases/jellyfin
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Log directory path: /var/log/jellyfin
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Config directory path: /etc/jellyfin
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Cache path: /var/cache/jellyfin
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Temp directory path: /tmp/jellyfin
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Web resources path: /usr/share/jellyfin/web
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Application directory: /usr/lib/jellyfin/bin/
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Marking following migrations as applied because this is a fresh install: ["CreateNetworkConfiguration", "MigrateMusicBrainzTimeout", "MigrateNetworkConfiguration", "MigrateEncodingOptions"]
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Setting cache path: /var/cache/jellyfin
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Loading assemblies
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Defined LAN subnets: ["127.0.0.1/8", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Defined LAN exclusions: []
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Used LAN subnets: ["127.0.0.1/8", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Filtered interface addresses: ["127.0.0.1", "192.168.9.48"]
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Bind Addresses ["0.0.0.0"]
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Remote IP filter is Allowlist
Jan 07 10:45:53 debian jellyfin[5508]: [10:45:53] [INF] Filtered subnets: []
Jan 07 10:45:54 debian jellyfin[5508]: [10:45:54] [ERR] Failed executing DbCommand (9ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
Jan 07 10:45:54 debian jellyfin[5508]: SELECT COUNT(*) FROM "sqlite_master" WHERE "name" = '__EFMigrationsHistory' AND "type" = 'table';
Jan 07 10:45:54 debian jellyfin[5508]: [10:45:54] [FTL] Error while starting server
Jan 07 10:45:54 debian jellyfin[5508]: Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 8: 'attempt to write a readonly database'.
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements()+MoveNext()
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteCommand.GetStatements()+MoveNext()
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteScalar()
Jan 07 10:45:54 debian jellyfin[5508]:    at System.Data.Common.DbCommand.ExecuteScalarAsync(CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]: --- End of stack trace from previous location ---
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteScalarAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteScalarAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteScalarAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.ExistsAsync(CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.GetAppliedMigrationsAsync(CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.GetAppliedMigrationsAsync(DatabaseFacade databaseFacade, CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.GetPendingMigrationsAsync(DatabaseFacade databaseFacade, CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]:    at Emby.Server.Implementations.ApplicationHost.InitializeServices()
Jan 07 10:45:54 debian jellyfin[5508]:    at Emby.Server.Implementations.ApplicationHost.InitializeServices()
Jan 07 10:45:54 debian jellyfin[5508]:    at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)
Jan 07 10:45:54 debian jellyfin[5508]: [10:45:54] [INF] Running query planner optimizations in the database... This might take a while
Jan 07 10:45:54 debian jellyfin[5508]: [10:45:54] [ERR] Failed executing DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
Jan 07 10:45:54 debian jellyfin[5508]: PRAGMA optimize
Jan 07 10:45:54 debian jellyfin[5508]: [10:45:54] [INF] Disposing CoreAppHost
Jan 07 10:45:54 debian jellyfin[5508]: [10:45:54] [INF] Disposing PluginManager
Jan 07 10:45:54 debian jellyfin[5508]: [10:45:54] [FTL] Unhandled Exception
Jan 07 10:45:54 debian jellyfin[5508]: Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 8: 'attempt to write a readonly database'.
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements()+MoveNext()
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteCommand.GetStatements()+MoveNext()
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
Jan 07 10:45:54 debian jellyfin[5508]:    at System.Data.Common.DbCommand.ExecuteNonQueryAsync(CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]: --- End of stack trace from previous location ---
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.ExecuteSqlRawAsync(DatabaseFacade databaseFacade, String sql, IEnumerable`1 parameters, CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]:    at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)
Jan 07 10:45:54 debian jellyfin[5508]:    at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)
Jan 07 10:45:54 debian jellyfin[5508]:    at Jellyfin.Server.Program.StartApp(StartupOptions options)
Jan 07 10:45:54 debian jellyfin[5508]:    at Jellyfin.Server.Program.<Main>(String[] args)
Jan 07 10:45:54 debian jellyfin[5508]: Unhandled exception. Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 8: 'attempt to write a readonly database'.
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteCommand.PrepareAndEnumerateStatements()+MoveNext()
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteCommand.GetStatements()+MoveNext()
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
Jan 07 10:45:54 debian jellyfin[5508]:    at System.Data.Common.DbCommand.ExecuteNonQueryAsync(CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]: --- End of stack trace from previous location ---
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]:    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.ExecuteSqlRawAsync(DatabaseFacade databaseFacade, String sql, IEnumerable`1 parameters, CancellationToken cancellationToken)
Jan 07 10:45:54 debian jellyfin[5508]:    at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)
Jan 07 10:45:54 debian jellyfin[5508]:    at Jellyfin.Server.Program.StartServer(IServerApplicationPaths appPaths, StartupOptions options, IConfiguration startupConfig)
Jan 07 10:45:54 debian jellyfin[5508]:    at Jellyfin.Server.Program.StartApp(StartupOptions options)
Jan 07 10:45:54 debian jellyfin[5508]:    at Jellyfin.Server.Program.<Main>(String[] args)
Jan 07 10:45:54 debian systemd[1]: jellyfin.service: Main process exited, code=killed, status=6/ABRT
Jan 07 10:45:54 debian systemd[1]: jellyfin.service: Failed with result 'signal'.
Jan 07 10:45:54 debian systemd[1]: jellyfin.service: Consumed 1.811s CPU time.
Jan 07 10:45:55 debian systemd[1]: jellyfin.service: Scheduled restart job, restart counter is at 5.
Jan 07 10:45:55 debian systemd[1]: Stopped jellyfin.service - Jellyfin Media Server.
Jan 07 10:45:55 debian systemd[1]: jellyfin.service: Consumed 1.811s CPU time.
Jan 07 10:45:55 debian systemd[1]: jellyfin.service: Start request repeated too quickly.
Jan 07 10:45:55 debian systemd[1]: jellyfin.service: Failed with result 'signal'.
Jan 07 10:45:55 debian systemd[1]: Failed to start jellyfin.service - Jellyfin Media Server.

Code:
micro@debian:~/.databases$ sudo systemctl show jellyfin
Type=simple
ExitType=main
Restart=on-failure
NotifyAccess=none
RestartUSec=100ms
TimeoutStartUSec=15s
TimeoutStopUSec=15s
TimeoutAbortUSec=15s
TimeoutStartFailureMode=terminate
TimeoutStopFailureMode=terminate
RuntimeMaxUSec=infinity
RuntimeRandomizedExtraUSec=0
WatchdogUSec=0
WatchdogTimestampMonotonic=0
RootDirectoryStartOnly=no
RemainAfterExit=no
GuessMainPID=yes
SuccessExitStatus=0 143
MainPID=0
ControlPID=0
FileDescriptorStoreMax=0
NFileDescriptorStore=0
StatusErrno=0
Result=signal
ReloadResult=success
CleanResult=success
UID=[not set]
GID=[not set]
NRestarts=5
OOMPolicy=stop
ExecMainStartTimestamp=Tue 2025-01-07 10:45:53 CST
ExecMainStartTimestampMonotonic=37386820588
ExecMainExitTimestamp=Tue 2025-01-07 10:45:54 CST
ExecMainExitTimestampMonotonic=37388603758
ExecMainPID=5508
ExecMainCode=2
ExecMainStatus=6
ExecStart={ path=/usr/bin/jellyfin ; argv[]=/usr/bin/jellyfin $JELLYFIN_WEB_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLYFIN_ADDITIONAL_OPTS ; ignore_errors=no ; start_time=[Tue 2025-01-07 10:45:53 CST] ; stop_time=[Tue>
ExecStartEx={ path=/usr/bin/jellyfin ; argv[]=/usr/bin/jellyfin $JELLYFIN_WEB_OPT $JELLYFIN_FFMPEG_OPT $JELLYFIN_SERVICE_OPT $JELLYFIN_NOWEBAPP_OPT $JELLYFIN_ADDITIONAL_OPTS ; flags= ; start_time=[Tue 2025-01-07 10:45:53 CST] ; stop_time=[Tue 2025-01>
Slice=system.slice
ControlGroupId=4412
MemoryCurrent=[not set]
MemoryAvailable=infinity
CPUUsageNSec=1811462000
TasksCurrent=[not set]
IPIngressBytes=[no data]
IPIngressPackets=[no data]
IPEgressBytes=[no data]
IPEgressPackets=[no data]
IOReadBytes=18446744073709551615
IOReadOperations=18446744073709551615
IOWriteBytes=18446744073709551615
IOWriteOperations=18446744073709551615
Delegate=no
CPUAccounting=yes
CPUWeight=[not set]
StartupCPUWeight=[not set]
CPUShares=[not set]
StartupCPUShares=[not set]
CPUQuotaPerSecUSec=infinity
CPUQuotaPeriodUSec=infinity
IOAccounting=no
IOWeight=[not set]
StartupIOWeight=[not set]
BlockIOAccounting=no
BlockIOWeight=[not set]
StartupBlockIOWeight=[not set]
MemoryAccounting=yes
DefaultMemoryLow=0



RE: Permissions issue: cannot start jellyfin.service after changing JELLYFIN_DATA_DIR - alexauran - 2025-01-07

Sorry, I missed the pastebin request

sudo journalctl -u jellyfin -n 200 --no-pager
sudo systemctl show jellyfin

https://pastebin.com/YaSP3v2s


RE: Permissions issue: cannot start jellyfin.service after changing JELLYFIN_DATA_DIR - TheDreadPirate - 2025-01-07

Not sure why this didn't occur to me sooner. The service should run as you and not as jellyfin or root.

Any particular reason you want Jellyfin's data to be in your home and not in the default location?


RE: Permissions issue: cannot start jellyfin.service after changing JELLYFIN_DATA_DIR - alexauran - 2025-01-07

I've tried running as micro (my user) with the following results:
https://pastebin.com/EF2LW3qk

I'm running proxmox on a poweredge r740xd with jellyfin in a debian VM, with a truenas VM acting as a NAS holding my media on 10 HDDs via proxmox passthrough to the truenas VM.  This works great; my LAN pcs think the truenas VM is an appliance, and my VMs on the same machine connect to it via cifs, but with near local disk access speeds.  I get my storage with parity on Raidz2 with all of my VMs and LAN sharing it nicely.  All of the VMs run from an 800Gb enterprise SSD which I don't want to clog up with low priority metadata.  I originally tried to put my data dir on the truenas, since it's local physically, but I assume the small delay of the truenas disk controller/manager made plex and jellyfin upset, because they were crawling.  My next thought was to consolidate all of my large metadata folders from programs like plex and jellyfin to one location, mount that folder via fstab to a large HDD (visible in the VM via a passthrough in proxmox) that is separate from the truenas.  The HDD is empty so there are no capacity issues, and if I need to rebuild the jellyfin/media VM then the metadata is on a separate drive which I can backup, I spin up the new VM, pass the drive through to the new VM, and then point JELLYFIN_DATA_DIR at it.  That way I don't have to do all the setup again and generate all the thumbnails, etc.  I'm new to linux so this may be dumb or inefficient.  This setup seemingly works with plex (/home/micro/.databases/plexmediaserver) in the same debian vm (haven't rebuilt the vm to fully test it yet.)  Now, it's just become my white whale for learning linux better.  If this is a bad idea, I'm all ears.


RE: Permissions issue: cannot start jellyfin.service after changing JELLYFIN_DATA_DIR - TheDreadPirate - 2025-01-07

This is very convoluted.

Jellyfin metadata should be on a local disk, preferably a SSD but a HDD is ok. The database should be on a local SSD. IMO, to get the result you want it may be better to have Jellyfin save all your images and trickplays with the media (there is a setting when setting up libraries to do this).

You would need to chown all of Jellyfin's binary directories to run as your user. But, IMO, saving your images and trickplays would cut down on most of the data usage when using the standard data directory.

Code:
sudo chown -R micro /usr/bin/jellyfin /var/cache/jellyfin /usr/share/jellyfin /etc/jellyfin