Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mikkel 6 posts 97 karma points
    Aug 08, 2016 @ 12:51
    Mikkel
    0

    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

    <requestFiltering>
        requestLimits maxAllowedContentLength="457286400" />
    </requestFiltering>"
    

    and

    <httpRuntime requestValidationMode="2.0" enableVersionHeader="false" targetFramework="4.5" maxRequestLength="457286400" executionTimeout="3600" />
    

    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?

  • Dennis Adolfi 1082 posts 6446 karma points MVP 5x c-trib
    Aug 10, 2016 @ 14:24
    Dennis Adolfi
    0

    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?

  • Mikkel 6 posts 97 karma points
    Aug 11, 2016 @ 09:47
    Mikkel
    0

    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.

  • Mikkel 6 posts 97 karma points
    Aug 11, 2016 @ 10:35
    Mikkel
    0

    Follow up!

    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
    
  • Mikkel 6 posts 97 karma points
    Aug 11, 2016 @ 11:01
    Mikkel
    100

    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.

  • Dennis Adolfi 1082 posts 6446 karma points MVP 5x c-trib
    Aug 11, 2016 @ 12:27
    Dennis Adolfi
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft