Copied to clipboard

Flag this post as spam?

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


  • John Dawson 20 posts 131 karma points
    Jan 31, 2020 @ 13:58
    John Dawson
    0

    ImageProcessor: issue downloading remote files

    Hi, I am migrating a web platform from another hoster (Azure VMs) into my own Azure VM and when I navigate to a certain area of the site I am getting an error. In the TraceLog it shows:

    2020-01-31 11:46:46,125 [P3516/D2/T19] ERROR 
    
    Umbraco.Core.UmbracoApplicationBase - An unhandled exception occurred
    System.Security.SecurityException: An attempt to download a remote file has been halted because the file is larger than allowed.
       at ImageProcessor.Web.Helpers.RemoteFile.<GetWebResponseAsync>d__17.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at ImageProcessor.Web.Services.CloudImageService.<GetImage>d__16.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at ImageProcessor.Web.HttpModules.ImageProcessingModule.<ProcessImageAsync>d__34.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar)
       at System.Web.HttpApplication.AsyncEventExecutionStep.InvokeEndHandler(IAsyncResult ar)
       at System.Web.HttpApplication.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar)
    The Zone of the assembly that failed was:
    MyComputer
    

    So I had a look online and found some conversations related to the same issue here and here.

    Looking in web.config I can see:

    <httpRuntime requestValidationMode="2.0" enableVersionHeader="false" targetFramework="4.5" maxRequestLength="1048576" executionTimeout="360" fcnMode="Single" />
    

    Also within web.config under system.Webserver:

    <requestLimits maxAllowedContentLength="1073741824" maxUrl="65536" />
    

    and in security.config:

    <setting key="MaxBytes" value="8194304" />
    

    So this seems like plenty in terms of max filesize to me (too much, in fact). I have the media folder set up in Azure blob storage and had a look in this to see if there were any files that exceeded 8MB. I can see some video files in there that are between 160-360MB and some images that are ~25MB. Obviously this is too large for the max specified size, but this is legacy code that has been sent over from a web agency so I am using the same settings as they set in the code which was working correctly.

    So the live site currently uses those settings without issue whereas my site (not live yet until I can get it working properly), which uses the same config settings and source code comes up with that error. Does anyone know how I might diagnose the issue?

    Thanks a lot,

    John

  • Ambert van Unen 65 posts 376 karma points
    Jan 31, 2020 @ 14:16
    Ambert van Unen
    0

    Hi John,

    another hoster (Azure VMs) into my own Azure VM and when I navigate to a certain area of the site I am getting an error

    Looks like there's still a setting difference on the VM itself.

    If the files aren't the problem (as you say you have the same source) that is the only part I can imagine which is the problem right now... Unless you have seperate .config files?

  • John Dawson 20 posts 131 karma points
    Jan 31, 2020 @ 14:20
    John Dawson
    0

    Yeah they zipped up the source code and media folder and sent it over to me. I changed the various config files to point to my own Azure resources (storage account, id, key, etc.) in web.config and the various config files in ImageProcessor...

  • Ambert van Unen 65 posts 376 karma points
    Jan 31, 2020 @ 14:32
    Ambert van Unen
    0

    Double checked the ImageProcessor config file?

    As far as I know the error you are receiving is related to the ImageProcessor, if the config file is the same as original... I'm out of ideas :/

  • John Dawson 20 posts 131 karma points
    Jan 31, 2020 @ 14:39
    John Dawson
    0

    Yeah I copied the original config files and only changed the values for host name, account name and account key..

    I'll see if the guys who sent the code over can explain it. Perhaps it's something to do with the way I have set up the blob storage resource in Azure Portal.

    Thanks!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies