The process cannot access the file because it is being used by another process. #6830

Closed
opened 2026-02-07 04:10:34 +03:00 by OVERLORD · 7 comments
Owner

Originally created by @needo37 on GitHub (Mar 17, 2025).

Description of the bug

This is a fresh install of Jellyfin 10.10.6 on a fresh server. I am using the official docker container. I have also tried the linuxserver docker container.

When I do a first scan of my library I see a bunch of these errors.

The process cannot access the file '/config/data/metadata/People/E/Ester Dean/folder.jpg' because it is being used by another process.

Reproduction steps

  1. Add new media to the Movie library.
  2. Click Scan all Libraries
  3. Error appears in log

What is the current bug behavior?

There is not another process accessing this file. Permissions are also correct.

What is the expected correct behavior?

For it not to create double the metadata in the library.

Jellyfin Server version

10.10.0+

Specify commit id

No response

Specify unstable release number

No response

Specify version number

No response

Specify the build version

10.10.6

Environment

- OS:unRAID
- Linux Kernel:6.6.78
- Virtualization:Docker
- Clients:Browser
- Browser:Firefox
- Networking:Bridge
- Storage:local

Jellyfin logs

19:19:01] [ERR] [33] MediaBrowser.Providers.Manager.ProviderManager: IOException saving to /config/data/metadata/People/M/Michael J. Fox/folder.jpg. Will retry saving to /config/data/metadata/library/72/72ef42729d6ab049ab8434c001d31698/folder.jpg
System.IO.IOException: The process cannot access the file '/config/data/metadata/People/M/Michael J. Fox/folder.jpg' because it is being used by another process.
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.FileStream..ctor(String path, FileStreamOptions options)
   at MediaBrowser.Providers.Manager.ImageSaver.SaveImageToLocation(Stream source, String path, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.ImageSaver.SaveImageToLocation(Stream source, String path, String retryPath, CancellationToken cancellationToken)
[19:19:02] [ERR] [25] Emby.Server.Implementations.Library.LibraryManager: Cannot compute blurhash for /config/data/metadata/People/B/Brittany Snow/folder.jpg
System.IO.IOException: The process cannot access the file '/config/data/metadata/People/B/Brittany Snow/folder.jpg' because it is being used by another process.
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at Jellyfin.Drawing.Skia.SkiaEncoder.GetImageBlurHash(Int32 xComp, Int32 yComp, String path)
   at Jellyfin.Drawing.ImageProcessor.GetImageBlurHash(String path, ImageDimensions imageDimensions)
   at Emby.Server.Implementations.Library.LibraryManager.UpdateImagesAsync(BaseItem item, Boolean forceUpdate)

FFmpeg logs


Client / Browser logs

No response

Relevant screenshots or videos

No response

Additional information

No response

Originally created by @needo37 on GitHub (Mar 17, 2025). ### Description of the bug This is a fresh install of Jellyfin 10.10.6 on a fresh server. I am using the official docker container. I have also tried the linuxserver docker container. When I do a first scan of my library I see a bunch of these errors. The process cannot access the file '/config/data/metadata/People/E/Ester Dean/folder.jpg' because it is being used by another process. ### Reproduction steps 1. Add new media to the Movie library. 2. Click Scan all Libraries 3. Error appears in log ### What is the current _bug_ behavior? There is not another process accessing this file. Permissions are also correct. ### What is the expected _correct_ behavior? For it not to create double the metadata in the library. ### Jellyfin Server version 10.10.0+ ### Specify commit id _No response_ ### Specify unstable release number _No response_ ### Specify version number _No response_ ### Specify the build version 10.10.6 ### Environment ```markdown - OS:unRAID - Linux Kernel:6.6.78 - Virtualization:Docker - Clients:Browser - Browser:Firefox - Networking:Bridge - Storage:local ``` ### Jellyfin logs ```shell 19:19:01] [ERR] [33] MediaBrowser.Providers.Manager.ProviderManager: IOException saving to /config/data/metadata/People/M/Michael J. Fox/folder.jpg. Will retry saving to /config/data/metadata/library/72/72ef42729d6ab049ab8434c001d31698/folder.jpg System.IO.IOException: The process cannot access the file '/config/data/metadata/People/M/Michael J. Fox/folder.jpg' because it is being used by another process. at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) at System.IO.FileStream..ctor(String path, FileStreamOptions options) at MediaBrowser.Providers.Manager.ImageSaver.SaveImageToLocation(Stream source, String path, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.ImageSaver.SaveImageToLocation(Stream source, String path, String retryPath, CancellationToken cancellationToken) [19:19:02] [ERR] [25] Emby.Server.Implementations.Library.LibraryManager: Cannot compute blurhash for /config/data/metadata/People/B/Brittany Snow/folder.jpg System.IO.IOException: The process cannot access the file '/config/data/metadata/People/B/Brittany Snow/folder.jpg' because it is being used by another process. at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at Jellyfin.Drawing.Skia.SkiaEncoder.GetImageBlurHash(Int32 xComp, Int32 yComp, String path) at Jellyfin.Drawing.ImageProcessor.GetImageBlurHash(String path, ImageDimensions imageDimensions) at Emby.Server.Implementations.Library.LibraryManager.UpdateImagesAsync(BaseItem item, Boolean forceUpdate) ``` ### FFmpeg logs ```shell ``` ### Client / Browser logs _No response_ ### Relevant screenshots or videos _No response_ ### Additional information _No response_
OVERLORD added the bugstale labels 2026-02-07 04:10:34 +03:00
Author
Owner

@cpouldev commented on GitHub (Mar 21, 2025):

+1 I get that error too. Same jellyfin version on a fresh server

@cpouldev commented on GitHub (Mar 21, 2025): +1 I get that error too. Same jellyfin version on a fresh server
Author
Owner

@Hello-World-Traveler commented on GitHub (Apr 5, 2025):

I find this error on restart with some plugin logos.

@Hello-World-Traveler commented on GitHub (Apr 5, 2025): I find this error on restart with some plugin logos.
Author
Owner

@ja-softdevel commented on GitHub (Apr 9, 2025):

I'm getting a similar error and it's happening on a lot of folders.
Jellyfin v10.10.6 running in LXC

[2025-04-09 11:08:51.381 -05:00] [ERR] Error in metadata saver
System.IO.IOException: The process cannot access the file '/var/lib/jellyfin/data/collections/The Transporter Collection [boxset]/collection.xml' because it is being used by another process.
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.FileStream..ctor(String path, FileStreamOptions options)
   at MediaBrowser.LocalMetadata.Savers.BaseXmlSaver.SaveAsync(BaseItem item, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.ProviderManager.SaveMetadataAsync(BaseItem item, ItemUpdateType updateType, IEnumerable`1 savers)
[2025-04-09 11:28:15.122 -05:00] [WRN] The WebRootPath was not found: "/var/lib/jellyfin/wwwroot". Static files may be unavailable.
@ja-softdevel commented on GitHub (Apr 9, 2025): I'm getting a similar error and it's happening on a lot of folders. Jellyfin v10.10.6 running in LXC ``` [2025-04-09 11:08:51.381 -05:00] [ERR] Error in metadata saver System.IO.IOException: The process cannot access the file '/var/lib/jellyfin/data/collections/The Transporter Collection [boxset]/collection.xml' because it is being used by another process. at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions) at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) at System.IO.FileStream..ctor(String path, FileStreamOptions options) at MediaBrowser.LocalMetadata.Savers.BaseXmlSaver.SaveAsync(BaseItem item, CancellationToken cancellationToken) at MediaBrowser.Providers.Manager.ProviderManager.SaveMetadataAsync(BaseItem item, ItemUpdateType updateType, IEnumerable`1 savers) [2025-04-09 11:28:15.122 -05:00] [WRN] The WebRootPath was not found: "/var/lib/jellyfin/wwwroot". Static files may be unavailable. ```
Author
Owner

@bruceharrison1984 commented on GitHub (Apr 25, 2025):

@ja-softdevel I'm also seeing the messages in relation to collections. I'm running in Docker, with the config directory living on the local NVMe drive.

@bruceharrison1984 commented on GitHub (Apr 25, 2025): @ja-softdevel I'm also seeing the messages in relation to collections. I'm running in Docker, with the config directory living on the local NVMe drive.
Author
Owner

@se7entynine commented on GitHub (Jun 15, 2025):

Same problem as @bruceharrison1984

My collections appear empty as well because the CollectionItems part is empty:
Example of good collection.xml:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Item>
  <ContentRating>FSK-12</ContentRating>
  <Added>03/18/2025 17:19:56</Added>
  <LockData>false</LockData>
  <Overview>Collection XYZ.</Overview>
  <LocalTitle>Example123</LocalTitle>
  <PremiereDate>2018-12-07</PremiereDate>
  <DisplayOrder>PremiereDate</DisplayOrder>
  <ProductionYear>2018</ProductionYear>
  <TmdbId>573693</TmdbId>
  <Genres>
    <Genre> XYZ </Genre>
    <Genre> XYZ </Genre>
    <Genre> XYZ </Genre>
  </Genres>
  <Studios>
    <Studio> XYZ </Studio>
    <Studio> XYZ </Studio>
    <Studio> XYZ </Studio>
    <Studio> XYZ </Studio>
    <Studio> XYZ </Studio>
  </Studios>
  <CollectionItems>
    <CollectionItem>
      <Path>/arr/movies/Collection XYZ - Example123 (201Nerd-face/Example123(201Nerd-face [imdbid-tt1477834] - [Remux-2160p][DV HDR10][TrueHD Atmos 7.1][HEVC]-pmHD.mkv</Path>
    </CollectionItem>
    <CollectionItem>
      <Path>/arr/movies/ Collection XYZ - Example1234 (201Nerd-face/Example1234(201Nerd-face (2023) [imdbid-tt9663764] - Imax [Bluray-2160p][DV HDR10][TrueHD Atmos 7.1][x265]-iND.mkv</Path>
    </CollectionItem>
  </CollectionItems>
</Item>

Bad collection.xml:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Item>
  <Added>05/23/2025 15:28:31</Added>
  <LockData>false</LockData>
  <LocalTitle>Bad Collection</LocalTitle>
  <DisplayOrder>PremiereDate</DisplayOrder>
  <TmdbId>1155702</TmdbId>
</Item>

And the same error message as @ja-softdevel , but I'm always able to manually remove the empty collection. No error message, only:

[2025-06-15 19:51:33.513 +02:00] [INF] [21] Emby.Server.Implementations.Library.LibraryManager: Removing item, Type: BoxSet, Name: Example collection, Path: /config/data/collections/Example collection [boxset], Id: d1ae7e4f-26a5-bad1-12e1-564d26c46310

[2025-06-15 19:51:33.513 +02:00] [INF] [21] Emby.Server.Implementations.Library.LibraryManager: Deleting item path, Type: BoxSet, Name: Example collection, Path: /config/data/collections/Example collection [boxset], Id: d1ae7e4f-26a5-bad1-12e1-564d26c46310

Jellyfin version: 10.10.7
Plugins:

  • TMDb
  • TMDb Box Sets
  • TheTVDB
  • Themerr
  • Intro Skipper

Jellyfin compose:

version: "2"
services:
  jellyfin:
    image: jellyfin/jellyfin
    container_name: jellyfin
    hostname: jellyfin
    #user: 1000:1000
    group_add:
      - '108'  
    environment:
      - TZ=Europe/Berlin
    volumes:
      - ${PWD}/config:/config
      - ${PWD}/cache:/cache
      - Lots of media directories
      - ${PWD}/leaving-soon:/arr/media/leaving-soon
    ports: 
      - 8096:8096
    devices: 
      - /dev/dri/renderD128:/dev/dri/renderD128
      - /dev/dri/card1:/dev/dri/card1
      - /dev/fb0:/dev/fb0
    restart: unless-stopped
    networks:
      abc:
    security_opt:
      - no-new-privileges:true

networks:
  abc:
    external: true

Could

security_opt:
     - no-new-privileges:true

cause this?

@se7entynine commented on GitHub (Jun 15, 2025): Same problem as @bruceharrison1984 My collections appear empty as well because the CollectionItems part is empty: Example of good collection.xml: ``` <?xml version="1.0" encoding="utf-8" standalone="yes"?> <Item> <ContentRating>FSK-12</ContentRating> <Added>03/18/2025 17:19:56</Added> <LockData>false</LockData> <Overview>Collection XYZ.</Overview> <LocalTitle>Example123</LocalTitle> <PremiereDate>2018-12-07</PremiereDate> <DisplayOrder>PremiereDate</DisplayOrder> <ProductionYear>2018</ProductionYear> <TmdbId>573693</TmdbId> <Genres> <Genre> XYZ </Genre> <Genre> XYZ </Genre> <Genre> XYZ </Genre> </Genres> <Studios> <Studio> XYZ </Studio> <Studio> XYZ </Studio> <Studio> XYZ </Studio> <Studio> XYZ </Studio> <Studio> XYZ </Studio> </Studios> <CollectionItems> <CollectionItem> <Path>/arr/movies/Collection XYZ - Example123 (201Nerd-face/Example123(201Nerd-face [imdbid-tt1477834] - [Remux-2160p][DV HDR10][TrueHD Atmos 7.1][HEVC]-pmHD.mkv</Path> </CollectionItem> <CollectionItem> <Path>/arr/movies/ Collection XYZ - Example1234 (201Nerd-face/Example1234(201Nerd-face (2023) [imdbid-tt9663764] - Imax [Bluray-2160p][DV HDR10][TrueHD Atmos 7.1][x265]-iND.mkv</Path> </CollectionItem> </CollectionItems> </Item> ``` Bad collection.xml: ``` <?xml version="1.0" encoding="utf-8" standalone="yes"?> <Item> <Added>05/23/2025 15:28:31</Added> <LockData>false</LockData> <LocalTitle>Bad Collection</LocalTitle> <DisplayOrder>PremiereDate</DisplayOrder> <TmdbId>1155702</TmdbId> </Item> ``` And the same error message as @ja-softdevel , but I'm always able to manually remove the empty collection. No error message, only: ``` [2025-06-15 19:51:33.513 +02:00] [INF] [21] Emby.Server.Implementations.Library.LibraryManager: Removing item, Type: BoxSet, Name: Example collection, Path: /config/data/collections/Example collection [boxset], Id: d1ae7e4f-26a5-bad1-12e1-564d26c46310 [2025-06-15 19:51:33.513 +02:00] [INF] [21] Emby.Server.Implementations.Library.LibraryManager: Deleting item path, Type: BoxSet, Name: Example collection, Path: /config/data/collections/Example collection [boxset], Id: d1ae7e4f-26a5-bad1-12e1-564d26c46310 ``` Jellyfin version: 10.10.7 Plugins: - TMDb - TMDb Box Sets - TheTVDB - Themerr - Intro Skipper Jellyfin compose: ``` version: "2" services: jellyfin: image: jellyfin/jellyfin container_name: jellyfin hostname: jellyfin #user: 1000:1000 group_add: - '108' environment: - TZ=Europe/Berlin volumes: - ${PWD}/config:/config - ${PWD}/cache:/cache - Lots of media directories - ${PWD}/leaving-soon:/arr/media/leaving-soon ports: - 8096:8096 devices: - /dev/dri/renderD128:/dev/dri/renderD128 - /dev/dri/card1:/dev/dri/card1 - /dev/fb0:/dev/fb0 restart: unless-stopped networks: abc: security_opt: - no-new-privileges:true networks: abc: external: true ``` Could ``` security_opt: - no-new-privileges:true ``` cause this?
Author
Owner

@jellyfin-bot commented on GitHub (Oct 14, 2025):

This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs.

If you have any questions you can use one of several ways to contact us.

@jellyfin-bot commented on GitHub (Oct 14, 2025): This issue has gone 120 days without an update and will be closed within 21 days if there is no new activity. To prevent this issue from being closed, please confirm the issue has not already been fixed by providing updated examples or logs. If you have any questions you can use one of several ways to [contact us](https://jellyfin.org/contact).
Author
Owner

@jellyfin-bot commented on GitHub (Nov 4, 2025):

This issue was closed due to inactivity.

@jellyfin-bot commented on GitHub (Nov 4, 2025): This issue was closed due to inactivity.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#6830