Jellyfin Forum
SOLVED: Jellyfin service not starting - 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: SOLVED: Jellyfin service not starting (/t-solved-jellyfin-service-not-starting)

Pages: 1 2 3 4 5 6


RE: Jellyfin service not starting - parthkharia - 2024-07-21

Hello guys,
first time posting in this forum, i am not sure if your issues got fixed with these solutions or not, i tried all the aforementioned solutions but none worked for me.
finally i figured out what was causing the issue and thought to post the problem explanation here, maybe it'll help someone too

PROBLEM: Jellyfin server fails to start after system reboot even on fresh installations

EXPLANATION: In my case, it was caused due to bad permission to the jellyfin user. it was not able to access important files in the system.

SOLUTION: Run these codes on your server, if you have changed the directories of jellyfin, please adjust accordingly

sudo chown -R jellyfin:jellyfin /var/lib/jellyfin
sudo chmod -R 755 /var/lib/jellyfin

sudo chown -R jellyfin:jellyfin /var/cache/jellyfin
sudo chmod -R 755 /var/cache/jellyfin

sudo chown -R jellyfin:jellyfin /var/log/jellyfin
sudo chmod -R 755 /var/log/jellyfin

(if "/var/log/jellyfin" does not exist, use "mkdir" to create the directory then run the above two lines again)

This fixed it for me, now my system properly reboots and i don't have to worry about jellyfin crashing again. I hope it will help someone else too, if the moderators of the thread can please verify if this is a proper solution and mark it such way it would be helpful for many people

Good Day!
Regards


RE: Jellyfin service not starting - parthkharia - 2024-07-21

(2024-07-21, 04:47 PM)parthkharia Wrote: Hello guys,
first time posting in this forum, i am not sure if your issues got fixed with these solutions or not, i tried all the aforementioned solutions but none worked for me.
finally i figured out what was causing the issue and thought to post the problem explanation here, maybe it'll help someone too

PROBLEM: Jellyfin server fails to start after system reboot even on fresh installations

EXPLANATION: In my case, it was caused due to bad permission to the jellyfin user. it was not able to access important files in the system.

SOLUTION: Run these codes on your server, if you have changed the directories of jellyfin, please adjust accordingly

sudo chown -R jellyfin:jellyfin /var/lib/jellyfin
sudo chmod -R 755 /var/lib/jellyfin

sudo chown -R jellyfin:jellyfin /var/cache/jellyfin
sudo chmod -R 755 /var/cache/jellyfin

sudo chown -R jellyfin:jellyfin /var/log/jellyfin
sudo chmod -R 755 /var/log/jellyfin

(if "/var/log/jellyfin" does not exist, use "mkdir" to create the directory then run the above two lines again)

This fixed it for me, now my system properly reboots and i don't have to worry about jellyfin crashing again. I hope it will help someone else too, if the moderators of the thread can please verify if this is a proper solution and mark it such way it would be helpful for many people

Good Day!
Regards

Small correction:
another reason was that /var/log/jellyfin was getting deleted during each boot, to fix this i added this to jellyfin configuration:

1. open jellyfin configuration using: sudo nano /lib/systemd/system/jellyfin.service

2. add these lines before " ExecStart=/usr/bin/jellyfin " line: 
  • ExecStartPre=/bin/mkdir -p /var/log/jellyfin 
  • ExecStartPre=/bin/chown jellyfin:jellyfin /var/log/jellyfin

3. reload daemon using: sudo systemctl daemon-reload

4. restart jellyfin using: sudo systemctl restart jellyfin.service

You won't have any issues again!


RE: Jellyfin service not starting - dmf - 2024-08-27

I had the same problem and nothing in the thread so far helped but I managed to fix it. 
I ran
Code:
sudo journalctl -u jellyfin
which basically told me that access to the path '/etc/jellyfin/logging.default.json' is denied.
I used
Code:
sudo chown -R jellyfin:jellyfin /etc/jellfin
and
Code:
sudo chmod -R 755 /etc/jellyfin
to modify permissions and it basically fixed it.

If nothing in this thread seems to work just run the first command, it may give you more clues as to what is wrong. Hope it helps.


RE: Jellyfin service not starting - alanf - 2024-08-28

I just installed jellyfin with the official script (curl + bash) on Ubuntu 22.04 amd64.

I got a similar problem, jellyfin wouldn't start, and I had to chown -R jellyfin:jellyfin /etc/jellyfin in order to make it work.

This is the initial state:


root@microserverConfused-face# ls -ld /etc/jellyfin
drwxr-xr-x 2 jellyfin adm 4096 Aug 28 06:25 /etc/jellyfin
root@microserverConfused-face# cd /etc/jellyfin/
root@microserverConfused-faceetc/jellyfin# ls
logging.json
root@microserverConfused-faceetc/jellyfin# ls -l
total 4
-rw-r--r-- 1 jellyfin adm 1040 Aug 25 06:38 logging.json


