How to configure Http.sys and asp.net web service to run in a docker container

17 Views Asked by At

I run a asp.net web service inside a docker container. The service uses http.sys instead of kestrel.

When I send a request to it from the docker container, it responds.

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
        <Provider Name="Microsoft-Windows-HttpService" Guid="{dd5ef90a-6398-47a4-ad34-4dcecdef795f}" />
        <EventID>8</EventID>
        <Version>0</Version>
        <Level>4</Level>
        <Task>1</Task>
        <Opcode>19</Opcode>
        <Keywords>0x8000000000000006</Keywords>
        <TimeCreated SystemTime="2024-03-21T16:25:38.635348600+00:00" />
        <Correlation ActivityID="{4000000a-0001-fd00-b63f-84710c7967bb}" />
        <Execution ProcessID="1296" ThreadID="512" ProcessorID="1" KernelTime="45" UserTime="15" />
        <Channel>Microsoft-Windows-HttpService/Trace</Channel>
        <Computer />
    </System>
    <EventData>
        <Data Name="RequestId">0xFD0000014000000A</Data>
        <Data Name="ConnectionId">0xFD00000130000008</Data>
        <Data Name="StatusCode">200</Data>
        <Data Name="Verb">GET</Data>
        <Data Name="HeaderLength">       0</Data>
        <Data Name="EntityChunkCount">3</Data>
        <Data Name="CachePolicy">       0</Data>
    </EventData>
    <RenderingInfo Culture="en-US">
        <Level>Information </Level>
        <Opcode>FastResp </Opcode>
        <Keywords>
            <Keyword>Flagged on all HTTP events dealing with request processing </Keyword>
            <Keyword>Flagged on all HTTP events dealing with response handling </Keyword>
        </Keywords>
        <Task>HTTP Request Trace Task </Task>
        <Message>Server application passed response (request ID 0xFD0000014000000A, connection ID 0xFD00000130000008, method GET, header length 0, number of entity chunks 3, cache policy 0) with status code 200. </Message>
        <Channel>HTTP Service Channel </Channel>
        <Provider>Microsoft-Windows-HttpService </Provider>
    </RenderingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
        <Provider Name="Microsoft-Windows-HttpService" Guid="{dd5ef90a-6398-47a4-ad34-4dcecdef795f}" />
        <EventID>9</EventID>
        <Version>0</Version>
        <Level>4</Level>
        <Task>1</Task>
        <Opcode>18</Opcode>
        <Keywords>0x8000000000000006</Keywords>
        <TimeCreated SystemTime="2024-03-21T16:25:38.635760600+00:00" />
        <Correlation ActivityID="{4000000a-0001-fd00-b63f-84710c7967bb}" />
        <Execution ProcessID="1296" ThreadID="512" ProcessorID="1" KernelTime="45" UserTime="15" />
        <Channel>Microsoft-Windows-HttpService/Trace</Channel>
        <Computer />
    </System>
    <EventData>
        <Data Name="RequestId">0xFD0000014000000A</Data>
    </EventData>
    <RenderingInfo Culture="en-US">
        <Level>Information </Level>
        <Opcode>FastRespLast </Opcode>
        <Keywords>
            <Keyword>Flagged on all HTTP events dealing with request processing </Keyword>
            <Keyword>Flagged on all HTTP events dealing with response handling </Keyword>
        </Keywords>
        <Task>HTTP Request Trace Task </Task>
        <Message>Server application passed the last response (corresponding to request ID 0xFD0000014000000A). </Message>
        <Channel>HTTP Service Channel </Channel>
        <Provider>Microsoft-Windows-HttpService </Provider>
    </RenderingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
        <Provider Name="Microsoft-Windows-HttpService" Guid="{dd5ef90a-6398-47a4-ad34-4dcecdef795f}" />
        <EventID>12</EventID>
        <Version>0</Version>
        <Level>4</Level>
        <Task>1</Task>
        <Opcode>21</Opcode>
        <Keywords>0x8000000000000006</Keywords>
        <TimeCreated SystemTime="2024-03-21T16:25:38.635785900+00:00" />
        <Correlation ActivityID="{4000000a-0001-fd00-b63f-84710c7967bb}" />
        <Execution ProcessID="1296" ThreadID="512" ProcessorID="1" KernelTime="45" UserTime="15" />
        <Channel>Microsoft-Windows-HttpService/Trace</Channel>
        <Computer />
    </System>
    <EventData>
        <Data Name="RequestId">0xFD0000014000000A</Data>
        <Data Name="HttpStatus">200</Data>
    </EventData>
    <RenderingInfo Culture="en-US">
        <Level>Information </Level>
        <Opcode>FastSend </Opcode>
        <Keywords>
            <Keyword>Flagged on all HTTP events dealing with request processing </Keyword>
            <Keyword>Flagged on all HTTP events dealing with response handling </Keyword>
        </Keywords>
        <Task>HTTP Request Trace Task </Task>
        <Message>Queued last response (corresponding to request ID 0xFD0000014000000A) for sending. Status code is 200. </Message>
        <Channel>HTTP Service Channel </Channel>
        <Provider>Microsoft-Windows-HttpService </Provider>
    </RenderingInfo>
