U4-6334 - Some images still fail when uploading multiple images in media content

Created by Rune Grønkjær 27 Feb 2015, 10:46:40 Updated by Tim Davis 15 Mar 2018, 12:58:18

Subtask of: U4-9609

This issue might be building on the alread "fixed" U4-4049 issue. I have now upgraded one of our websites to v7.2.2 and I still have problems uploading multiple files. Some of them uploads perfectly and some will show the red "Internal Server Error: Internal Server Error" bar in the bottom of the page.

I can try again, and then maybe some of the failing images will upload correctly. All images will come from the same batch of created files, and be of aproximately the same size. Both png and jpg have failed for me and it happens almost every time.

Chrome will give me the following response message on the call to (http://localhost:50194/umbraco/backoffice/UmbracoApi/Media/PostAddFile?origin=blueimp):

{"Message":"An error has occurred.","ExceptionMessage":"Object reference not set to an instance of an object.","ExceptionType":"System.NullReferenceException","StackTrace":" at Umbraco.Web.WebApi.Filters.FileUploadCleanupFilterAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext)\r\n at System.Web.Http.Filters.ActionFilterAttribute.CallOnActionExecuted(HttpActionContext actionContext, HttpResponseMessage response, Exception exception)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<>c__DisplayClass2.<System.Web.Http.Filters.IActionFilter.ExecuteActionFilterAsync>b__1(CatchInfo1 info)\r\n at System.Threading.Tasks.TaskHelpersExtensions.<>c__DisplayClass41.b__3()\r\n at System.Threading.Tasks.TaskHelpersExtensions.<>c__DisplayClass9`1.b__8(Object state)"}


The Umbraco log will show no errors.

Comments

Rune Grønkjær 24 Mar 2015, 09:30:19

Looks like it's working in 7.2.4. Great job guys!


Dennis Öhman 02 Apr 2015, 13:27:33

We have the same problem.

  • Exception in 7.2.2.
  • Upgraded to 7.2.4 and it worked.
  • After 24h we have the same exception.

Windows 2012 R2 (VMware) IIS 8.5.9600.16384 Umbraco version 7.2.4 assembly: 1.0.5557.19139

at Umbraco.Web.WebApi.Filters.FileUploadCleanupFilterAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext) at System.Web.Http.Filters.ActionFilterAttribute.CallOnActionExecuted(HttpActionContext actionContext, HttpResponseMessage response, Exception exception) at System.Web.Http.Filters.ActionFilterAttribute.<>c__DisplayClass2.<System.Web.Http.Filters.IActionFilter.ExecuteActionFilterAsync>b__1(CatchInfo1 info) at System.Threading.Tasks.TaskHelpersExtensions.<>c__DisplayClass41.b__3() at System.Threading.Tasks.TaskHelpersExtensions.<>c__DisplayClass9`1.b__8(Object state)


Dennis Öhman 02 Apr 2015, 13:30:55

Related issue U4-4049?


Shannon Deminick 07 Apr 2015, 00:16:47

Wait... are you saying it's fixed but then it's not fixed? If you can replicate, we need to know steps.


Rune Grønkjær 07 Apr 2015, 05:50:31

It's working in v7.2.4 where you changed the upload thingy. We have not encountered the problem after upgrading.


Dennis Öhman 07 Apr 2015, 06:23:37

We uploaded the site to the production environment. We hade the uploading issue in 7.2.2 and upgrading to 7.2.4 resolved the issue. BUT the next day we have the same exception. Every backoffice upload using PostAddFile fails.

Is it a configuration issue?

We don't have the issue on iisexpress (VS) or any of our development servers Windows 2008 (HyperV), IIS 7.5.


Dennis Öhman 07 Apr 2015, 06:41:15

I think I have an issue with something else. A clean umbraco install on the same server dosen't have the issue...


Shannon Deminick 07 Apr 2015, 07:00:52

Yup, that sounds odd since not every upload has ever failed, it was only when uploading multiple at a time in certain environments.


Dennis Öhman 07 Apr 2015, 07:32:25

It's very odd, I can see that every image is uploaded in the media folder but it fails to clean temp/fileuploads.


Shannon Deminick 07 Apr 2015, 07:34:45

On your install or a clean install or both? And by 'fail' do you mean like YSOD fail or silently fail?


Dennis Öhman 07 Apr 2015, 07:54:28

The clean install works perfectly.

But the other websites, returns 500 on PostAddFile.

  • Draging different images to the "drop-zone"
  • The image is being uploaded (appers in the media folder)
  • Clearing temp folder fails.
  • The image dosen't appear in media-section.

I do believe I have an permission issue and not an issue with Umbraco. Sorry about that!

PostAddFile Response: ")]}', {"Message":"An error has occurred.","ExceptionMessage":"Object reference not set to an instance of an object.","ExceptionType":"System.NullReferenceException","StackTrace":" at Umbraco.Web.WebApi.Filters.FileUploadCleanupFilterAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext)\r\n at System.Web.Http.Filters.ActionFilterAttribute.CallOnActionExecuted(HttpActionContext actionContext, HttpResponseMessage response, Exception exception)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<>c__DisplayClass2.<System.Web.Http.Filters.IActionFilter.ExecuteActionFilterAsync>b__1(CatchInfo1 info)\r\n at System.Threading.Tasks.TaskHelpersExtensions.<>c__DisplayClass41.b__3()\r\n at System.Threading.Tasks.TaskHelpersExtensions.<>c__DisplayClass9`1.b__8(Object state)"}"


