[Issue]: Deleting music from the filesystem does not remove it from Jellyfin
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
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.
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.
stil happens
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.
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.
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
I deleted the folders from the "Libraries" panel and that removed all the missing media from Jellyfin.
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.
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.
This issue remains on 10.9.11. Despite removing an artists folder from the filesystem, the artist is still in the Jellyfin Library.
Try run the "Cleanup Database" task.
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)
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.
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.
Disabling real time monitoring (BTRFS file system) and re-scanning didn't help me either.
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.
Same issue. I experience a full range of issues with music metadata. Can't nuke music meta at all.
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.
Here's what worked for me:
Scan the individual library and replace all metadata:
I just migrated to Navidrome. Jellyfin has way too many issues with music.
Here's what worked for me:
Scan the individual library and replace all metadata:
This didn't cut it for me unfortunately
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