Take the community feedback survey now.

ThumbnailManager fails on concurrent uploads – Azure.RequestFailedException not handled

Vote:
 

Description:

We've identified a concurrency issue in Optimizely CMS’s internal ThumbnailManager which handles thumbnail generation and uploads to Azure Blob Storage.

When multiple operations run concurrently on the same asset (e.g., simultaneous uploads or image resizing), the CMS issues conditional upload requests.

If the blob already exists, Azure returns the following exception:Azure.RequestFailedException: The condition specified using HTTP conditional header(s) is not met.

Unfortunately, the ThumbnailManager does not handle this case gracefully, resulting in unhandled exceptions.

This issue appears to stem from internal CMS logic—not from any custom code.


Stack Trace:

EPiServer.Core.Internal.ThumbnailManager.CreateBlob(...) at Azure.Storage.Shared.StorageWriteStream.FlushInternal(...)

Environment details:

  • Optimizely CMS version:

    • EPiServer.CMS version 12.33.1 

    • EPiServer.CMS.Core version 12.22.7
  • .NET version: .NET 8

  • Hosted on: Azure

Please let us know if there’s a known workaround or if this will be addressed in an upcoming release.

#339684
Edited, Jul 15, 2025 10:27
Vote:
 

Hi - have you reported this to our support. I can file a bug if you haven't. Could you please post the full stacktrace of the exception? Thank you for your help

#340032
Aug 22, 2025 11:44
Vote:
 

Thanks for your reply! I have reported this only here, I’d really appreciate it if you could file a bug on your side.

Here’s the full stack trace from the Azure logs:

at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
--- End of stack trace from previous location ---
at Vontobel.Corporate.Cms.Extensions.ApplicationBuilderExtensions.<>c.<<UseCustomHeaders>b__5_0>d.MoveNext() in /src/Vontobel.Corporate.Cms/Extensions/ApplicationBuilderExtensions.cs:line 109
at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.<Invoke>g__AwaitMatch|10_1(EndpointRoutingMiddleware middleware, HttpContext httpContext, Task matchTask)
at Microsoft.AspNetCore.Routing.Matching.DfaMatcher.SelectEndpointWithPoliciesAsync(HttpContext httpContext, IEndpointSelectorPolicy[] policies, CandidateSet candidateSet)
at EPiServer.Web.Routing.Matching.Internal.ContentMatcherPolicy.ApplyAsync(HttpContext httpContext, CandidateSet candidates)
at EPiServer.Web.Routing.Matching.Internal.ContentMatcherPolicy.MapEndpointAsync(Endpoint originalEndpoint, HttpContext httpContext)
at EPiServer.Core.Routing.Internal.DefaultContentUrlResolver.Resolve(Uri url, UrlResolverOptions options)
at EPiServer.Core.Routing.Pipeline.Internal.PartialUrlResolverPipelineStep.Resolve(UrlResolverContext context, UrlResolverOptions options)
at EPiServer.Core.Routing.Internal.BlobPartialRouter.RoutePartial(IContent content, UrlResolverContext segmentContext)
at EPiServer.Core.Internal.ThumbnailManager.CreateImageBlob(Blob sourceBlob, String propertyName, ImageDescriptorAttribute descriptorAttribute)
at EPiServer.Core.Internal.ThumbnailManager.CreateBlob(Uri thumbnailUri, Blob blobSource, ImageOperation imgOperation, String mimeType)
at System.IO.Stream.Close()
at Azure.Storage.Shared.StorageWriteStream.Dispose(Boolean disposing)
at Azure.Storage.Shared.StorageWriteStream.Flush()
at Azure.Core.Pipeline.TaskExtensions.EnsureCompleted(Task task)
at Azure.Storage.Shared.StorageWriteStream.FlushInternal(Boolean async, CancellationToken cancellationToken)
at Azure.Storage.Blobs.BlockBlobWriteStream.CommitInternal(Boolean async, CancellationToken cancellationToken)
at Azure.Storage.Blobs.Specialized.BlockBlobClient.CommitBlockListInternal(IEnumerable`1 base64BlockIds, BlobHttpHeaders blobHttpHeaders, IDictionary`2 metadata, IDictionary`2 tags, BlobRequestConditions conditions, Nullable`1 accessTier, BlobImmutabilityPolicy immutabilityPolicy, Nullable`1 legalHold, Boolean async, CancellationToken cancellationToken)
#340047
Aug 22, 2025 15:28
Vote:
 

Thanks, I will report a bug to the CMS team. It seems the problem is that the underlying Azure Storage APIs are not threadsafe

#340050
Aug 22, 2025 15:41
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.