jellyfin / jellyfin-server-windows

The Windows tray app and installer for Jellyfin Server on Windows.
https://jellyfin.org
MIT License
80 stars 27 forks source link

Jellyfin not starting with JellyfinTray.exe #18

Closed ketanarlulkar closed 4 years ago

ketanarlulkar commented 4 years ago

I just installed Jellyfin with basic setup. When clicked on JellyfinTray.exe, Jellyfin won't start. So clicked on jellyfin.exe, saw following error on the command prompt. I'm able to access the web UI as long as this command prompt is open.

[19:31:46] [INF] Jellyfin version: 10.4.1
[19:31:46] [INF] Arguments: ["C:\\Program Files\\Jellyfin\\Server\\jellyfin.dll"]
[19:31:46] [INF] Operating system: Windows
[19:31:46] [INF] Architecture: X64
[19:31:46] [INF] 64-Bit Process: True
[19:31:46] [INF] User Interactive: True
[19:31:46] [INF] Processor count: 4
[19:31:46] [INF] Program data path: C:\Users\User\AppData\Local\jellyfin
[19:31:46] [INF] Web resources path: C:\Program Files\Jellyfin\Server\jellyfin-web
[19:31:46] [INF] Application directory: C:\Program Files\Jellyfin\Server\
[19:31:46] [INF] Setting cache path to C:\Users\User\AppData\Local\jellyfin\cache
[19:31:46] [INF] Loading assemblies
[19:31:49] [INF] Kestrel listening on all interfaces
[19:31:49] [INF] Running startup tasks
[19:31:49] [INF] Daily trigger for Chapter image extraction set to fire at 11/22/2019 02:00, which is 6:28:10.9085332 from now.
[19:31:49] [INF] Found ffmpeg version unknown
[19:31:49] [WRN] FFmpeg: System: Failed version check: C:\Program Files\Jellyfin\Server\ffmpeg.exe
[19:31:49] [INF] Available decoders: ["h264", "h264_qsv", "h264_cuvid", "hevc", "hevc_qsv", "hevc_cuvid", "mpeg2video", "mpeg2_qsv", "vc1_qsv", "aac", "ac3", "mp3"]
[19:31:49] [INF] Available encoders: ["libx264", "h264_nvenc", "h264_qsv", "libx265", "hevc_nvenc", "hevc_qsv", "mpeg4", "msmpeg4", "libvpx", "libvpx-vp9", "aac", "ac3", "libmp3lame", "libopus", "libvorbis", "srt"]
[19:31:49] [INF] FFmpeg: System: C:\Program Files\Jellyfin\Server\ffmpeg.exe
[19:31:49] [INF] ServerId: 3e9fee1d580042e8a9d6ed17ce203d5d
[19:31:49] [INF] Executed all pre-startup entry points in 0:00:00.197022
[19:31:49] [INF] Core startup complete
[19:31:49] [INF] Registering publisher for urn:schemas-upnp-org:device:MediaServer:1 on 192.168.0.123
[19:31:50] [INF] Executed all post-startup entry points in 0:00:00.3273968
[19:31:52] [INF] StartupTrigger fired for task: Check for plugin updates
[19:31:52] [INF] Queueing task PluginUpdateTask
[19:31:52] [INF] Executing Check for plugin updates
[19:31:52] [INF] Check for plugin updates Completed after 0 minute(s) and 0 seconds
[19:31:52] [INF] ExecuteQueuedTasks
[19:31:52] [INF] WS http://localhost:8096/socket?api_key=c15a98165b4b47fbafdcf50f99029916&deviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzc2LjAuMzgwOS4xMzIgU2FmYXJpLzUzNy4zNnwxNTY4MjA5NDU1NTgx. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36
[19:31:58] [ERR] Error creating http port map
MediaBrowser.Model.Net.HttpException: Internal Server Error
   at Emby.Server.Implementations.HttpClientManager.HttpClientManager.EnsureSuccessStatusCode(HttpResponseMessage response, HttpRequestOptions options)
   at Emby.Server.Implementations.HttpClientManager.HttpClientManager.SendAsyncInternal(HttpRequestOptions options, HttpMethod httpMethod)
   at Emby.Server.Implementations.HttpClientManager.HttpClientManager.SendAsync(HttpRequestOptions options, HttpMethod httpMethod)
   at Mono.Nat.Upnp.UpnpNatDevice.CreatePortMap(Mapping mapping)
   at Emby.Server.Implementations.EntryPoints.ExternalPortForwarding.CreateRules(INatDevice device)
