Thank you for all the hardwork on Emby. As a premium subscriber, we've been using it extensively for years. :)
Issue:
Emby is attempting to delete metadata JPGs it does not own. Even if configured to store/cache the thumbnails elsewhere, it still continues to try to delete the remote Read-Only version that is not part of it's configuration for cache/metadata storage location.
Since the /media directory is READ-ONLY, Emby throws an unhandled exception and fails to update the Metadata database for the new location of the downloaded Thumbnail it just downloaded. Therefore exiting the entire sub-routine.
Expected Behavior:
Preferred:
Emby does not delete files it does not own/index/use (like this thumbnail JPG I already have).
Acceptable:
Emby logs that it cannot delete the thumbnail; but, continues to update the Metadata database for the already successfully downloaded JPG thumbnail into its configured cache location.
Behind the Scenes steps that cause the issue
I highly suspect the backend code/sub-routine is doing the following pseudocode in order:
public void UpdateThumbnail(context...) {
try {
// this works
DownloadThumbnail(context);
// this throws an AccessDenied exception
DeleteAnyExistingThumbnails(context);
// so this is never reached due to exception above
UpdateMetadataDatabaseForThumbnail(context);
} catch (Exception e) {
throw e;
}
}
I recommend changing the order for the DeleteAnyExistingThumbnails() to be at the end of the global try/catch.
Or, properly handle the exception like the following:
public void UpdateThumbnail(context...) {
try {
DownloadThumbnail(context);
} catch (Exception e) {
throw DownloadException(e);
}
try {
UpdateMetadataDatabaseForThumbnail(context);
} catch (Exception e) {
throw UpdateMetadataException(e);
}
try {
DeleteAnyExistingThumbnails(context);
} catch (Exception e) {
throw DeleteException(e);
}
}
That way, if Emby is unable to delete, at least the transaction continues to update the metadata of the downloaded file.
How to Reproduce:
- Configure Emby to NOT store metadata files next to the media files. Use the default setup, to store JPGs to local disk, cache, etc.
- Add a READ-ONLY media folder, such as
/media/movies/Whatever (1933)/. Ensure Emby only has RO access to this directory.
- Place a media file (e.g. MKV, MP4, etc) there, along with a JPG thumbnail as RO at
/media/movies/Whatever (1933)/Whatever (1933).jpg.
- Now, index that /media folder within Emby. You'll see that Emby is unable to display the JPG thumbnail, and shows a preview of the movie file itself.
- Finally, attempt change the Thumbnail image of that Movie. While you will see the downloaded thumbnail now in Emby (possibly, unless it stalls due to the exception), it's only temporary until you restart the Emby server, or wait a few hours.
At this point, if you view the embyserver log, you'll see it successfully downloaded the new Thumbnail image into the cache. However, the next log entry is an error with Emby attempting to delete the /media/movies/Whatever (1933)/Whatever (1933).jpg but it logs an exception.
Emby therefore exists the overall transaction and does not continue updating the metadata database for the new downloaded image. E.g. a Try/Catch block that just exits the entire subroutine when any exception is thrown, and doesn't continue to update the metadata database after the delete fails.
Emby should not try to touch files it does not own, unless you tell it to! Or at least, ignore modifying files if accessing a read-only folder (and log read-only was detected).
Additional Info
Why can't Emby display this read-only JPG anyways? It obviously is trying to delete it, so it knows its there - so why not just show it?
The Exception
Here is an example error message:
2025-08-08 19:23:36.759 Info ProviderManager: Saving image to /config/metadata/library/20/20395b3c5d192d89baa870087b03f39d/poster.jpg
2025-08-08 19:23:36.763 Info ProviderManager: Deleting previous image /movies/Venom Let There Be Carnage 2021 2160p UHD BluRay REMUX DV HDR HEVC Atmos-TRiToN/Venom Let There Be Carnage 2021 2160p UHD BluRay REMUX DV HDR HEVC Atmos-TRiToN.jpg
2025-08-08 19:23:36.767 Error RemoteImageService-0HNELFTJ92GQT:00000001: Error processing request
*** Error Report ***
Version: 4.9.1.7
Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
Operating system: Linux version 6.6.44-production+truenas (root@tnsbuilds01.tn.ixsystems.net) (gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1
OS/Process: x64/x64
Framework: .NET 8.0.11
Runtime: system/System.Private.CoreLib.dll
Processor count: 2
Data path: /config
Application path: /system
System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/movies/Venom Let There Be Carnage 2021 2160p UHD BluRay REMUX DV HDR HEVC Atmos-TRiToN/Venom Let There Be Carnage 2021 2160p UHD BluRay REMUX DV HDR HEVC Atmos-TRiToN.jpg' is denied.
---> System.IO.IOException: Permission denied
--- End of inner exception stack trace ---
at System.IO.FileSystem.DeleteFile(String fullPath)
at Emby.Providers.Manager.ImageSaver.SaveImage(BaseItem item, LibraryOptions libraryOptions, IImageSource source, ReadOnlyMemory`1 mimeType, ImageType type, Nullable`1 imageIndex, Nullable`1 saveLocallyWithMedia, Int64[] generatedFromItemIds, IDirectoryService directoryService, Boolean updateImageCache, CancellationToken cancellationToken)
at Emby.Providers.Manager.ProviderManager.SaveImageFromRemoteUrl(BaseItem item, LibraryOptions libraryOptions, String url, ImageType type, Nullable`1 imageIndex, Int64[] generatedFromItemIds, IDirectoryService directoryService, Boolean updateImageCache, CancellationToken cancellationToken)
at Emby.Api.Images.RemoteImageService.DownloadRemoteImage(BaseItem item, BaseDownloadRemoteImage request)
at Emby.Server.Implementations.Services.ServiceController.GetTaskResult(Task task)
at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost httpHost, IServerApplicationHost appHost, IRequest httpReq, IResponse httpRes, IStreamHelper streamHelper, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, RestPath restPath, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, String contentTypeInPath, CancellationToken cancellationToken)
Source: System.Private.CoreLib
TargetSite: Void DeleteFile(System.String)
InnerException: System.IO.IOException: Permission denied
Source:
TargetSite:

Thank you for all the hardwork on Emby. As a premium subscriber, we've been using it extensively for years. :)
Issue:
Emby is attempting to delete metadata JPGs it does not own. Even if configured to store/cache the thumbnails elsewhere, it still continues to try to delete the remote Read-Only version that is not part of it's configuration for cache/metadata storage location.
Since the
/mediadirectory is READ-ONLY, Emby throws an unhandled exception and fails to update the Metadata database for the new location of the downloaded Thumbnail it just downloaded. Therefore exiting the entire sub-routine.Expected Behavior:
Preferred:
Emby does not delete files it does not own/index/use (like this thumbnail JPG I already have).
Acceptable:
Emby logs that it cannot delete the thumbnail; but, continues to update the Metadata database for the already successfully downloaded JPG thumbnail into its configured cache location.
Behind the Scenes steps that cause the issue
I highly suspect the backend code/sub-routine is doing the following pseudocode in order:
I recommend changing the order for the
DeleteAnyExistingThumbnails()to be at the end of the global try/catch.Or, properly handle the exception like the following:
That way, if Emby is unable to delete, at least the transaction continues to update the metadata of the downloaded file.
How to Reproduce:
/media/movies/Whatever (1933)/. Ensure Emby only has RO access to this directory./media/movies/Whatever (1933)/Whatever (1933).jpg.At this point, if you view the embyserver log, you'll see it successfully downloaded the new Thumbnail image into the cache. However, the next log entry is an error with Emby attempting to delete the
/media/movies/Whatever (1933)/Whatever (1933).jpgbut it logs an exception.Emby therefore exists the overall transaction and does not continue updating the metadata database for the new downloaded image. E.g. a Try/Catch block that just exits the entire subroutine when any exception is thrown, and doesn't continue to update the metadata database after the delete fails.
Emby should not try to touch files it does not own, unless you tell it to! Or at least, ignore modifying files if accessing a read-only folder (and log read-only was detected).
Additional Info
Why can't Emby display this read-only JPG anyways? It obviously is trying to delete it, so it knows its there - so why not just show it?
The Exception
Here is an example error message: