Jellyfin Forum
SOLVED: Unable to refresh libraries - 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: Unable to refresh libraries (/t-solved-unable-to-refresh-libraries)



Unable to refresh libraries - runlevel - 2024-09-15

I am running Jellyfin in Docker following the "latest" tag (currently 10.9.11). As of this evening, all of my media libraries have stopped being able to refresh. I enabled debug logging per the instructions (https://jellyfin.org/docs/general/administration/troubleshooting/), but even then, there are no logs corresponding to the "refresh metadata" request. (I was following the logs with docker logs -f and nothing was logged when the button was pressed). I attempted to revert to a previously working version (10.9.9) and saw the same issue. I removed the most recent files I added and still the same issue. I'm not sure where else to look to troubleshoot this. The only clue I have is a Devtools JS Console error that consistently appears each time the "Refresh" button is pressed which I have attached a screenshot of. The screenshot was taken in Firefox 129, but the same behavior appears in the Android app (version 2.6.2 if I'm looking correctly). The actual observed behavior in either is pressing the "Refresh" button, then the loading spinner appearing indefinitely rather than the "Refresh Metadata" popup closing and the refresh starting as expected.

I have a reasonable about of JS experience, but not with Jellyfin's tech stack. If somebody could point me to sourcemaps for this version of Jellyfin I may be able to get more information out of that console error. Otherwise any help to determine what could be causing this would be appreciated.


RE: Unable to refresh libraries - TheDreadPirate - 2024-09-15

Try clearing your browser cache.


RE: Unable to refresh libraries - runlevel - 2024-09-15

(2024-09-15, 02:09 AM)TheDreadPirate Wrote: Try clearing your browser cache.

No luck, unfortunately. The same behavior is present as before clearing the cache. It might not be significant, but the JS stacktrace did change. I attached the new error. Still no change in the logs either.


RE: Unable to refresh libraries - TheDreadPirate - 2024-09-15

Can you share your jellyfin logs via pastebin?


RE: Unable to refresh libraries - runlevel - 2024-09-15

(2024-09-15, 02:42 AM)TheDreadPirate Wrote: Can you share your jellyfin logs via pastebin?

Did a server restart so I could have a good start point for the logs. This is everything from the server restart (02:49:40 UTC) to just after an attempt to refresh one of the media libraries (02:50:41 UTC). (Dumped via docker logs command)

https://pastebin.com/xyVjJv7y


RE: Unable to refresh libraries - TheDreadPirate - 2024-09-15

The log looks fine.

Try this.

Code:
sudo docker compose down jellyfin
sudo docker compose up -d jellyfin --force-recreate

This will redownload the image and recreate the container in case something in, probably, jellyfin-web is corrupt.


RE: Unable to refresh libraries - runlevel - 2024-09-15

I tried those commands out (also tried with --pull always on the up command to force the re-pull of the image). No change in the behavior. (Cleared browser cache after each down/up to be sure).

I really wanted to see what that JS error was about, so I got the jellyfin-packaging repo, changed the jellyfin-web build step to use build:development, built the container with the instructions in the README, copied my /config volume to a brand new volume, and launched the container with the following command:


docker run --rm \
  -v dev_jellyfin_config:/config \  # copied config volume
  -v dev_jellyfin_cache:/cache \    # empty cache volume
  -v homelab_share:/media \         # SMB volume with my videos in it
  jellyfin/jellyfin:10.9.11-de-amd64.20240915-091159


The behavior remained in this new container. I got some unrelated errors from my browser because the connection was no longer SSL. But I also got the attached stack trace.

I'm gonna start digging into this JS to see what I can find. Let me know if you have any other suggestions I can try though.


RE: Unable to refresh libraries - TheDreadPirate - 2024-09-15

Do you have any adblockers or script blockers in your browser?


RE: Unable to refresh libraries - runlevel - 2024-09-15

(2024-09-15, 04:50 PM)TheDreadPirate Wrote: Do you have any adblockers or script blockers in your browser?

I do have uBlock Origin, but its been disabled for my domain for a while now. Just to be safe, I just tried it again in a Private Window (with no extensions) and got the same issue.

I've been digging into the code and what I've found so far is that the function expects an itemId to be in each of the items returned from the "Library/VirtualFolders" endpoint. That endpoint is only returning the following on my instance:


[{"Name":"Anime","Locations":["/media/video/anime"],"CollectionType":"tvshows"},{"Name":"Shows","Locations":["/media/video/shows"],"CollectionType":"tvshows"},{"Name":"Animated Shows","Locations":["/media/video/animation"],"CollectionType":"tvshows"},{"Name":"Movies","Locations":["/media/video/movies"],"CollectionType":"movies"},{"Name":"Animated Movies","Locations":["/media/video/animated_movies"],"CollectionType":"movies"},{"Name":"Anime Movies","Locations":["/media/video/anime_movies"],"CollectionType":"movies"}]


This matches the basic information that's constructed by the first half of the Emby.Server.Implementations.Library.LibraryManager.GetVirtualFolderInfo method, but the ItemId, PrimaryImageItemId, LibraryOptions, RefreshProgress, and RefreshStatus from the second half of that function are all missing. There's a not null check after the folder lookup in that function that is probably failing, but I'm stuck there since I have no idea how to go about attaching a debugger to a C# program.


RE: Unable to refresh libraries - runlevel - 2024-09-16

It wasn't a perfect solution, but after all that hunting I decided my database was probably in some inconsistent state. I ended up configuring a new instance from scratch then copied my watch history over with https://github.com/Marc-Vieg/Emby2Jelly. I backed up the old docker volumes beforehand, but I probably won't end up doing any more troubleshooting with them.