anthonylavado commented 4 years ago

Hrm that error isn't anything to worry about. A few questions:

ketanarlulkar commented 4 years ago

If you close the window, with the tray app closed, and open the Task Manager, under "Details", is Jellyfin.exe listed?

-> No

If you open the tray app, and look at the Task Manager, is Jellyfin listed?

-> No

What version of Windows are you running?

->Windows 10 Pro, Version 1903, OS build 18362.418

anthonylavado commented 4 years ago

@yetanothernerdk Okay, that's really strange. The error is nothing to worry about - it's just the server reporting that it couldn't automatically open a port on your router for Jellyfin.

Having the tray app open should start Jellyfin.exe in the background.

Did you have Jellyfin installed as a service before? If you go to "services.msc", you can look for "Jellyfin Server" or "JellyfinServer".

ketanarlulkar commented 4 years ago

Did you have Jellyfin installed as a service before? If you go to "services.msc", you can look for "Jellyfin Server" or "JellyfinServer"

It is not present there

anthonylavado commented 4 years ago

Okay. Again, this is a weird situation that I don’t think I’ve encountered. The tray app looks in the registry to get the path to start Jellyfin.

Could you check the registry for: HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432node/Jellyfin/Server?

Are the folders listed there correct? Do they match up with the real .exe location, and the data location?

ketanarlulkar commented 4 years ago

image The DataFolder C:\ProgramData\Jellyfin\Server does not have any files or folders inside.

siluah commented 4 years ago

I'm having the same issue. If I rename jellyfintray.exe to jellyfintray2.exe it will run but it takes me through set up again even though I have a data folder present.

Running Windows 10 1909 (18363.476) 64bit

anthonylavado commented 4 years ago

image The DataFolder C:\ProgramData\Jellyfin\Server does not have any files or folders inside.

@yetanothernerdk Sorry for missing this. Change Data Folder to C:\Users\User\AppData\Local\jellyfin (which is what was shown in your log from the first post). If there's an actual username instead of "User", make sure you put that in. It has to be the folder where the data is actually located. After you do that, see if the tray app starts Jellyfin.

I don't think I got a clear answer on this - did you have Jellyfin installed/running before using this installer, or was this the first time you've ever run Jellyfin?

anthonylavado commented 4 years ago

I'm having the same issue. If I rename jellyfintray.exe to jellyfintray2.exe it will run but it takes me through set up again even though I have a data folder present.

@siluah What happens if you just run jellyfintray? Nothing happens? To confirm, the data folder you have is C:\ProgramData\Jellyfin\Server? There is stuff inside there?

ketanarlulkar commented 4 years ago

Yes by changing data folder it works now. I had installed it previously. I used it for a week or so. Then it suddenly was unable to start. So I reinstalled it. And seen same problem. So I raised this issue.

Thank You.

ketanarlulkar commented 4 years ago

Again facing same issue. JellyfinTray.exe won't start the application, but jellyfin.exe starts the application. Registry contents are as stated above (i.e. with C:\Users\User\AppData\Local\jellyfin value for DataFolder). The location has data, log, cache, config etc folders, and files are there in those folders.

