Umbraco 7.2.4 - Internal server error when uploading large file to media section
Hello,
I've recently taken over support of an existing Umbraco solution and am encountering the following problem:
When I attempt to upload a file larger than roughly 40mb to the media section, the file will not upload and I will get an error that looks like this when inspected:
)]}',
{"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.OnActionExecutedAsync(HttpActionExecutedContext actionExecutedContext, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.
The file type does not seem to matter, only the size. I Have both
Hi Mikkel.
Did you find an answer to this one? It looks like you've done everything right. Could you try another (equally big) file? Might be something wrong with that file and not the actual size?
This appears to be a memory problem? Visual Studio reports the following right around the time Umbraco shows "Internal Server Error".
Exception thrown: 'System.OutOfMemoryException' in mscorlib.dll
Exception thrown: 'System.OutOfMemoryException' in mscorlib.dll
Exception thrown: 'System.OutOfMemoryException' in mscorlib.dll
Exception thrown: 'System.OutOfMemoryException' in mscorlib.dll
Exception thrown: 'System.NullReferenceException' in umbraco.dll
Exception thrown: 'System.NullReferenceException' in mscorlib.dll
Exception thrown: 'System.NullReferenceException' in System.Web.Http.dll
Exception thrown: 'System.NullReferenceException' in mscorlib.dll
Exception thrown: 'System.NullReferenceException' in mscorlib.dll
Exception thrown: 'System.NullReferenceException' in System.Web.Http.dll
Exception thrown: 'System.NullReferenceException' in mscorlib.dll
Exception thrown: 'System.NullReferenceException' in mscorlib.dll
Exception thrown: 'System.NullReferenceException' in System.Web.Http.dll
Exception thrown: 'System.NullReferenceException' in mscorlib.dll
Exception thrown: 'System.NullReferenceException' in mscorlib.dll
Exception thrown: 'System.NullReferenceException' in mscorlib.dll
Exception thrown: 'System.NullReferenceException' in mscorlib.dll
Exception thrown: 'System.NullReferenceException' in mscorlib.dll
This is a memory problem. For some reason uploading large files causes some step between MediaService.Saving and MediaService.Saved to use incredible amounts of RAM.
Switching to 64 bit IIS express lets the file be uploaded, but uploading just a 300mb movie file will use almost 2 GB of RAM.
Something is definitely weird here.
EDIT: I will make a new topic now that I know what the problem is.
Umbraco 7.2.4 - Internal server error when uploading large file to media section
Hello,
I've recently taken over support of an existing Umbraco solution and am encountering the following problem:
When I attempt to upload a file larger than roughly 40mb to the media section, the file will not upload and I will get an error that looks like this when inspected:
POST http://localhost:54171/umbraco/backoffice/UmbracoApi/Media/PostAddFile?origin=blueimp 500 (Internal Server Error)
)]}', {"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.OnActionExecutedAsync(HttpActionExecutedContext actionExecutedContext, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.
The file type does not seem to matter, only the size. I Have both
and
in my web config file at the appropriate places. I have tried updating Microsoft.AspNet.WebApi to the latest version, but still the problem persists.
Has anyone else encountered something like this?
Hi Mikkel. Did you find an answer to this one? It looks like you've done everything right. Could you try another (equally big) file? Might be something wrong with that file and not the actual size?
Hi Dennis, thank you for your reply.
I have unfortunately not solved this problem yet.
I have tried with multiple files and file types. Size seems to be the only relevant factor.
The file does get uploaded to the /media folder, but I cannot find it in the Umbraco backend.
What is even stranger is, that after trying one speficic file multiple times, it appeared to work maybe once out of every 20 attempts.
I have tested this on three of our old Umbraco 7.2.4 solutions, and the problem is the same with each one.
Any help would be greatly appreciated.
Follow up!
This appears to be a memory problem? Visual Studio reports the following right around the time Umbraco shows "Internal Server Error".
Follow up.
This is a memory problem. For some reason uploading large files causes some step between MediaService.Saving and MediaService.Saved to use incredible amounts of RAM.
Switching to 64 bit IIS express lets the file be uploaded, but uploading just a 300mb movie file will use almost 2 GB of RAM.
Something is definitely weird here.
EDIT: I will make a new topic now that I know what the problem is.
Hi again Mikkel. That is strange, hopefully someone can help you on the other thread.
I'll post the link to your other thread to close this thread.
Follow --> https://our.umbraco.org/forum/using-umbraco-and-getting-started/79239-uploading-large-media-files-causes-iis-express-worker-process-to-use-excessive-amounts-of-memory
is working on a reply...