Shannon Deminick 07 Apr 2015, 08:33:54

That object reference issue is highly misleading btw which is why it took forever to solve this before on the other referenced thread. This occurs because of some zany async exception bubbling that happens in WebApi for the file uploads. The exception is actually not coming from there but coming from elsewhere, i'll almost guarantee that.

Can i close this issue now if you have solved it?


Dennis Öhman 07 Apr 2015, 08:50:06

I where wondering the same, that the exception occurs somewhere else. I'll have a deeper look into this.

You can close it!


Shannon Deminick 07 Apr 2015, 08:52:23

cool thx!


Dennis Öhman 07 Apr 2015, 20:33:19

@Shandem FYI, Your comment pointed me in the right direction and I found the issue. uSync hade removed some properties from the mediatypes. I temporarily added a try/catch in FileUploadCleanupFilterAttribute.OnActionExecuted before the ObjectContent typeconversion and it resulted with: "No PropertyType exists with the supplied alias:....".


Shannon Deminick 07 Apr 2015, 23:13:19

If you can let me know what line, etc... I can add a try / catch in the core or do more null checks, etc...


Dennis Öhman 13 Apr 2015, 09:07:06

I Added a null check in FileUploadCleanupFilterAttribute row 55 on Response and Content. But this will leave the temp-folder and media-folder cluttered with "nodeless" files.


Murray Roke 08 Jul 2015, 03:08:04

@shandem I have a website running 7.2.5 and I getting the following response from some of the calls to PostAddFile?origin=blueimp

Note: all the files upload correctly, but a red alert bar appears fro each of these errors.

)]}', {"Message":"An error has occurred.","ExceptionMessage":"Object reference not set to an instance of an object.","ExceptionType":"System.NullReferenceException","StackTrace":" at Umbraco.Web.WebApi.Filters.FileUploadCleanupFilterAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext)\r\n at System.Web.Http.Filters.ActionFilterAttribute.CallOnActionExecuted(HttpActionContext actionContext, HttpResponseMessage response, Exception exception)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<>c__DisplayClass2.<System.Web.Http.Filters.IActionFilter.ExecuteActionFilterAsync>b__1(CatchInfo1 info)\r\n at System.Threading.Tasks.TaskHelpersExtensions.<>c__DisplayClass41.b__3()\r\n at System.Threading.Tasks.TaskHelpersExtensions.<>c__DisplayClass9`1.b__8(Object state)"}


Shannon Deminick 08 Jul 2015, 08:11:46

@Murray.Roke ... as mentioned above, this error is misleading and it's hiding an underlying issue, like permissions, perhaps file size upload limits, or something else. When files are uploaded they go to a temporary folder under App_Data/(something) so make sure all your permissions are correct.


Murray Roke 23 Jul 2015, 02:38:03

@Shandem I uncovered some exceptions in my own indexing handlers, which I've fixed, it would be good if the error could be fixed so it is not misleading.

However, I'm still getting errors, so I tried setting the file permission as liberally as possible on the folder where I found the uploads \App_Data\TEMP\FileUploads fiels are named BodyPart_[guid] and these are not being cleaned up.

