none
The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))

    Question

  • I am having "one of those issues", IIS is randomly failing with an "The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))" error. The error is literally random. All I can say is that if I do an iisreset it works for a while until it fails with the exact same error again.

    Here's some information I am getting from IIS Health Checks:

    Application information:
        Application domain: /LM/W3SVC/1/Root/EModServices-5-128008423022079854
        Trust level: Full
        Application Virtual Path: /EModServices
        Application Path: C:\Program Files\Oxford Media\Accounting & Support System\Services\EModServices\
        Machine name: OMASSSERVICES

    Process information:
        Process ID: 5540
        Process name: w3wp.exe
        Account name: NT AUTHORITY\NETWORK SERVICE

    Exception information:
        Exception type: COMException
        Exception message: The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))

    Request information:
        Request URL: http://omass.oxfordmediacorp.com/EModServices/EModOperationsService.svc
        Request path: /EModServices/EModOperationsService.svc
        User host address: 68.5.84.111
        User: OMASS\2
        Is authenticated: True
        Authentication Type: Negotiate
        Thread account name: NT AUTHORITY\NETWORK SERVICE

    As for the Stack Trace, all I get is:

    at System.ServiceModel.Activation.HostedHttpRequestAsyncResult..ctor(HttpApplication context, AsyncCallback callback, Object state)
       at System.ServiceModel.Activation.HttpModule.StartBeginProcessRequest(Object sender, EventArgs e, AsyncCallback cb, Object extraData)
       at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

     

    I am now trying to figure out what's going wrong between .NET Reflector and Indigo's trace info. Any information for getting more trace info or some help with the problem will be great.

     

    Wednesday, August 23, 2006 9:43 PM

Answers

  • you can add following tracing code to WCF svc config(or open wcf svc config in svcconfigeditor and click on Diagnostics tab and add verbose leve message and service tracing)

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <system.diagnostics>
            <sources>
                <source name="System.ServiceModel.MessageLogging" switchValue="Verbose,ActivityTracing">
                    <listeners>
                        <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                            <filter type="" />
                        </add>
                        <add name="ServiceModelMessageLoggingListener">
                            <filter type="" />
                        </add>
                    </listeners>
                </source>
                <source name="System.ServiceModel" switchValue="Warning, ActivityTracing"
                    propagateActivity="true">
                    <listeners>
                        <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                            <filter type="" />
                        </add>
                        <add name="ServiceModelTraceListener">
                            <filter type="" />
                        </add>
                    </listeners>
                </source>
            </sources>
            <sharedListeners>
                <add initializeData="messages.svclog"
                    type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                    name="ServiceModelMessageLoggingListener" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack">
                    <filter type="" />
                </add>
                <add initializeData="tracelog.svclog"
                    type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                    name="ServiceModelTraceListener" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack">
                    <filter type="" />
                </add>
            </sharedListeners>
            <trace autoflush="true" />
        </system.diagnostics>
        <system.serviceModel>
            <diagnostics>
                <messageLogging logEntireMessage="true" logMalformedMessages="true"
                    logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
            </diagnostics>
        </system.serviceModel>
    </configuration>

     

    if you see the problem until you reset IIS,you can attatch debugger and create memory dumps on exceptions,that may give more info also,as a first step,we can start with tracing

    Are you using july CTP?

    Thursday, August 24, 2006 7:35 AM
  • Thank you for the response. Yes, I am using July's CTP, I don't know if this is good or bad , but since I enabled Tracing the service has not gone down... I will remove Tracing today in the night to sse if it goes down again.

     

    Thursday, August 24, 2006 7:16 PM

