vijayamadhavareddy / elmah

Automatically exported from code.google.com/p/elmah
Apache License 2.0
0 stars 0 forks source link

Log download with SqlErrorLog fails with InvalidOperationException #230

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Install ELMAH in a web application
2. Configure <errorLog> element to use SqlErrorLog
3. Induce an error through a faulty action
4. Activate the “Download Log” link

What is the expected output? What do you see instead?

Expected the log to be downloaded fully as a CSV file. Instead, the CSV is 
corrupted with partial HTML and the following error logged on the server:

System.InvalidOperationException: Mismatched end method call for asyncResult.  
Expected call to EndExecuteXmlReader but EndExecuteReader was called instead.
   at Elmah.ErrorLogDownloadHandler.AsyncResult.End()
   at Elmah.ErrorLogDownloadHandler.EndProcessRequest(IAsyncResult result)
   at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)

Original issue reported on code.google.com by azizatif on 27 May 2011 at 7:06

GoogleCodeExporter commented 9 years ago

Original comment by azizatif on 31 May 2011 at 6:59

GoogleCodeExporter commented 9 years ago
Fixed in r891.

Original comment by azizatif on 31 May 2011 at 7:02

GoogleCodeExporter commented 9 years ago
Issue 240 has been merged into this issue.

Original comment by jamesdriscoll71 on 20 Jul 2011 at 9:57

GoogleCodeExporter commented 9 years ago
Request to REOPEN issue.

Checked on elmah.1.2.0.1, lastest from NuGet.

Content of CVS is HTML, with exception details:
        <title>Mismatched end method call for asyncResult.  Expected call to EndExecuteXmlReader but EndExecuteReader was called instead.</title>
        <style>
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}

The http://code.google.com/p/elmah/source/detail?r=891 is actually not fix, but 
looks like introduction of bug. There was correct method 'EndExecuteXmlReader', 
used before;

Original comment by alexande...@gmail.com on 16 Aug 2011 at 8:12

GoogleCodeExporter commented 9 years ago
This issue HAS been fixed but not released yet.
For the time being, you will need to download the source and build it yourself.

Original comment by jamesdriscoll71 on 17 Aug 2011 at 9:01

GoogleCodeExporter commented 9 years ago
Thanks! Which version it is planned to be released?

Original comment by alexande...@gmail.com on 27 Aug 2011 at 3:06

GoogleCodeExporter commented 9 years ago
Issue 260 has been merged into this issue.

Original comment by jamesdriscoll71 on 12 Nov 2011 at 3:14

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Request to potentially REOPEN... Tested on both IIS Express 7.5 and IIS 7.0... 
ELMAH version 1.2.14706.955.

Same steps to reproduce problem as original issue posting, except stack trace 
is slightly different.  Can anyone confirm if this is also an issue for them?  
Trying to understand if this may be an issue with using ELMAH with MVC3.

Unhandled Exception: System.NullReferenceException: Object reference not set to 
an instance of an object.
   at Elmah.ErrorLogDownloadHandler.GetErrorsCallback(IAsyncResult result)
   at Elmah.SqlErrorLog.<>c__DisplayClass3.<BeginGetErrors>b__1(IAsyncResult )
   at System.Data.Common.DbAsyncResult.AsyncCallback_Context(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Data.Common.DbAsyncResult.ExecuteCallback(Object asyncResult)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Original comment by kir...@gmail.com on 16 Jul 2013 at 5:53

GoogleCodeExporter commented 9 years ago
@kirse1: The steps to reproduce may be the same but the exception and stack 
trace is different so it might another bug altogether. Could you please post 
this as a separate & new issue? Thanks.

Original comment by azizatif on 17 Jul 2013 at 6:28