If I upload one file it does not get cleaned up and I don't get any errors. Uploading multiple files causes intermittent errors: the exception is occuring on line 55

    var objectContent = actionExecutedContext.Response.Content as ObjectContent;

This is before the File.Delete(f.TempFilePath) which is on line 62

When the exception occurs it's the actionExecutedContext.Response that is null. according to UmbracoUserTimeoutFilterAttributes.cs line 18 this can occur if an error has already occured

     //this can occur if an error has already occurred.
     if (actionExecutedContext.Response == null) return;

So... I commented out all my indexing code, but no change. I also noted when the Response HAS a value the temp files are still not being deleted, when stepping into the delete code I find this line (58)

    var uploadedFiles = objectContent.Value as IHaveUploadedFiles;

this always results in uploadedFiles being null. inspecting objectContent.Value I see:

    base = {System.Linq.Enumerable.WhereSelectListIterator<Umbraco.Web.Models.ContentEditing.ContentItemFile,<>f__AnonymousType1c<string,string,string,string>>}

with a single item in the collection

    [0] = { name = "Jellyfish.jpg", size = "", url = "", thumbnailUrl = "" }

so this can't be cast to IHaveUploadedFiles hence the null.

Summary: I think there's 2 problems

  1. actionExecutedContext.Response is sometimes null (causing red error bars)
  2. objectContent.Value seems to never being cast as IHaveUploadedFiles (causing temp files to not be cleaned up)

This was tested in 7.2.6

Cheers. Murray.


Shannon Deminick 29 Jul 2015, 14:09:00

@Murray.Roke I can verify #2 , this happens when drag/drop uploading files, i'll fix that up. As for #1, there's a ton of null and error checking along with tons of logging for this operation to get to the bottom of why this was ever occurring. You can read a lot about it here: http://issues.umbraco.org/issue/U4-4049 , whether it's a webapi issue or some other black magic but for the most part we got to the bottom of it last time (as seen in that issue)


Murray Roke 03 Aug 2015, 22:33:21

@Shandem regarding #2 how could I track that issue? and which version the fix will appear in? Should we re-open this one or start a new one?


Shannon Deminick 04 Aug 2015, 07:55:56

#2 is done and will be part of 7.3


Murray Roke 04 Aug 2015, 09:51:52

Thanks, you're a legend, I'll have to dig into http://issues.umbraco.org/issue/U4-4049 when I get a mo' and see if I can resolve why we get the extra error messages.

Cheers. Murray.


Jonas Boye 13 Aug 2015, 08:40:36

@Shandem Just FYI, I'm getting this error after upgrading to 7.3 Beta3.

{{ERROR Umbraco.Web.WebApi.Filters.FileUploadCleanupFilterAttribute - Could not acquire actionExecutedContext.Response.ContentSystem.NullReferenceException: Object reference not set to an instance of an object. at Umbraco.Web.WebApi.Filters.FileUploadCleanupFilterAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext) }}

I can't reproduce it on a clean install, but I'll keep trying


Shannon Deminick 13 Aug 2015, 08:43:05

@Jonas.Boye Not sure what that has to do with images failing? That error is coming from the UrlTracker plugin as seen in that stack trace.


Jonas Boye 13 Aug 2015, 08:45:05

Sorry, wrong copy/paste. I've edited now :)


Shannon Deminick 13 Aug 2015, 08:47:05

Where are you seeing this error? Logs, during a request, in the UI, ?? More details the better please.


Jonas Boye 13 Aug 2015, 08:54:52

When i drag/drop a file to media, the UI just says: "Internal Server Error: Internal Server Error"

Tracelog: {{ 2015-08-13 10:52:15,987 [P2672/D9/T129] ERROR Umbraco.Web.WebApi.Filters.FileUploadCleanupFilterAttribute - Could not acquire actionExecutedContext.Response.Content System.NullReferenceException: Object reference not set to an instance of an object. at Umbraco.Web.WebApi.Filters.FileUploadCleanupFilterAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext)}}

The Request itself to PostAddFile returns: {{)] } ', { "Message": "An error has occurred.", "ExceptionMessage": "Object reference not set to an instance of an object.", "ExceptionType": "System.NullReferenceException", "StackTrace": " at Umbraco.Web.RequestLifespanMessagesFactory.Get()\r\n at Umbraco.Core.Services.MediaService.Umbraco.Core.Services.IMediaServiceOperations.Save(IMedia media, Int32 userId, Boolean raiseEvents)\r\n at Umbraco.Web.Editors.MediaController.d__d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Threading.Tasks.TaskHelpersExtensions.d__31.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()" } }}