Perplexed:
it seems that jellyfin requires rw access to the config directory; most config files are written by jellyfin on start, rather than just read;

why does it not start with the default install script? looks like a bug to me.


RE: Jellyfin service not starting - TheDreadPirate - 2024-08-28

@alanf @dmf

There is a known issue for fresh installs where the apt package isn't resetting permissions on key directories. The work around is to manually set permissions.

Code:
sudo chown -R jellyfin: /var/lib/jellyfin /etc/jellyfin /var/cache/jellyfin /usr/share/jellyfin
sudo systemctl restart jellyfin

A hotfix release is being worked to resolve this.


RE: Jellyfin service not starting - umunas - 2024-08-28

(2024-08-28, 02:24 PM)TheDreadPirate Wrote: @alanf @dmf

There is a known issue for fresh installs where the apt package isn't resetting permissions on key directories.  The work around is to manually set permissions.

Code:
sudo chown -R jellyfin: /var/lib/jellyfin /etc/jellyfin /var/cache/jellyfin /usr/share/jellyfin
sudo systemctl restart jellyfin

A hotfix release is being worked to resolve this.

Still not working for me:

Code:
Aug 28 20:15:11 jellyfin systemd[1]: jellyfin.service: Main process exited, code=killed, status=6/ABRT
Aug 28 20:15:11 jellyfin systemd[1]: jellyfin.service: Failed with result 'signal'.
Aug 28 20:15:11 jellyfin systemd[1]: jellyfin.service: Scheduled restart job, restart counter is at 5.
Aug 28 20:15:11 jellyfin systemd[1]: Stopped jellyfin.service - Jellyfin Media Server.
Aug 28 20:15:11 jellyfin systemd[1]: jellyfin.service: Start request repeated too quickly.
Aug 28 20:15:11 jellyfin systemd[1]: jellyfin.service: Failed with result 'signal'.
Aug 28 20:15:11 jellyfin systemd[1]: Failed to start jellyfin.service - Jellyfin Media Server.

Code:
20:24:08] [ERR] [1] Main: The server is expected to host the web client, but the provided content directory is either invalid or empty: /usr/lib/jellyfin/bin/jellyfin-web. If you do not want to host the web client with the server, you may set the '--nowebclient' command line flag, or set'hostwebclient=false' in your config settings

I am playing with Jellyfin in Proxmox LXCs (without Docker!!!). It is a bit of a journey. Jellyfin installs just stopped working from the moment of installation due to 'jellyfin-web' errors. This started last weekend. I always used 'extrepo' previously. Today I tried 'bash install-debuntu.sh' and it worked! Until it didn't... But at least it took few reboots until it broke...


RE: Jellyfin service not starting - TheDreadPirate - 2024-08-28

(2024-08-28, 08:32 PM)umunas Wrote:
Code:
20:24:08] [ERR] [1] Main: The server is expected to host the web client, but the provided content directory is either invalid or empty: /usr/lib/jellyfin/bin/jellyfin-web. If you do not want to host the web client with the server, you may set the '--nowebclient' command line flag, or set'hostwebclient=false' in your config settings

How are you starting Jellyfin?  If you are simply typing in "jellyfin", that is not how you start Jellyfin.

Code:
sudo systemctl start jellyfin

If that doesn't work, can you share the output of this command via pastebin?

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



RE: Jellyfin service not starting - umunas - 2024-08-28

(2024-08-28, 09:23 PM)TheDreadPirate Wrote: How are you starting Jellyfin?  If you are simply typing in "jellyfin", that is not how you start Jellyfin.

Code:
sudo systemctl start jellyfin

If that doesn't work, can you share the output of this command via pastebin?

Code:
sudo journalctl -u jellyfin -n 200 --no-pager
I never had to start jellyfin manually. Only restart. This is only the result of experimentation after web server became unavalable.

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

Result: https://pastebin.com/N2dEayNu

BTW., I am not kidding, I tried at least 10 fresh LXCs and fresh Jellyfin installs and the result is mostly the same. I could try tomorrow few more times just to be sure.


RE: Jellyfin service not starting - TheDreadPirate - 2024-08-28

Did your disk run out of space at some point (in the LXC). Go to /etc/jellyfin in the LXC and if migrations.xml is zero bytes, delete the file and restart Jellyfin.


RE: Jellyfin service not starting - umunas - 2024-08-29

(2024-08-28, 11:18 PM)TheDreadPirate Wrote: Did your disk run out of space at some point (in the LXC).  Go to /etc/jellyfin in the LXC and if migrations.xml is zero bytes, delete the file and restart Jellyfin.
Not sure if I run out of space, but only ~1GB was left. Fixed that. 

https://pastebin.com/0ZrYxBbt