WebException, The Operation Has Timed Out

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

WebException, The Operation Has Timed Out

Guest-857

Thanks again for a great utility Dean!  I used your advice and was successfully able to setup the application utilizing NeatUpload in staging and am now working with the team to move it to production.  I don't have access to the server that the application will reside on but will give as much detail as I possibly can and include an error from the IIS event viewer.

- NeatUpload 1.1.3
- IIS 6
- ASP.NET 2.0
- Windows Server 2003
- anonymous access granted to the upload directory as well as the NeatUpload directory
- the upload directory serves as the tempDirectory as well

The application works great on staging and I'm able to upload files totaling nearly 800MB with no timeouts.  As soon as the team moved the application over to production we noticed timeouts almost instantly (within 5 minutes) on files over 50MB.  The IIS configurations are supposed to be similar and unfortunately I'm not able to remote in.  I did request and received the following event log for this application.  I'm hoping that maybe you can see something that I missed by viewing the stack trace and the configurations we are using. 

The production site requires authentication and the staging does not.  We did move the application to a directory on the production server that did not require authentication and the results were the same.

Thanks,

<neatUpload xmlns="http://www.brettle.com/neatupload/config/2008"
     useHttpModule="true"
     maxNormalRequestLength="2097151"
     maxRequestLength="2097151"
     defaultStorageProvider="FilesystemUploadStorageProvider"
     defaultStateStoreProvider="SessionBasedUploadStateStoreProvider">
        <providers>
            <add name="FilesystemUploadStorageProvider" type="Brettle.Web.NeatUpload.FilesystemUploadStorageProvider, Brettle.Web.NeatUpload"/>
            <add name="SessionBasedUploadStateStoreProvider" type="Brettle.Web.NeatUpload.SessionBasedUploadStateStoreProvider, Brettle.Web.NeatUpload"/>
        </providers>
    </neatUpload>

    <location path="Default.aspx">
        <system.web>
            <httpRuntime maxRequestLength="2097151" executionTimeout="43200" useFullyQualifiedRedirectUrl="true"/>
            <httpModules>
                <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload"/>
            </httpModules>
        </system.web>
        <neatUpload maxRequestLength="2097151" useHttpModule="true" xmlns="http://www.brettle.com/neatupload/config/2008"/>
    </location>
   
    <!-- neat upload -->
   
 <system.web>
  <customErrors mode="Off" />
  <compilation debug="true" />
  <httpRuntime maxRequestLength="2097151" enable="true" requestLengthDiskThreshold="8192" executionTimeout="43200" />
  <authentication mode="Windows" />
  <sessionState timeout="720" />
  <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="auto" uiCulture="auto" enableClientBasedCulture="true" /> 
  
  <!-- neat upload -->

        <httpModules>
            <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" />
        </httpModules>
       
        <!-- neat upload -->
       
 </system.web>
 <system.webServer>
     <httpRuntime maxRequestLength="2097151" enable="true" requestLengthDiskThreshold="8192" executionTimeout="43200" />
        <sessionState timeout="720" />
        <modules>
            <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" preCondition="managedHandler"/>
        </modules>
  <security>
   <requestFiltering>
    <requestLimits maxAllowedContentLength="2147483648" executionTiemout="43200" />
   </requestFiltering>
  </security>
 </system.webServer>

 

/************************************************/
/************************************************/

Event Type:        Warning
Event Source:    ASP.NET 2.0.50727.0
Event Category:                Web Event
Event ID:              1309
Date:                     12/01/2009
Time:                     19:28:20
User:                     N/A
Computer:          COMPUTER_NAME
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 1/12/2009 7:28:20 PM
Event time (UTC): 1/12/2009 7:28:20 PM
Event ID: 44b16d86caf14463bd75faca1cd1c0f7
Event sequence: 1028
Event occurrence: 1
Event detail code: 0
 