[07:49:33] [INF] Jellyfin version: 10.4.1
[07:49:33] [INF] Arguments: ["C:\\Program Files\\Jellyfin\\Server\\jellyfin.dll"]
[07:49:33] [INF] Operating system: Windows
[07:49:33] [INF] Architecture: X64
[07:49:33] [INF] 64-Bit Process: True
[07:49:33] [INF] User Interactive: True
[07:49:33] [INF] Processor count: 4
[07:49:33] [INF] Program data path: C:\Users\User\AppData\Local\jellyfin
[07:49:33] [INF] Web resources path: C:\Program Files\Jellyfin\Server\jellyfin-web
[07:49:33] [INF] Application directory: C:\Program Files\Jellyfin\Server\
[07:49:33] [INF] Setting cache path to C:\Users\User\AppData\Local\jellyfin\cache
[07:49:33] [INF] Loading assemblies
[07:49:35] [INF] Kestrel listening on all interfaces
[07:49:35] [INF] Running startup tasks
[07:49:35] [INF] Daily trigger for Chapter image extraction set to fire at 12/08/2019 02:00, which is 18:10:24.0610627 from now.
[07:49:36] [INF] Found ffmpeg version unknown
[07:49:36] [WRN] FFmpeg: System: Failed version check: C:\Program Files\Jellyfin\Server\ffmpeg.exe
[07:49:36] [INF] Available decoders: ["h264", "h264_qsv", "h264_cuvid", "hevc", "hevc_qsv", "hevc_cuvid", "mpeg2video", "mpeg2_qsv", "vc1_qsv", "aac", "ac3", "mp3"]
[07:49:36] [INF] Available encoders: ["libx264", "h264_nvenc", "h264_qsv", "libx265", "hevc_nvenc", "hevc_qsv", "mpeg4", "msmpeg4", "libvpx", "libvpx-vp9", "aac", "ac3", "libmp3lame", "libopus", "libvorbis", "srt"]
[07:49:36] [INF] FFmpeg: System: C:\Program Files\Jellyfin\Server\ffmpeg.exe
[07:49:36] [INF] ServerId: 3e9fee1d580042e8a9d6ed17ce203d5d
[07:49:36] [INF] Executed all pre-startup entry points in 0:00:00.1905052
[07:49:36] [INF] Core startup complete
[07:49:36] [INF] Watching directory E:\MUSIC
[07:49:36] [INF] Watching directory E:\TV
[07:49:36] [INF] Watching directory D:\Movies
[07:49:36] [INF] Registering publisher for urn:schemas-upnp-org:device:MediaServer:1 on 192.168.0.123
[07:49:36] [INF] Executed all post-startup entry points in 0:00:00.3779296
[07:49:38] [INF] WS http://localhost:8096/socket?api_key=8822191fa75b4946b4d0209e1c03a1e9&deviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzc4LjAuMzkwNC43MCBTYWZhcmkvNTM3LjM2fDE1NzI3ODU4OTA3Mzc1. UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36
[07:49:38] [INF] Getting image size for item CollectionFolder C:\Users\User\AppData\Local\jellyfin\metadata\library\7e\7e64e319657a9516ec78490da03edccb\poster.png
[07:49:38] [INF] StartupTrigger fired for task: Check for plugin updates
[07:49:38] [INF] Queueing task PluginUpdateTask
[07:49:38] [INF] Executing Check for plugin updates
[07:49:40] [INF] Check for plugin updates Completed after 0 minute(s) and 1 seconds
[07:49:40] [INF] ExecuteQueuedTasks
[07:49:45] [ERR] Error creating http port map
MediaBrowser.Model.Net.HttpException: Internal Server Error
   at Emby.Server.Implementations.HttpClientManager.HttpClientManager.EnsureSuccessStatusCode(HttpResponseMessage response, HttpRequestOptions options)
   at Emby.Server.Implementations.HttpClientManager.HttpClientManager.SendAsyncInternal(HttpRequestOptions options, HttpMethod httpMethod)
   at Emby.Server.Implementations.HttpClientManager.HttpClientManager.SendAsync(HttpRequestOptions options, HttpMethod httpMethod)
   at Mono.Nat.Upnp.UpnpNatDevice.CreatePortMap(Mapping mapping)
   at Emby.Server.Implementations.EntryPoints.ExternalPortForwarding.CreateRules(INatDevice device)
anthonylavado commented 4 years ago

To all with this issue, we may have a fix. It may be a Windows issue of sorts, but we can’t fix it until later (for more technical reasons that we can discuss later).

For now:

  1. Open File Explorer and go to %temp%\.net
  2. Find the folder with the name “JellyfinTray.____” (it will have a mix of letters and numbers)
  3. Delete this folder
  4. Try running the tray app again