</Event>

But when I send a request from host machine, it doesn't respond. It only responds header. It misses the event 'Server application passed the last response' and beyond. I eventually need to close request from client that indicates 'Client closed the connection'.

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
        <Provider Name="Microsoft-Windows-HttpService" Guid="{dd5ef90a-6398-47a4-ad34-4dcecdef795f}" />
        <EventID>4</EventID>
        <Version>0</Version>
        <Level>4</Level>
        <Task>1</Task>
        <Opcode>14</Opcode>
        <Keywords>0x8000000000000006</Keywords>
        <TimeCreated SystemTime="2024-03-21T16:15:27.988554200+00:00" />
        <Correlation ActivityID="{4000000e-0000-fd00-b63f-84710c7967bb}" />
        <Execution ProcessID="1296" ThreadID="1696" ProcessorID="1" KernelTime="30" UserTime="30" />
        <Channel>Microsoft-Windows-HttpService/Trace</Channel>
        <Computer />
    </System>
    <EventData>
        <Data Name="RequestId">0xFD0000004000000E</Data>
        <Data Name="ConnectionId">0xFD0000003000000C</Data>
        <Data Name="StatusCode">200</Data>
        <Data Name="Verb">GET</Data>
        <Data Name="HeaderLength">     326</Data>
        <Data Name="EntityChunkCount">3</Data>
        <Data Name="CachePolicy">       0</Data>
    </EventData>
    <RenderingInfo Culture="en-US">
        <Level>Information </Level>
        <Opcode>RecvResp </Opcode>
        <Keywords>
            <Keyword>Flagged on all HTTP events dealing with request processing </Keyword>
            <Keyword>Flagged on all HTTP events dealing with response handling </Keyword>
        </Keywords>
        <Task>HTTP Request Trace Task </Task>
        <Message>Server application passed response (request ID 0xFD0000004000000E, connection ID 0xFD0000003000000C, method GET, header length 326, number of entity chunks 3, cache policy 0) with status code 200. </Message>
        <Channel>HTTP Service Channel </Channel>
        <Provider>Microsoft-Windows-HttpService </Provider>
    </RenderingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    <System>
        <Provider Name="Microsoft-Windows-HttpService" Guid="{dd5ef90a-6398-47a4-ad34-4dcecdef795f}" />
        <EventID>23</EventID>
        <Version>0</Version>
        <Level>4</Level>
        <Task>4</Task>
        <Opcode>29</Opcode>
        <Keywords>0x8000000000000010</Keywords>
        <TimeCreated SystemTime="2024-03-21T16:15:47.577562000+00:00" />
        <Correlation ActivityID="{1aca7a7d-7a74-0000-3243-d01a747ada01}" />
        <Execution ProcessID="0" ThreadID="0" ProcessorID="1" KernelTime="3427455" UserTime="0" />
        <Channel>Microsoft-Windows-HttpService/Trace</Channel>
        <Computer />
    </System>
    <EventData>
        <Data Name="ConnectionObj">0xFFFFDC02D9FDA050</Data>
        <Data Name="Abortive">       1</Data>
    </EventData>
    <RenderingInfo Culture="en-US">
        <Level>Information </Level>
        <Opcode>ConnClose </Opcode>
        <Keywords>
            <Keyword>Flagged on all HTTP events occurring on a connection </Keyword>
        </Keywords>
        <Task>HTTP Connection Trace Task </Task>
        <Message>Client closed the connection (connection pointer 0xFFFFDC02D9FDA050). Status of whether closed by TCP Reset: 1. </Message>
        <Channel>HTTP Service Channel </Channel>
        <Provider>Microsoft-Windows-HttpService </Provider>
    </RenderingInfo>
</Event>

I am expecting my asp.net core application works same for both request. Therefore, I am suspecting the issue is related to the http.sys

0

There are 0 best solutions below