All replies

  • you can add following tracing code to WCF svc config(or open wcf svc config in svcconfigeditor and click on Diagnostics tab and add verbose leve message and service tracing)

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <system.diagnostics>
            <sources>
                <source name="System.ServiceModel.MessageLogging" switchValue="Verbose,ActivityTracing">
                    <listeners>
                        <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                            <filter type="" />
                        </add>
                        <add name="ServiceModelMessageLoggingListener">
                            <filter type="" />
                        </add>
                    </listeners>
                </source>
                <source name="System.ServiceModel" switchValue="Warning, ActivityTracing"
                    propagateActivity="true">
                    <listeners>
                        <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                            <filter type="" />
                        </add>
                        <add name="ServiceModelTraceListener">
                            <filter type="" />
                        </add>
                    </listeners>
                </source>
            </sources>
            <sharedListeners>
                <add initializeData="messages.svclog"
                    type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                    name="ServiceModelMessageLoggingListener" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack">
                    <filter type="" />
                </add>
                <add initializeData="tracelog.svclog"
                    type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                    name="ServiceModelTraceListener" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack">
                    <filter type="" />
                </add>
            </sharedListeners>
            <trace autoflush="true" />
        </system.diagnostics>
        <system.serviceModel>
            <diagnostics>
                <messageLogging logEntireMessage="true" logMalformedMessages="true"
                    logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
            </diagnostics>
        </system.serviceModel>
    </configuration>

     

    if you see the problem until you reset IIS,you can attatch debugger and create memory dumps on exceptions,that may give more info also,as a first step,we can start with tracing

    Are you using july CTP?

    Thursday, August 24, 2006 7:35 AM
  • Thank you for the response. Yes, I am using July's CTP, I don't know if this is good or bad , but since I enabled Tracing the service has not gone down... I will remove Tracing today in the night to sse if it goes down again.

     

    Thursday, August 24, 2006 7:16 PM
  • I've seen many issues that got scared and started hiding once people started closing in on them. If the issue has gone, that's good; if it comes back, by all means please post what you are seeing so that we can take a second look at it.
    Friday, August 25, 2006 4:37 PM
  • I am facing the same issue with my application. Till now, I need to do multiple IISRESET or register aspnet 2.0 again using aspnet_regiis -i -enable and do IISReset to solve the issue.

    However, we are getting this issue very frequently and coming back and back.

    Event Type:    Warning
    Event Source:    ASP.NET 2.0.50727.0
    Event Category:    Web Event
    Event ID:    1309
    Date:        07/07/2012
    Time:        11:50:00
    User:        N/A
    Computer:    LocalBox
    Description:
    Event code: 3005
    Event message: An unhandled exception has occurred.
    Event time: 07/07/2012 11:50:00
    Event time (UTC): 07/07/2012 10:50:00
    Event ID: db315455e002457fb30472e912d0ef84
    Event sequence: 120
    Event occurrence: 119
    Event detail code: 0
     
    Application information:
        Application domain: /LM/W3SVC/1/Root/App-1-129861305452031250
        Trust level: Full
        Application Virtual Path: /App    Application Path: D:\Inetpub\wwwroot\App\
        Machine name: LocalBox
     
    Process information:
        Process ID: 14264
        Process name: w3wp.exe
        Account name: NT AUTHORITY\NETWORK SERVICE
     
    Exception information:
        Exception type: COMException
        Exception message: The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE))
     
    Request information:
        Request URL: http://localhost/APP/WebService.svc
        Request path: /APP/WebService.svc
        User host address: 127.0.0.1
        User: NT AUTHORITY\SYSTEM
        Is authenticated: True
        Authentication Type: Negotiate
        Thread account name: NT AUTHORITY\NETWORK SERVICE
     
    Thread information:
        Thread ID: 7
        Thread account name: NT AUTHORITY\NETWORK SERVICE
        Is impersonating: True
        Stack trace:    at System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e)
       at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
     
     
    Custom event details:

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    One more information, on this box I have dotnet 1.1, 2.0, 3.0, 3.5 & 4.0 installed.

    Please help me in resolving this issue.

    Saturday, July 07, 2012 11:00 AM