FenixRebirth commented 4 years ago

To all with this issue, we may have a fix. It may be a Windows issue of sorts, but we can’t fix it until later (for more technical reasons that we can discuss later).

For now:

  1. Open File Explorer and go to %temp%\.net
  2. Find the folder with the name “JellyfinTray.____” (it will have a mix of letters and numbers)
  3. Delete this folder
  4. Try running the tray app again

With this solution it worked for me!!!

First of All i just discovered Jellyfin 2 weeks ago and believeme, you are the Masters!! Jellyfin is what i wanted always at home!

Please Anthony and Jelly team continue with this and you will arrive very far!!!

jamiethomaswhite commented 4 years ago

I'm on Windows 10 Pro 1909. I was directed here by the helpful matrix irc.

I've had both Plex and Emby set up and "working" for a while now and just been trying Jellyfin these last few weeks. In comparison to Plex, there's so much more granular control and I can escape the idiotic and counter-intuitive UI/UX updates, whereas compared to Emby it actually works without me babying it constantly. Until now.

I have this exact issue and I've followed through everything on here, as well as trying many things myself. Alas, the only way I solved my predicament was by uninstalling Jellyfin entirely, including deleting every registry entry and leftover folders, reinstalling and setting it up from fresh again leaving my old data out of the equation. No matter what I tried, with my data folder in place it just would not work.

