Skip to content

This server does not support the IHttpRequestBodySizeFeature #8293

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
andre-ss6 opened this issue Mar 7, 2019 · 10 comments · Fixed by #9475
Closed

This server does not support the IHttpRequestBodySizeFeature #8293

andre-ss6 opened this issue Mar 7, 2019 · 10 comments · Fixed by #9475
Assignees
Labels
accepted This issue has completed "acceptance" testing (including accessibility) area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-iis Includes: IIS, ANCM

Comments

@andre-ss6
Copy link
Contributor

andre-ss6 commented Mar 7, 2019

I have an MVC action decorated with RequestSizeLimitAttribute. However, I'm seeing the following message in my logs every time I hit that route: A request body size limit could not be applied. This server does not support the IHttpRequestBodySizeFeature.

I'm running ASP.NET Core 2.2 with IIS on Windows Server 2016.

I couldn't manage to find not even a single mention of this in Google. I'm guessing it's because I'm running the app behind IIS. If that's the case, does that mean that only web.config limits are supported?

@jkotalik
Copy link
Contributor

jkotalik commented Mar 7, 2019

Are you using IIS In-process? If so, we may have a feature gap there.

So yes, you can set limits on the request body length via https://docs.microsoft.com/en-us/iis/configuration/system.webserver/security/requestfiltering/requestlimits/ and setting in your web.config, but that isn't ideal. We probably should add it to InProcess.

Can you try running out-of-process and see if the feature exists there?

@jkotalik jkotalik added feature-iis Includes: IIS, ANCM area-servers labels Mar 7, 2019
@andre-ss6
Copy link
Contributor Author

Bummer :/ Yea, I'm using in-process. I'll evaluate whether it's best for me to switch to out-of-process or use web.config limits.

Do you have any plans on adding support for that on in-process scenarios?

@jkotalik
Copy link
Contributor

jkotalik commented Mar 7, 2019

I feel like this was just an oversight. We can evaluate how hard this would be to do in IISInprocess and try to put it into 3.0.

@Tratcher
Copy link
Member

Tratcher commented Mar 7, 2019

We should do this, the web.config settings are not granular enough. @blowdart

@Tratcher Tratcher added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Mar 7, 2019
@blowdart
Copy link
Contributor

blowdart commented Mar 7, 2019

Yes you should.

@cni13
Copy link

cni13 commented Mar 18, 2019

We have the same problem. We are hosting In-Process in Azure.
Does this mean that there is no RequestSizeLimit when on IIS? Or does it mean that if I reach the limit and I wanted to disable it, I get an error?
Is there any workaround to only activate the feature if the hosting platform supports it?

@jkotalik
Copy link
Contributor

There is a RequestSizeLimit that is part of IIS: https://docs.microsoft.com/en-us/iis/configuration/system.webserver/security/requestfiltering/requestlimits/. I'm fairly certain this is used when hosting in Azure (not sure what the value is on top of my head). The RequestSizeLimitAttribute can't be used when hosting with IIS today though, so you would need to know which server type you are deploying for.

I'm going to start working on a fix for this now though.

@AFDevMike
Copy link

I see this is closed, but am under impression this is where I would ask. We are experiencing this issue on Azure hosting with Asp.Net Core 2.2. We are hosting In-Process in Azure and using the [RequestSizeLimitAttribute] documented here to decorate a single controller endpoint.

Similar question as @zuckerthoben, is there a workaround and or is this attribute deprecated however it works under the hood?

@Tratcher
Copy link
Member

@AFDevMike it wasn't supported for 2.2 in-proc. It will be supported in 3.0.

The workaround is to use out-of-proc.

@jkotalik
Copy link
Contributor

Acceptance checklist (check one item)

  • We decided not to take this fix.
  • The fix is tests-only.
  • The fix contains product changes (check all items below).
    • Relevant XML documentation comments for new public APIs are present.
    • Narrative docs (docs.microsoft.com) are updated. (check one item below)
      • The change requires a new article. An issue with an outline has been filed here: [ISSUE LINK]
      • The change requires a change to an existing article. A closed docs PR with these changes is linked here: Update docs for new IIS limits AspNetCore.Docs#12318
      • The change requires no docs changes.
    • Verification has been completed. (check one item below)
      • The change is in the shared framework and was verified against the following versions
        • SDK installer: 3.0.100-preview6-012113
        • ASP.NET Core Runtime: 3.0.0-preview6-19279-01
        • .NET Core Runtime: 3.0.0-preview6-27728-04
      • The change is in an OOB NuGet/NPM/JAR package and was verified against the following version of that package: [PACKAGE ID] [VERSION]

@jkotalik jkotalik added accepted This issue has completed "acceptance" testing (including accessibility) and removed Working labels May 29, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted This issue has completed "acceptance" testing (including accessibility) area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-iis Includes: IIS, ANCM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants