Troubleshoot IOException on IAsyncResult and HTTPS

Discussion in 'ASP .Net Web Services' started by Martijn van Schie, Mar 7, 2008.

  1. Hi,

    I have a issue where is ever so often get an IOException:

    Type : System.IO.IOException, mscorlib, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=b77a5c561934e089
    Message : Unable to read data from the transport connection: The connection
    was closed.
    Source : System
    Help link :
    Data : System.Collections.ListDictionaryInternal
    TargetSite : System.IAsyncResult InternalWrite(Boolean, Byte[], Int32,
    Int32, System.AsyncCallback, System.Object)

    We are creating the request custom using the HttpWebRequest object and
    execute the using the Page.RegisterAsyncTask.

    HttpWebRequest request =
    (HttpWebRequest)WebRequest.Create(_navigationUri);

    byte[] requestBytes =
    System.Text.Encoding.ASCII.GetBytes(authenticateMessage);

    request.Method = "POST";
    request.ContentType = "text/xml; charset=\"utf-8\"";
    request.ContentLength = requestBytes.Length;

    combinedAsyncState.ProxyState = new object[] { request,
    requestBytes };
    return request.BeginGetRequestStream(callback, state);

    The error occures only once every 10 minutes during a webtest. The trouble
    is that this is very hard to debug because i cannot reproduce the error when
    i want.
    The party claims they have no error, nor are they responsible for the error.
    Putting something like Fiddler in between to catch the request and response
    message is also no option, because the requests are over HTTPS.

    What is the best opproach to tackle this issue.
    Regards,
    Martijn
    Martijn van Schie, Mar 7, 2008
    #1
    1. Advertising

  2. "Martijn van Schie" <> wrote in message
    news:...
    > Hi,
    >
    > I have a issue where is ever so often get an IOException:

    ....
    > The error occures only once every 10 minutes during a webtest. The trouble
    > is that this is very hard to debug because i cannot reproduce the error
    > when i want.
    > The party claims they have no error, nor are they responsible for the
    > error.
    > Putting something like Fiddler in between to catch the request and
    > response message is also no option, because the requests are over HTTPS.
    >
    > What is the best opproach to tackle this issue.


    Can you try to reproduce it with HTTP?

    Also, please post the entire exception, including the InnerException and
    stack traces.
    --
    --------------------------------------------------------------------------------
    John Saunders | MVP - Windows Server System - Connected System Developer
    John Saunders [MVP], Mar 7, 2008
    #2
    1. Advertising

  3. Hi John,

    It's hard for me to reproduce it using HTTP, because we are using a test
    WebService from a third party authorisation service.

    The entire stacktrace comes to this:

    Stack Trace :
    at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer,
    Int32 offset, Int32 size, AsyncCallback callback, Object state)
    at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32
    size)
    at TestApplication.ClientProxy.EndPostXmlMessageRequest(IAsyncResult
    asyncResult)
    at TestApplication.ClientProxy.EndVerifyRequest(IAsyncResult
    asyncResultRequest)
    at
    TestApplication.Async.AsyncVerification.EndAsyncVerifyRequest(IAsyncResult
    asyncResult)

    We recently found out that a bug in .NET framework 2.0 sometimes results in
    a connection closed causes by a Keep-Alive connection time out. This was
    fixed in SP1.
    I have asked the customer i they have installer SP1 on there production
    machines.


    "John Saunders [MVP]" <john.saunders at trizetto.com> wrote in message
    news:...
    > "Martijn van Schie" <> wrote in message
    > news:...
    >> Hi,
    >>
    >> I have a issue where is ever so often get an IOException:

    > ...
    >> The error occures only once every 10 minutes during a webtest. The
    >> trouble is that this is very hard to debug because i cannot reproduce the
    >> error when i want.
    >> The party claims they have no error, nor are they responsible for the
    >> error.
    >> Putting something like Fiddler in between to catch the request and
    >> response message is also no option, because the requests are over HTTPS.
    >>
    >> What is the best opproach to tackle this issue.

    >
    > Can you try to reproduce it with HTTP?
    >
    > Also, please post the entire exception, including the InnerException and
    > stack traces.
    > --
    > --------------------------------------------------------------------------------
    > John Saunders | MVP - Windows Server System - Connected System Developer
    >
    >
    Martijn van Schie, Mar 10, 2008
    #3
  4. "Martijn van Schie" <> wrote in message
    news:...
    > Hi John,
    >
    > It's hard for me to reproduce it using HTTP, because we are using a test
    > WebService from a third party authorisation service.
    >
    > The entire stacktrace comes to this:
    >
    > Stack Trace :
    > at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer,
    > Int32 offset, Int32 size, AsyncCallback callback, Object state)
    > at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32
    > size)
    > at TestApplication.ClientProxy.EndPostXmlMessageRequest(IAsyncResult
    > asyncResult)
    > at TestApplication.ClientProxy.EndVerifyRequest(IAsyncResult
    > asyncResultRequest)
    > at
    > TestApplication.Async.AsyncVerification.EndAsyncVerifyRequest(IAsyncResult
    > asyncResult)


    That's an interesting pattern of End* method calls. Can you provide an
    outline of the pattern of async calling? Is EndPostXmlMessageRequest your
    code? Does it explicitly call Write on the stream?

    Also, in this case, it's possible that more than just the stack trace may be
    interesting. Can you provide the output of ex.ToString()? That is, when you
    catch the exception, run ToString on the caught exception, then post the
    result. That will include all of the nested InnerException instances.

    --
    --------------------------------------------------------------------------------
    John Saunders | MVP - Windows Server System - Connected System Developer
    John Saunders [MVP], Mar 10, 2008
    #4
  5. Hi John,

    Our customer let me know today that the issue is resolved after installing
    SP1.
    I agree on the End* stack :). The application is programmed to be very
    generic and modulated, and yes, the EndPostXmlMessageRequest is ours. It's
    handles the callback from a custom soap request to a webservice proxy using
    the HttpWebRequest object.

    One problem is that i can't reproduce the issue that easily anymore, as i
    installed SP1 on both the test and development machine. I might have a stack
    for you from an eventlog backup or issue tracker. I'll try to find one and
    post it for you.

    Thank you for your time anyways.

    Regards,
    Martijn


    "John Saunders [MVP]" <john.saunders at trizetto.com> wrote in message
    news:%...
    > "Martijn van Schie" <> wrote in message
    > news:...
    >> Hi John,
    >>
    >> It's hard for me to reproduce it using HTTP, because we are using a test
    >> WebService from a third party authorisation service.
    >>
    >> The entire stacktrace comes to this:
    >>
    >> Stack Trace :
    >> at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[]
    >> buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
    >> at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32
    >> size)
    >> at TestApplication.ClientProxy.EndPostXmlMessageRequest(IAsyncResult
    >> asyncResult)
    >> at TestApplication.ClientProxy.EndVerifyRequest(IAsyncResult
    >> asyncResultRequest)
    >> at
    >> TestApplication.Async.AsyncVerification.EndAsyncVerifyRequest(IAsyncResult
    >> asyncResult)

    >
    > That's an interesting pattern of End* method calls. Can you provide an
    > outline of the pattern of async calling? Is EndPostXmlMessageRequest your
    > code? Does it explicitly call Write on the stream?
    >
    > Also, in this case, it's possible that more than just the stack trace may
    > be interesting. Can you provide the output of ex.ToString()? That is, when
    > you catch the exception, run ToString on the caught exception, then post
    > the result. That will include all of the nested InnerException instances.
    >
    > --
    > --------------------------------------------------------------------------------
    > John Saunders | MVP - Windows Server System - Connected System Developer
    >
    >
    Martijn van Schie, Mar 10, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex Hunsley
    Replies:
    0
    Views:
    5,078
    Alex Hunsley
    Jun 28, 2006
  2. FefeOxy

    ASyncResult vs. IASyncResult

    FefeOxy, Feb 2, 2006, in forum: C++
    Replies:
    3
    Views:
    394
    red floyd
    Feb 2, 2006
  3. UL-Tomten
    Replies:
    0
    Views:
    546
    UL-Tomten
    Dec 9, 2007
  4. johnmann56
    Replies:
    0
    Views:
    150
    johnmann56
    May 24, 2004
  5. Replies:
    1
    Views:
    76
    Tim Williams
    Oct 18, 2006
Loading...

Share This Page