You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
15.1.1
Bug summary
The Media Delivery API will not deliver your media item, if the media item is stored in a folder in your backoffice structure, and if you request it using the /umbraco/delivery/api/v2/media/item/{id}-endpoint.
If you query your media item using it's ID and it's placed in a folder, one of two things will happen:
The request will continue to run until you eventually run out of memory and get a System.OutOfMemoryException simmilar to the one highlighted below
The request will timeout depended on your hosting
Specifics
This happens specifically for the /umbraco/delivery/api/v2/media/item/{id}-endpoint.
The System.OutOfMemoryException:
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
at Umbraco.Cms.Infrastructure.HybridCache.PublishedContent..ctor(ContentNodecontentNode,Booleanpreview,IElementsCacheelementsCache,IVariationContextAccessorvariationContextAccessor)
at Umbraco.Cms.Infrastructure.HybridCache.Services.MediaCacheService.GetNodeAsync(Guidkey)
at Umbraco.Cms.Infrastructure.HybridCache.Services.MediaCacheService.GetByKeyAsync(Guidkey)
at Umbraco.Cms.Infrastructure.HybridCache.MediaCache.GetByIdAsync(Guidkey)
at Umbraco.Cms.Infrastructure.DeliveryApi.ApiMediaWithCropsResponseBuilder.GetParent(IPublishedContentmedia)
at Umbraco.Cms.Infrastructure.DeliveryApi.ApiMediaWithCropsResponseBuilder.PathSegments(IPublishedContentmedia)+MoveNext()
at System.Linq.Enumerable.<ToArray>g__EnumerableToArray|314_0[TSource](IEnumerable`1source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1source)
at System.Linq.Enumerable.ReverseIterator`1.MoveNext()
at System.String.Join(Stringseparator, IEnumerable`1values)
at Umbraco.Cms.Infrastructure.DeliveryApi.ApiMediaWithCropsResponseBuilder.Create(IPublishedContentmedia,IApiMediainner,ImageFocalPointfocalPoint, IEnumerable`1crops)
at Umbraco.Cms.Infrastructure.DeliveryApi.ApiMediaWithCropsBuilderBase`1.Build(MediaWithCropsmedia)
at Umbraco.Cms.Infrastructure.DeliveryApi.ApiMediaWithCropsBuilderBase`1.Build(IPublishedContentmedia)
at Umbraco.Cms.Api.Delivery.Controllers.Media.MediaApiControllerBase.BuildApiMediaWithCrops(IPublishedContentmedia)
at Umbraco.Cms.Api.Delivery.Controllers.Media.ByIdMediaApiController.HandleRequest(Guidid)
at Umbraco.Cms.Api.Delivery.Controllers.Media.ByIdMediaApiController.ByIdV20(Guidid)
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContextactionContext,IActionResultTypeMappermapper,ObjectMethodExecutorexecutor,Objectcontroller,Object[]arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvokerinvoker, ValueTask`1actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvokerinvoker,TasklastTask,Statenext,Scopescope,Objectstate,BooleanisCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealedcontext)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State&next,Scope&scope,Object&state,Boolean&isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()---Endof stack trace from previous location ---at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvokerinvoker,TasklastTask,Statenext,Scopescope,Objectstate,BooleanisCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealedcontext)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State&next,Scope&scope,Object&state,Boolean&isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()---Endof stack trace from previous location ---at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvokerinvoker,Tasktask,IDisposablescope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvokerinvoker,Tasktask,IDisposablescope)
at Umbraco.Cms.Web.Common.Middleware.BasicAuthenticationMiddleware.InvokeAsync(HttpContextcontext,RequestDelegatenext)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()---Endof stack trace from previous location ---at Umbraco.Cms.Api.Management.Middleware.BackOfficeExternalLoginProviderErrorMiddleware.InvokeAsync(HttpContextcontext,RequestDelegatenext)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()---Endof stack trace from previous location ---at Umbraco.Cloud.Cms.PublicAccess.Middleware.CloudPublicAccessMiddleware.InvokeAsync(HttpContextcontext,RequestDelegatenext)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()---Endof stack trace from previous location ---at Umbraco.Deploy.Infrastructure.Middleware.BearerTokenAuthenticationMiddleware.InvokeAsync(HttpContextcontext,RequestDelegatenext)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()---Endof stack trace from previous location ---atMicrosoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContextcontext)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContextcontext)
at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContextcontext)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContextcontext)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContextcontext)
at StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContextcontext) in C:\projects\dotnet\src\MiniProfiler.AspNetCore\MiniProfilerMiddleware.cs:line 112
at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestMiddleware.InvokeAsync(HttpContextcontext,RequestDelegatenext)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()--- End of stack trace from previous location ---
at Umbraco.Cms.Web.Common.Middleware.PreviewAuthenticationMiddleware.InvokeAsync(HttpContextcontext,RequestDelegatenext)at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()---Endof stack trace from previous location---at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestLoggingMiddleware.InvokeAsync(HttpContextcontext,RequestDelegatenext)at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()---Endof stack trace from previous location---at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContexthttpContext,Booleanretry)at Umbraco.Forms.Web.HttpModules.ProtectFormUploadRequestsMiddleware.InvokeAsync(HttpContextcontext,RequestDelegatenext)at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()---Endof stack trace from previous location---at Umbraco.Cms.Api.Management.Middleware.BackOfficeAuthorizationInitializationMiddleware.InvokeAsync(HttpContextcontext,RequestDelegatenext)at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()---Endof stack trace from previous location---at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync()
Steps to reproduce
Set up a new Umbraco 15.1.1 project
Enable Content and Media Delivery APIs
Create a folder in the media section
Upload an image to the folder and grab the idea
Use Swagger UI or Postman to send a GET request to the /umbraco/delivery/api/v2/media/item/{id}-endpoint with the ID of your uploaded item.
You will see that it will keep on loading, until eventually running out of memory or simply timing out.
Expected result / actual result
The Media Delivery API should deliver the media item as it does when it's not placed in a folder.
The text was updated successfully, but these errors were encountered:
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
15.1.1
Bug summary
The Media Delivery API will not deliver your media item, if the media item is stored in a folder in your backoffice structure, and if you request it using the
/umbraco/delivery/api/v2/media/item/{id}
-endpoint.If you query your media item using it's ID and it's placed in a folder, one of two things will happen:
System.OutOfMemoryException
simmilar to the one highlighted belowSpecifics
This happens specifically for the
/umbraco/delivery/api/v2/media/item/{id}
-endpoint.The
System.OutOfMemoryException
:Steps to reproduce
/umbraco/delivery/api/v2/media/item/{id}
-endpoint with the ID of your uploaded item.Expected result / actual result
The Media Delivery API should deliver the media item as it does when it's not placed in a folder.
The text was updated successfully, but these errors were encountered: