Skip to content

Improve exception when HTTP.sys can't register a prefix#20718

Merged
2 commits merged into
dotnet:masterfrom
0xced:0xced/httpsys-improved-exception
Apr 27, 2020
Merged

Improve exception when HTTP.sys can't register a prefix#20718
2 commits merged into
dotnet:masterfrom
0xced:0xced/httpsys-improved-exception

Conversation

@0xced
Copy link
Copy Markdown
Contributor

@0xced 0xced commented Apr 10, 2020

Propose an actionable solution and include a link to the documentation.

@guardrex Can you create an aka.ms link to https://docs.microsoft.com/aspnet/core/fundamentals/servers/httpsys#configure-windows-server that I could use in the exception message?

@guardrex
Copy link
Copy Markdown
Contributor

I can't ... I don't have access ... but @Rick-Anderson might help or advise.

@0xced 0xced force-pushed the 0xced/httpsys-improved-exception branch from 824f8cf to 9f4b507 Compare April 12, 2020 23:16
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test for this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Environment.UserName in the right format to insert directly into the command?

Copy link
Copy Markdown
Contributor Author

@0xced 0xced Apr 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@halter73 I added a test in 52c0eff.
@Tratcher I included both the domain + user in DOMAIN\User format, as documented on Configuring namespace reservations, also in 52c0eff.

Comment thread src/Servers/HttpSys/src/Resources.resx Outdated
Comment thread src/Servers/HttpSys/src/Resources.resx Outdated
@0xced 0xced force-pushed the 0xced/httpsys-improved-exception branch from 9f4b507 to 6e43a83 Compare April 16, 2020 06:13
@analogrelay analogrelay added this to the 5.0.0-preview5 milestone Apr 20, 2020
@0xced 0xced force-pushed the 0xced/httpsys-improved-exception branch 2 times, most recently from 9a0943f to 8784857 Compare April 23, 2020 19:59
Propose an actionable solution and include a link to the documentation.
@0xced 0xced force-pushed the 0xced/httpsys-improved-exception branch from 8784857 to 52c0eff Compare April 23, 2020 20:02
@0xced
Copy link
Copy Markdown
Contributor Author

0xced commented Apr 23, 2020

I addressed the concerns raised by @shirhatti, @halter73 and @Tratcher, rebased onto master and force-pushed 52c0eff.

@Tratcher
Copy link
Copy Markdown
Member

Tratcher commented Apr 23, 2020

The new test failed on helix.
https://dev.azure.com/dnceng/public/_build/results?buildId=614229&view=ms.vss-test-web.build-test-results-tab&runId=19274364&resultId=107864&paneView=debug

Assert.Throws() Failure

Expected: typeof(Microsoft.AspNetCore.Server.HttpSys.HttpSysException)

Actual: (No exception was thrown)

You wouldn't get AccessDenied if the test were run as admin, right? I wonder if Helix does that. @HaoK ?

@Tratcher Tratcher self-assigned this Apr 23, 2020
@shirhatti
Copy link
Copy Markdown
Contributor

You could change the hostname in the test to localhost though? You wouldn't need elevation for that

@Tratcher
Copy link
Copy Markdown
Member

The point is that the test wants AccessDenied and isn't getting it.

@HaoK
Copy link
Copy Markdown
Member

HaoK commented Apr 24, 2020

So this is failing because of a sudo issue?

@HaoK
Copy link
Copy Markdown
Member

HaoK commented Apr 24, 2020

Yeah so our helix jobs do run as admin, so if the tests were expecting admin access failures, you might need to skip this test on helix

@ghost
Copy link
Copy Markdown

ghost commented Apr 24, 2020

Hello @Tratcher!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

}

[ConditionalFact]
[SkipOnHelix("https://github.com/dotnet/aspnetcore/pull/20718#issuecomment-618758634")]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can target specific queues, if this only is an issue on Windows queues, it might be best to use the OS skip on windows

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All HttpSys tests only run on Windows.

@Tratcher
Copy link
Copy Markdown
Member

Unrelated broken test: #21191

@Tratcher Tratcher closed this Apr 27, 2020
@Tratcher Tratcher reopened this Apr 27, 2020
@ghost ghost merged commit b73b202 into dotnet:master Apr 27, 2020
@0xced 0xced deleted the 0xced/httpsys-improved-exception branch April 28, 2020 06:46
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants