locked
Request Entity Too large 413 error RRS feed

  • Question

  • User84152574 posted

    Hi,

     I have developed my web application in ASP.Net and hosted on IIS 7 running on windows 2008 and we are using SSL to make secure connection.

    On few pages, I am receiving error number 413: Request entity is too large. The error happens if user opens a page and wait for few minutes before pressing any button on webpage.

    When user press a button on a page after few minutes once page is loaded- the error 413 appears-though error does not appear if I do not wait and works frequently on page.

    On press of button page makes asynchronous call to server using update panel.The page contains 5 tabs and each tab having a gridview control which is loaded on load event of page and gridview page size is 10 for each grid.

    Each grid is having its own update panel to refresh content. No other grid content is refreshing on click of button of a grid except its own.

    I am not uploading any file on this page.

    The same pages works fine on HTTP but not on HTTPS.

     Please help me out, its very urgent to solve this issue .

    Thanks

    Suresh Thakur

    Friday, July 2, 2010 2:08 PM

Answers

  • User84152574 posted

    Hi Arie,

     Thanks for quick reply.

    When I was searching , I also come across such links saying to Reset UploadReadAheadSize value in host config file. But all of the post was giving this solution only if user is uploading a large file.

    But your mentioned link http://www.developmentnow.com/g/59_2005_1_0_0_49331/IIS6-0-SSL-Breaks-down.htm has helped me to understand that the same issue could also come when the page size itself is very large.

    Because the request entity body will become large in both cases.

    Anyway, setting uploadReadAheadSize in applicationHost.config file on IIS7.5 has resolved my issue.

    Why this is happing on SSL? : Because during client renegotiation process,the request entity body must be preloaded using SSL preload. SSL preload will use the value of the UploadReadAheadSize metabase property, which is used for ISAPI extensions. For more details

     Thanks

    Suresh Thakur

     

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Tuesday, July 6, 2010 2:37 AM

All replies

  • User-2060068845 posted

    Hi,

    Haven't had much experience with SSL on IIS7.X, but from some research, i came upon some interesting findings: 

    Try looking into http://blogs.msdn.com/b/jiruss/archive/2007/04/13/http-413-request-entity-too-large-can-t-upload-large-files-using-iis6.aspx

    Although it talks about error found during uploading files to the server, and from your description this isn't the case, verify that your IIS config is set with appropriate values.

    Also, look into http://www.developmentnow.com/g/59_2005_1_0_0_49331/IIS6-0-SSL-Breaks-down.htm, though its an old post and speaks of earlier versions of IIS, quite a few settings from old IIS days can still be found in today's IIS settings. I Would specifically point the answer made by David Wang about midway and the final result of that page.

    Hope this gives you a starting point to figure whats not working :D

    Arie H.

    Sunday, July 4, 2010 12:01 PM
  • User84152574 posted

    Hi Arie,

     Thanks for quick reply.

    When I was searching , I also come across such links saying to Reset UploadReadAheadSize value in host config file. But all of the post was giving this solution only if user is uploading a large file.

    But your mentioned link http://www.developmentnow.com/g/59_2005_1_0_0_49331/IIS6-0-SSL-Breaks-down.htm has helped me to understand that the same issue could also come when the page size itself is very large.

    Because the request entity body will become large in both cases.

    Anyway, setting uploadReadAheadSize in applicationHost.config file on IIS7.5 has resolved my issue.

    Why this is happing on SSL? : Because during client renegotiation process,the request entity body must be preloaded using SSL preload. SSL preload will use the value of the UploadReadAheadSize metabase property, which is used for ISAPI extensions. For more details

     Thanks

    Suresh Thakur

     

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Tuesday, July 6, 2010 2:37 AM
  • User-2060068845 posted

    Excellent !

    Happy the issue is solved, and thanks for the extra clarification.

    Im sure others will benefit from it :D

     

    Take care,

    Arie H.

    Tuesday, July 6, 2010 5:41 AM
  • User84152574 posted

    Use appcmd.exe utility to set UploadReadAheadSize in applicationhost file. The size would be in KB.

     Locate appcmd.exe in \windows\system32\inetsrv folder and run following command on command line tool

     appcmd.exe set config -section:system.webserver/serverruntime/uploadreadaheadsize: 1048576 /commit:apphost

     

    Thursday, August 5, 2010 1:01 AM
  • User1911246586 posted

    CAUTION!!!

    The value is not in KB, it is in bytes as pointed out by Jimmie Russ in his blog post here http://blogs.msdn.com/b/jiruss/archive/2007/04/13/http-413-request-entity-too-large-can-t-upload-large-files-using-iis6.aspx

    Monday, December 19, 2011 2:17 PM
  • User-1577301020 posted

    I had the same problem and setting the uploadReadAheadSize solved it

    http://www.iis.net/configreference/system.webserver/serverruntime

    " The value must be between 0 and 2147483647."

    its easy set it in applicationHost.config-fle

    its located in -->WindowsFOLDER\System32\inetsrv\config (2008 server)

    you must open it with notepad. do a Backup of the file first ...

    according to the comments in config-->

    "The recommended way to unlock sections is by using a location tag:
            <location path="Default Web Site" overrideMode="Allow">
                <system.webServer>
                    <asp />
                </system.webServer>
            </location>"

    so you can write in the bottom-->(since it doesnt exist before --> and i write maxvalue)

    <location path="THENAMEOFTHESITEYOUHAVE" overrideMode="Allow">
                <system.webServer>
                    <asp />
      <serverRuntime uploadReadAheadSize="2147483647" />
                </system.webServer>
            </location>

    if you put it last before </configuration> for example... you know where you have it....

    Hope that solves your problems. Its an SSL issue for me .....

    Friday, March 29, 2013 4:04 AM
  • User-2060068845 posted

    Even when a setting has a maximum value its not wise at all to use that max value.

    So for future reference, what J.Russ wrote in his artice is extremely true:

     

      The default size for this buffer is 48k, which was added to prevent anonymous DOS attacks by uploading very large garbage files.

     

    Thus think of the normal files youre going to transfer, beyond a certain file size youre going to "abuse" your server resources and be in more risk of such attacks for no reason.

    Safe Usage :D

    Arie H.

     

    P.S. Allways back up your config files.

    Saturday, March 30, 2013 2:08 PM
  • User-357201063 posted

    Hi .netdevelop,

    I added like this but it didn't worked.

            <location path="Default Web Site" overrideMode="Allow">              <system.webServer>                  <asp />       <serverRuntime uploadReadAheadSize="2147483647" />              </system.webServer>          </location>

    <configuration>

        <!--

            The <configSections> section controls the registration of sections.         Section is the basic unit of deployment, locking, searching and         containment for configuration settings.                 Every section belongs to one section group.         A section group is a container of logically-related sections.                 Sections cannot be nested.         Section groups may be nested.                 <section             name=""  [Required, Collection Key] [XML name of the section]             allowDefinition="Everywhere" [MachineOnly|MachineToApplication|AppHostOnly|Everywhere] [Level where it can be set]             overrideModeDefault="Allow"  [Allow|Deny] [Default delegation mode]             allowLocation="true"  [true|false] [Allowed in location tags]         />            -->

    Please advice.

     

    Wednesday, August 21, 2013 11:38 AM
  • User-641925838 posted

    Hi Avisek,

    Try using the following command in the Windows/System32/inetsrv. Hope this help.

    appcmd.exe set config -section:system.webserver/serverruntime /uploadreadaheadsize:1048576 /commit:apphost
    Thursday, November 14, 2013 10:23 PM