Doconut WebFarm. Intermittent 'The process cannot access the file' error

Hello.
We are using WebFarm deployment with shared folder for doconut export path.
Windows Server 2019, .NET 8, Doconut Doconut.NET6 25.9.0.
We got a report that user sees broken 1st page of preview.

After investigating I was able to replicate on the same environment and found error:

2026-01-15 15:09:36.0962 | Error | Thread_17 | 80002b9b-0000-b700-b63f-84710c7967bb | , | Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext+Log.ApplicationError | Connection ID “13186539710551436186”, Request ID “80002b9b-0000-b700-b63f-84710c7967bb”: An unhandled exception was thrown by the application. | 31.135.35.117 System.IO.IOException: The process cannot access the file ‘\VM2\Doconut\b20bbcbc-c049-47c5-95a6-794ed50cf527\1.png’ because it is being used by another process.
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode) at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode) at System.IO.FileStream..ctor(String path, FileMode mode) at .e(String ,  ) at e.(String ,  ) at Aspose.Drawing.Bitmap..ctor(String filename, Boolean useIcm) at Aspose.Drawing.Bitmap..ctor(String filename) at Doconut.Middleware.DoconutWebFarm..MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware.InvokeInternal(HttpContext context, HttpLoggingOptions options, HttpLoggingAttribute loggingAttribute, HttpLoggingFields loggingFields) at Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware.InvokeInternal(HttpContext context, HttpLoggingOptions options, HttpLoggingAttribute loggingAttribute, HttpLoggingFields loggingFields) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT1.ProcessRequestAsync()

As I understand doconut retried to load the same page, but shows with height: 107px;
Capture.PNG (34.7 KB)

I’ve tried to check with ‘Process Monitor’ tool on the file access errors but there no such.

Do you have any idea what could be wrong? Or may be how can we troubleshoot further?

@egormarkov

Thank you for reaching out. To better assist you, could you please send the example file where the error occurs? Please add more details of your architecture.

This will help us to replicate the issue properly. Once we have this information, we will be able to provide you with the appropriate assistance.

Thanks for your help!

Chicken.pdf (151.0 KB)

That happen for any pdf. I’ve attached here the one I used for tests.
We have 2 window servers 2019. One has shared folder. Application run under IIS. Application pool has configured to run under identity who has permissions for shared folder with ‘Load User Profile’ = True.

@egormarkov

The file you attached is ok, that is not the issue. Our support team is still investigating the issue

If you can attach any config on how you are using Doocnut, with a simple sample projetct will be useful for our support and development team to check the source of the problem.

Thanks for your feedback