Application information:
    Application domain: APPLICATION_DOMAIN
    Trust level: Full
    Application Virtual Path: /
    Application Path: D:\inetpub\wwwroot\APPLICATION_DIRECTORY
    Machine name: MACHINE_NAME
 
Process information:
    Process ID: 7896
    Process name: w3wp.exe
    Account name: NT AUTHORITY\NETWORK SERVICE
 
Exception information:
    Exception type: WebException
    Exception message: The operation has timed out
 
Request information:
    Request URL: 
    Request path: 
    User host address: 
    User: 
    Is authenticated: False
    Authentication Type: 
    Thread account name: NT AUTHORITY\NETWORK SERVICE
 
Thread information:
    Thread ID: 1
    Thread account name: NT AUTHORITY\NETWORK SERVICE
    Is impersonating: False
    Stack trace:    at System.Net.WebClient.UploadValues(Uri address, String method, NameValueCollection data)
   at System.Net.WebClient.UploadValues(String address, NameValueCollection data)
   at Brettle.Web.NeatUpload.SimpleWebRemoting.MakeRemoteCall(Uri uri, HttpCookieCollection httpCookies, Byte[] encryptionKey, Byte[] validationKey, String encryptionAlgorithm, String validationAlgorithm, Object[] methodCall)
   at Brettle.Web.NeatUpload.SessionBasedUploadStateStoreProvider.Cleaner.CleanUpIfStale(String postBackID)
   at Brettle.Web.NeatUpload.UploadStateStore.CacheItem_Remove(String postBackID, Object val, CacheItemRemovedReason reason)
   at System.Web.Caching.CacheEntry.CallCacheItemRemovedCallback(CacheItemRemovedCallback callback, CacheItemRemovedReason reason)

Reply | Threaded
Open this post in threaded view
|

Re: WebException, The Operation Has Timed Out

Guest-857

It should also be worth mentioning that the application isn't in a web garden / farm and doesn't use a proxy server.

Reply | Threaded
Open this post in threaded view
|

Re: WebException, The Operation Has Timed Out

Dean Brettle
Administrator
It sounds like there are 2, possibly related, issues.  The first is that you can't upload files over 50MB.  There is probably something between the browser and your app that is limiting the size of the upload.  For example, URLScan and IIS7 request filtering have both been known to restrict the size of uploads.  To ensure that it isn't a problem with NeatUpload, remove the UploadHttpModule from your Web.config and try to upload a large file again.  You won't get a progress bar, but the InputFile and MultiFile controls should continue to function.  If you still get the "page can not be displayed" error when uploading large files, the problem is probably with something other than NeatUpload.  You could create a separate test page on the same server and user a standard FileUpload ASP.NET control (with the UploadHttpModule removed from the Web.config) if you wanted to be absolutely certain that NeatUpload wasn't the cause.

The issue with the timeout in the logs might also be firewall related if there is something that is preventing the server from connecting to itself.  Since you aren't using a web garden/farm, the easiest way to workaround that issue is to use the InProcUploadStateStoreProvider by changing your <neatUpload> section to:

<neatUpload xmlns="http://www.brettle.com/neatupload/config/2008"
     useHttpModule="true"
     maxNormalRequestLength="2097151"
     maxRequestLength="2097151"
     defaultStorageProvider="FilesystemUploadStorageProvider"
     defaultStateStoreProvider="InProcBasedUploadStateStoreProvider">
        <providers>
            <add name="FilesystemUploadStorageProvider" type="Brettle.Web.NeatUpload.FilesystemUploadStorageProvider, Brettle.Web.NeatUpload"/>
            <add name="InProcBasedUploadStateStoreProvider" type="Brettle.Web.NeatUpload.InProcBasedUploadStateStoreProvider, Brettle.Web.NeatUpload"/>
        </providers>
    </neatUpload>

--Dean


Reply | Threaded
Open this post in threaded view
|

Re: WebException, The Operation Has Timed Out

Dean Brettle
Administrator
One more question: Was the progress display updating when you uploaded smaller (< 50Mbyte) files to the production server.
--Dean