For some reason, my main admin account would lost admin rights every time jellyfin restarted.

Firstly, grab your user account's GUID:

sqlite3 /var/lib/jellyfin/data/jellyfin.db "select id from users where username='REPLACE';"

Then, the following fixed it:

  • nano /etc/jellyfix.bash
#!/bin/bash
set -e

DBPATH="/var/lib/jellyfin/data/jellyfin.db"
USERID="'YOU_USER_ACCOUNT_GUID'"

CURRENT_VALUE=$(sqlite3 "$DBPATH" "select value FROM permissions where kind=0 and permission_permissions_guid=$USERID;")

echo "Result: $CURRENT_VALUE"

if [[ "$CURRENT_VALUE" -eq '0' ]]; then
  echo -e "##################### FIXING ADMIN USER PERMISSIONS #####################";
  echo sqlite3 "$DBPATH" "update permissions set value=1 where kind=0 and permission_permissions_guid=$USERID;";
else
  echo -e "Permissions don't need fixing."
fi
  • chmod a+x /etc/jellyfix.bash
  • systemctl edit jellyfin.service
[Service]
ExecStartPre=+/etc/jellyfix.bash
  • systemctl restart jellyfin.service

Reference: https://github.com/jellyfin/jellyfin-web/issues/1989