Skip to content

HttpSysRequestDelegationFeature - DelegationRule.Dispose() - Call to HttpCloseUrlGroup Fails with result ERROR_INVALID_PARAMETER #26989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
NGloreous opened this issue Oct 16, 2020 · 6 comments · Fixed by #28336
Assignees
Labels
affected-few This issue impacts only small number of customers area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions bug This issue describes a behavior which is not expected - a bug. severity-minor This label is used by an internal tool
Milestone

Comments

@NGloreous
Copy link
Contributor

Describe the bug

I'm still looking into the details of why this is failing with a result of 87 (ERROR_INVALID_PARAMETER). Regardless I'm not even sure this call should be made for cases when the caller attached to the URL group because it was created by someone else.

To Reproduce

Need to run this code on a preview version of vNext Windows and you'll also need the fix in PR #26983 otherwise you'll hit the nullref issue.

namespace Sample
{
    public class Startup
    {
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostApplicationLifetime lifetime, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            
            var delegator = app.ServerFeatures.Get<IServerDelegationFeature>();
            var rule = delegator.CreateDelegationRule("DefaultAppPool", "http://*:80/");
            rule.Dispose();
        }
    }
}

Exceptions (if any)

fail: Microsoft.AspNetCore.Server.HttpSys.MessagePump[21]
      HttpCloseUrlGroup; Result: 87
@Tratcher
Copy link
Member

Which specific windows build number did you test?

@NGloreous
Copy link
Contributor Author

I'm currently testing on 20239 from the base2 branch but I've hit it on other builds also. I can try a recent preview next week just to make sure it's still an issue there.

@shirhatti
Copy link
Contributor

I'm on 20190 from public insiders and I'm not seeing it. It must have been one of the recent changes

@BrennanConroy BrennanConroy added this to the Next sprint planning milestone Oct 19, 2020
@ghost
Copy link

ghost commented Oct 19, 2020

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@NGloreous
Copy link
Contributor Author

Got confirmation from the http.sys dev that we shouldn't be calling HttpCloseUrlGroup on this URL since the process didn't create it we are just using it. The ERROR_INVALID_PARAMETER error is coming from an access check that fails since this process didn't create it

@BrennanConroy BrennanConroy added affected-few This issue impacts only small number of customers bug This issue describes a behavior which is not expected - a bug. severity-minor This label is used by an internal tool labels Oct 26, 2020 — with ASP.NET Core Issue Ranking
@shirhatti
Copy link
Contributor

The reason it doesn't repro in the current test is because both the delegator and delegatee are in the same process 🤦‍♂️

@shirhatti shirhatti linked a pull request Dec 2, 2020 that will close this issue
@ghost ghost locked as resolved and limited conversation to collaborators Jan 3, 2021
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affected-few This issue impacts only small number of customers area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions bug This issue describes a behavior which is not expected - a bug. severity-minor This label is used by an internal tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants