jellyfin icon indicating copy to clipboard operation
jellyfin copied to clipboard

[Issue]: Deleting music from the filesystem does not remove it from Jellyfin

Open sevenrats opened this issue 3 years ago • 18 comments

Please describe your bug

Server version 10.8.9 Just delete one of your music artists and rescan your music library. All the music items from that artist are still present in every view, but playing them fails, because they are now missing from the filesystem.

Expected behavior: The deleted items go away.

Jellyfin Version

10.8.0

if other:

No response

Environment

- OS:Ubuntu lts
- Virtualization: Docker
- Clients: Web,Roku
- Browser: na
- FFmpeg Version: built-in
- Playback Method: na
- Hardware Acceleration: na
- Plugins: none
- Reverse Proxy: nginx
- Base URL:
- Networking:
- Storage:

Jellyfin logs

[2023-02-05 15:37:08.424 +00:00] [DBG] [74] MediaBrowser.Controller.Entities.BaseItem: Removed item: "/mnt/share/Music/jukipic"
[2023-02-05 15:37:08.451 +00:00] [INF] [74] Emby.Server.Implementations.Library.LibraryManager: Removing item, Type: "MusicArtist", Name: "Jukipic", Path: "/mnt/share/Music/jukipic", Id: a4f093be-950c-df2d-e3a5-ed8e1b98dc60
[2023-02-05 15:37:08.575 +00:00] [DBG] [74] MediaBrowser.Controller.Entities.BaseItem: Removed item: "/mnt/share/Music/emancipator"
[2023-02-05 15:37:08.576 +00:00] [INF] [74] Emby.Server.Implementations.Library.LibraryManager: Removing item, Type: "MusicArtist", Name: "Emancipator", Path: "/mnt/share/Music/emancipator", Id: 07895ae3-bb28-662b-7d27-eff372852876

FFmpeg logs

No response

Please attach any browser or client logs here

No response

Please attach any screenshots here

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

sevenrats avatar Feb 05 '23 16:02 sevenrats

Encountered the same problem, tried restarting the server, doing a full rescan, removing the library then adding again, nothing worked and the deleted files still show up. Found a workaround that removing the folder from library's folders settings, renaming the folder on filesystem then adding to library's folders again fixed this issue.

Liquorice10113 avatar Apr 26 '23 12:04 Liquorice10113

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.

If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.

This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.

jellyfin-bot avatar Aug 25 '23 01:08 jellyfin-bot

stil happens

sevenrats avatar Sep 04 '23 00:09 sevenrats

Even after removing all files for an artist, the artist still shows for me. Calling the delete API endpoint on the artist ID doesn't remove the entry.

1hitsong avatar Sep 08 '23 18:09 1hitsong

I was having this issue and doing "Refresh metadata" did nothing. When I went to the administration dashboard and did a "Scan All Libraries" the deleted songs disappeared. A playlist referencing those deleted songs is now empty.

pnorman avatar Dec 12 '23 09:12 pnorman

I'm having this issue with shows/movies. They're deleted from my filesystem but they still show up in Jellyfin. I've done "Scan All Libraries" multiple times, and the problem persists.

Jellyfin 10.8.13 via Docker for Mac 4.26.1

nothing2obvi avatar Dec 20 '23 21:12 nothing2obvi

I deleted the folders from the "Libraries" panel and that removed all the missing media from Jellyfin.

nothing2obvi avatar Dec 23 '23 20:12 nothing2obvi

I'm also seeing this. After deleting all files from an artist, the artist remains (empty) in the library. Refreshing the library has no effect.

guiweber avatar Mar 20 '24 11:03 guiweber

I'm also seeing this. After deleting all files from an artist, the artist remains (empty) in the library. Refreshing the library has no effect.

This 👆 and sadly persisting with 10.9.6. What worked to manually resolve this problem was, to open artist and if stale albums are still listed, open an album, and from the menu select Delete media. For me after that, the artist vanished.

foss- avatar Jun 20 '24 12:06 foss-

This issue remains on 10.9.11. Despite removing an artists folder from the filesystem, the artist is still in the Jellyfin Library.

theinfguy avatar Oct 19 '24 12:10 theinfguy

Try run the "Cleanup Database" task.

JPVenson avatar Oct 19 '24 20:10 JPVenson

Isn't the issue caused when "Real time monitoring" is disabled in the "Manage Library" options? After I enabled the setting, it seems to delete any metadata from the UI (after a library scan) image

LumePart avatar Oct 20 '24 09:10 LumePart

On FreeBSD with Real Time Monitoring enabled dotNet will use kqueue to monitor the files. Kqueue uses one filehandle per file that you're watching. If you look at the code in Emby.Server.Implementations/IO/LibraryMonitor.cs it registers deletion events to use the OnWatcherChanged function.

newWatcher.Deleted += OnWatcherChanged;

I think this is the root cause of a lot of problems. On other OSes it probably is causing a small resource leak. On FreeBSD it guarantees the file you deleted never has its space released until you restart Jellyfin so the filehandle is closed which is very bad behavior.

I think the newWatcher.Deleted event should instead call a function that will Dispose of the watcher and then take any other necessary action to tidy up the database.

feld avatar Oct 21 '24 20:10 feld

Try run the "Cleanup Database" task.

There is no such a task, at least at 10.9.11. "Clean up collections and playlists" and "Optimize database" didn't help.

akritm avatar Oct 22 '24 19:10 akritm

Disabling real time monitoring (BTRFS file system) and re-scanning didn't help me either.

akritm avatar Oct 22 '24 19:10 akritm

Disabling real time monitoring (BTRFS file system) and re-scanning didn't help me either.

Hm, in my case seems like problem was with wrong tags in mp3 file (or that was one of the reasons). However, artist still was with empty album lists in jellyfin. Not sure what exact step helped, but I:

  • switched off real time monitoring (it never worked anyway)
  • corrected the artist tag
  • moved file in ..music\Artist\file.mp3 (it was in root folder previously)
  • re-scanned album (3rd "scan all option" in album or artist menu).

Now wrong, empty artist disappeared from list.

akritm avatar Oct 22 '24 19:10 akritm

Same issue. I experience a full range of issues with music metadata. Can't nuke music meta at all.

voronind-com avatar Mar 29 '25 08:03 voronind-com

I was having this issue and doing "Refresh metadata" did nothing. When I went to the administration dashboard and did a "Scan All Libraries" the deleted songs disappeared. A playlist referencing those deleted songs is now empty.

This worked for me, thanks! Rescanning the music library only didn't worked. Strange.

KlausHans avatar May 12 '25 18:05 KlausHans

Here's what worked for me:

Scan the individual library and replace all metadata:

Image

Image

addmix avatar Jul 04 '25 12:07 addmix

I just migrated to Navidrome. Jellyfin has way too many issues with music.

voronind-com avatar Jul 07 '25 07:07 voronind-com

Here's what worked for me:

Scan the individual library and replace all metadata:

Image

Image

This didn't cut it for me unfortunately

nodje avatar Sep 14 '25 13:09 nodje

I tried to delete and recreate my music library, keeping the exact same name, as advised here: https://forum.jellyfin.org/t-cleanup-after-deleted-library

and this worked for me

nodje avatar Sep 14 '25 13:09 nodje