Nothing at all had changed or occurred, except that I had just updated Window's and restarted one day, upon reboot Jellyfin refused to work. It wouldn't launch the tray icon at all or find my server via the web UI. Reinstalling eventually allowed me to run the server again but not the tray app. A deep clean and following through this thread got me to a fresh working install (after a few tries, as the Jellyfin server refused to start up a bunch of times during that initial install, and having to continually delete that temp launcher file and end task the exe's).

Regardless, unless I removed my previous data folder I was not be able to access a functioning web UI. With my data in place it would simply ask for the username and password but wouldn't accept the correct ones and would instead error out with a message along the lines of "not being able to contact the server", despite everything running fine (server and tray app).

So for me, starting over after a deep clean was the only successful option.

Would love an alternative solution to this as I have a big library and customise almost every single entry. I'm pretty peeved to start afresh if I'm honest. I almost gave up on Jellyfin for a while there.

jamiethomaswhite commented 4 years ago

These are two errors from my logs that I'm getting which may be of use. The first is when everything was working fine but no longer does for whatever reason, and the second is when I run the jellyfin.exe myself and keep the cmd window open (which works but forces me to start my config over):

[2020-02-18 00:35:50.034 +00:00] [FTL] Error while starting server.
ReadOnly: SQLitePCL.pretty.SQLiteException: attempt to write a readonly database
   at SQLitePCL.pretty.SQLiteException.CheckOk(sqlite3 db, Int32 rc)
   at SQLitePCL.pretty.StatementImpl.MoveNext()
   at SQLitePCL.pretty.DatabaseConnection.Execute(IDatabaseConnection This, String sql)
   at Emby.Server.Implementations.Data.BaseSqliteRepository.GetConnection(Boolean _)
   at Emby.Server.Implementations.Security.AuthenticationRepository.Initialize()
   at Emby.Server.Implementations.ApplicationHost.GetAuthenticationRepository()
   at Emby.Server.Implementations.ApplicationHost.RegisterResources(IServiceCollection serviceCollection)
   at Emby.Server.Implementations.ApplicationHost.InitAsync(IServiceCollection serviceCollection)
   at Jellyfin.Server.Program.StartApp(StartupOptions options)
[2020-02-18 00:35:50.066 +00:00] [INF] Disposing "CoreAppHost"
[2020-02-18 00:35:50.068 +00:00] [INF] Received a SIGTERM signal, shutting down

And the other:

[ERR] Error processing request: "Access token is invalid or expired."

anthonylavado commented 4 years ago

@jamiethomaswhite I’m sorry if I missed you in the chat, I would have likely been able to help more so you didn’t have to start fresh.

I’ll try to unpack as much as I can from your comments.

…error out with a message along the lines of "not being able to contact the server"

The currently released version of the server doesn’t show a useful message to say that the entered username or password is wrong, and instead shows this. There are ways to verify if this is the case though, and help you recover access without having to re-install. The error message is also fixed in the next version.

(error log 1)

This appears when more than one copy of Jellyfin is running. Only one program can use the database file at any given time, and this is why it is reporting that the database is “read only”. When it can’t read the database, it just closes down instead. It’s possible you may have had more than one copy of Jellyfin open, depending on what kind of things you were trying while troubleshooting :-(

(error log 2)

This just means that an active client (whether the web browser or an app) needs to log in again. This isn’t anything unusual for the app.

Maybe I can still help though. Try and send me a message when you can, or start a direct chat on Matrix/IRC. I’m not sure where you are, but I’m in the Eastern Time Zone (UTC -5). I’ll answer when I can.

jamiethomaswhite commented 4 years ago

I'll try and pop in to the matrix again (can't say that with a straight face) and have a chat.

I can say the whole time I was doing this, I had task manager open at the same time and I was killing the process and service each time I needed to, yet I was still getting these errors.

I'm honestly still unsure of how to avoid this and I'm also not exactly sure how I got it working again, as I just scrubbed my install and started over multiple times.

In my opinion, leading on from this and after having had a good look through the folder structure, I think Jellyfin could do with a singular default data path that is only for your user specific stuff (that you would want in case of an emergency), with everything else separated clearly. Currently, leaving the install to do it's thing, my data path is: C:\ProgramData\Jellyfin\Server\ But then there are pertinent bits and pieces strewn about, down multiple subfolder rabbit holes, like this one: C:\ProgramData\Jellyfin\Server\root\default\Shows Unless sometimes, for whatever reason, Jellyfin decides to look in the AppData folder instead.

It just seems convoluted and obscure, and a lot is left up to chance. Is there any reason it has to be buried so deep and in amongst other "unnecessary" files in multiple separate subfolders? Is an export option possible? So that we can migrate the data easily. Both would be useful, especially in case of the situation we had here.

Just my thoughts on it. As it is I've just spent the weekend redoing my whole library, unfortunately I use a lot of custom artwork and have lots of foreign films that get picked up wrong.

JokerQyou commented 4 years ago

To all with this issue, we may have a fix. It may be a Windows issue of sorts, but we can’t fix it until later (for more technical reasons that we can discuss later).

For now:

  1. Open File Explorer and go to %temp%\.net
  2. Find the folder with the name “JellyfinTray.____” (it will have a mix of letters and numbers)
  3. Delete this folder
  4. Try running the tray app again

First of all thank you for this workaround! I have had the exact same issue, and in my case it was this empty directory:%temp%\net\JellyfinTray\{randome_name}.jn2. After deleting this directory I tried launching JellyfinTray app again and the directory got re-created and filled with a bunch of files, and this time JellyfinTray is running just fine.

I'm curious though, what is this directory used for? Is it kind of .NET internal cache or something? And when will a fix regarding this issue come out?

anthonylavado commented 4 years ago

We are making changes with the way the tray app and windows installer are built. A fix for this will be part of those changes.

For reference, yes, it’s a cache for .NET that is somehow failing.

joaovitoriasilva commented 4 years ago

Hi there,

Also have this issue. Glad to see that what is doing this is identified. Do you know (more or less) when will be patched? Only thing blocking me from killing plex :)

pusta commented 4 years ago

I also had this issue this morning after the latest round of .net updates. The error in the event log is:

Description: A .NET Core application failed. Application: JellyfinTray.exe Path: C:\Program Files\Jellyfin\Server\JellyfinTray.exe Message: The application to execute does not exist: 'C:\Users\Chris\AppData\Local\Temp.net\JellyfinTray\l2cxugcr.jn2\JellyfinTray.dll'.

If I delete the %temp%.net\Jellyfin folder and restart the app, it works.

LennyLip commented 3 years ago

ReadOnly: SQLitePCL.pretty.SQLiteException: attempt to write a readonly database

same issue with installer/jellyfin_10.7.6_windows-x64.exe

update. remove "--datadir "C:\ProgramData\Jellyfin\Server"" from shortcut hepled