Shannon Deminick 13 Aug 2015, 08:59:18

Ensure you read this too! http://issues.umbraco.org/issue/U4-4049#comment=67-21938


Jonas Boye 13 Aug 2015, 09:03:58

Ahh there it is! Thanks, it's working now!


mscommunities 16 Nov 2015, 01:09:02

We are still getting this issue on an upgraded 7.3.1 install. Pretty much the same issue that @Jonas.Boye was having. We can't drag/drop any images nor can we add images via the 'Click to upload' button successfully. The images are saved on disk both on the /app_data/TEMP/FileUploads and /media folders but fails somewhere after that. We can however add images via the media tree by clicking 'Create' and then 'Image'. Here are some more details of the issue:

Could not acquire actionExecutedContext.Response.Content System.NullReferenceException: Object reference not set to an instance of an object. at Umbraco.Web.WebApi.Filters.FileUploadCleanupFilterAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext) in c:\projects\umbraco-cms-xtjqd\src\Umbraco.Web\WebApi\Filters\FileUploadCleanupFilterAttribute.cs:line 180

An error has occurred.","ExceptionMessage":"Object reference not set to an instance of an object.","ExceptionType":"System.NullReferenceException","StackTrace":"
at Umbraco.Web.RequestLifespanMessagesFactory.Get() in c:\projects\umbraco-cms-xtjqd\src\Umbraco.Web\RequestLifespanMessagesFactory.cs:line 21 at Umbraco.Core.Services.MediaService.Umbraco.Core.Services.IMediaServiceOperations.Save(IMedia media, Int32 userId, Boolean raiseEvents) in c:\projects\umbraco-cms-xtjqd\src\Umbraco.Core\Services\MediaService.cs:line 0 at Umbraco.Web.Editors.MediaController.d__d.MoveNext() in c:\projects\umbraco-cms-xtjqd\src\Umbraco.Web\Editors\MediaController.cs:line 450 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Threading.Tasks.TaskHelpersExtensions.d__3`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Web.Http.Filters.ActionFilterAttribute.d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.ActionFilterAttribute.d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()


Shannon Deminick 16 Nov 2015, 07:18:54

The reason this occurs is due to a .Net framework/WebApi bug in some specific older versions of Asp.net and WebApi. I realize this has affected a few people but if it was an issue with Umbraco core it would affect everybody. I've spent days on this and added logging to every single line of code to debug it but it is an async issue in some versions of WebApi and .Net where the async thread terminates leaving a context as null. So can you be absolutely sure that you are running with .Net 4.5+ and have all the latest WebApi references installed. Also be sure that you can replicate this with a brand new 7.3.x install since maybe you have old DLLs hanging around in your /bin if you've upgraded.


mscommunities 16 Nov 2015, 07:55:05

I can understand it break locally but we are also seeing this issue when we deploy to a brand new azure web app running .net 4.6. I did a compare of the dll's from the 7.3.1 binaries-only zip file to our deployed project and they are an exact match (exception Newtonsoft.Json which we are using a higher version). We do have extra dll's in our project from other umbraco and nuget packages.


Shannon Deminick 16 Nov 2015, 09:14:31

Can you try with .Net 4.5.x please ?


mscommunities 16 Nov 2015, 09:24:18

Azure web apps only have a dropdown list for 4.6 and 3.5. I confirmed that a clean install of 7.3.1 with our database works as expected.


Shannon Deminick 16 Nov 2015, 09:28:30

So to replicate are you saying I can simply install 7.3.1 on Azure webapps, drag and drop any images and i will see the issue ? Or are there other more specific steps?


mscommunities 16 Nov 2015, 09:34:55

No, I am saying that a clean install of umbraco works. The drag and drop works properly. I will now begin digging through my solution to see what the delta is between my install and a clean one.


mscommunities 16 Nov 2015, 10:05:25

This is what is causing the issue, I remember adding this a long time ago. I think when we moved our umbraco 4 installation from .net 4.0 to .net 4.5.


Shannon Deminick 16 Nov 2015, 10:10:47

Thanks, good to know. So basically setting this to 'false' will cause .Net to behave the old way which makes the .Net behave the old way which has problems. So basically if anyone has this setting, ideally you should just remove this entire appSetting.


Jeavon Leopold 15 Jul 2016, 08:49:23

I've just started to see this error occurring on a stable Umbraco v7.3.8 install and weirdly only for certain pngs.

targetFramework="4.5" is set

WebApi is running latest stable v2 version (v5.2.3) and the server is currently running with .NET framework v4.5.2. I have requested the server is updated to .NET framework v4.6.1 to see if that offers any solution.

Has anyone else seen this issue occur recently with Umbraco v7.3 or v7.4 (it seems most people aren't seeing this anymore)?


Shannon 18 Jul 2016, 02:01:36

@Jeavon i am also having this problem in a 7.4.3 build


Poornima Nayar 09 Aug 2016, 09:51:11

@Shandem I am getting this issue on v7.3.4 upon trying to upload pngs alone. I can upload pngs on local dev and staging but when it gets to the pre-live it fails.


Jeavon Leopold 09 Aug 2016, 09:57:13

We did get the servers updated to .Net v4.6.1 and the issue persists. Like @poornimakrishnav@gmail.com all the exceptions we have observed have been pngs. We have tried to create steps for replication but have failed, we have observed identical server & Umbraco setups where once fails and one is successful. At this time my only theory is that perhaps a particular firewall (as that is not the same between environments) is interrupting in some way...


Jeavon Leopold 25 Oct 2016, 10:35:27

@poornimakrishnav@gmail.com do you have DFS on your site with this issue?


Murray Roke 02 Feb 2017, 03:33:16

(I've added affected versions from all comments)


Jasper van der Sterren 06 Apr 2017, 10:12:09

I had this problem as well. It was caused by what @madsoulswe said earlier ("No PropertyType exists with the supplied alias: umbracoExtension").

It happens when you have media types where not all built-in umbraco properties (like umbracoExtension) are present. In my case, I had a couple of media types where I didn't need those fields, so I didn't include them in the media type. This used to work ok with lower Umbraco 7 versions. After an upgrade (tried 7.5.11 and 7.5.12) I got this error. It can be reproduced by creating a media type without the umbracoExtension field and adding that to the allowed types for a media folder. I don't know if this is the ''only'' cause of the exception, but it is ''one'' cause.

The quick fix is to add the umbracoExtension property to the media type again. To fix it in the core, Umbraco should not assume that all umbraco media properties are present. It looks like the offending line is Umbraco.Core.Models.ContentExtensions, line 589.

if (uploadFieldConfigNode != null) { content.SetValue(uploadFieldConfigNode.LengthFieldAlias, fileSize.ToString(CultureInfo.InvariantCulture)); content.SetValue(uploadFieldConfigNode.ExtensionFieldAlias, extension); }


zorganist 06 Jun 2017, 01:43:34

We're having this issue on our production servers running Umbraco 7.5.4

We originally thought it was linked to traffic/server load as it was tricky to replicate on dev environments.

This issue was due in version 7.6.3 but has now shifted to 7.6.5 - is this issue still being worked on?


Søren 25 Oct 2017, 20:22:22

We're having this issue in our environments with DFS on version 7.5.12

Disabling DFS allows us to upload, but its not an option.

No progress on this one yet?

Can be replicated using this thread: https://our.umbraco.org/forum/using-umbraco-and-getting-started/81200-specific-complexity-pngs-fail-to-upload-with-dfs


Tim Davis 15 Mar 2018, 12:58:18

I'm seeing this issue in our 7.6.4 instance. Only way I can create uploads is to go to Media Library --> Actions --> Create, then use the upload there. Any other upload on the backend results in the below error. I've read this entire thread and verified latest files as mentioned, permissions are correct, using .net 4.5. I can see the file is in TEMP/File Uploads. Any other tips to try?

System.NullReferenceException: Object reference not set to an instance of an object.
   at Umbraco.Web.WebApi.Filters.FileUploadCleanupFilterAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext)```


Priority: Normal

Type: Bug

State: Open

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.2.5, 7.2.6, 7.2.8, 7.3.1, 7.3.4, 7.4.3, 7.5.4, 7.5.11, 7.5.12

Due in version:

Sprint:

Story Points:

Cycle: 4