Skip to content
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

[🐛 BUG]: POST too large #1172

Closed
1 task done
StreetYo opened this issue Jun 13, 2022 · 4 comments · Fixed by roadrunner-server/http#33
Closed
1 task done

[🐛 BUG]: POST too large #1172

StreetYo opened this issue Jun 13, 2022 · 4 comments · Fixed by roadrunner-server/http#33
Assignees
Labels
B-bug Bug: bug, exception
Milestone

Comments

@StreetYo
Copy link

No duplicates 🥲.

  • I have searched for a similar issue in our bug tracker and didn't find any solutions.

What happened?

Hi everyone!
When I'm trying to send more than 8M POST data, I'm getting 500 error with message:

POST too large

Use https://github.com/StreetYo/rr-post-error to reproduce the error.

  1. rr.exe serve
  2. php test.php

Version

php: 8.1
rr.exe version 2.9.4

Relevant log output

# rr.exe serve
[INFO] RoadRunner server started; version: 2.9.4, buildtime: 2022-05-06T16:59:44+0000
2022-06-14T01:52:51.347+0500    DEBUG   server          worker is allocated     {"pid": 18088, "internal_event_name": "EventWorkerConstruct"}
2022-06-14T01:52:51.349+0500    DEBUG   http            http server was started {"address": "0.0.0.0:8080"}
2022-06-14T01:52:58.090+0500    ERROR   http            request forming error   {"start": "2022-06-14T01:52:58.018+0500", "elapsed": "71.2208ms", "error": "http: POST too large"}
@7krasov-casafari
Copy link

7krasov-casafari commented Jun 14, 2022

Hi,
I've got the same problem
I tried without max_request_size, with 0, and with 256 but was unable to pass 12M POST data (it takes 12M if put to the file, but I don't send it as a file)
PHP ini settings are available to accept such size:

command: "php -d memory_limit=192M -d post_max_size=100M /var/app/worker/worker.php"

A request is:
curl -v -X POST http://0.0.0.0:8082/test -H "Content-Type: application/x-www-form-urlencoded" -d @post.txt

It is tested wit both 2.8.8 and 2.10.4

@rustatian
Copy link
Member

Hey 👋🏻 Thanks for the report, I'll try to reproduce the bug, and in case of success, I will fix it in the 2.10.5 (next bugfix release 23.06).

@rustatian rustatian added this to the v2.10.5 milestone Jun 17, 2022
@rustatian
Copy link
Member

Ok guys, this issue is confirmed. The current limit for the x-www-form-urlencoded is 10MB, and I will sync it with the max_request_size limit.

@rustatian
Copy link
Member

Notes (@rustatian): Use the MaxBytesReader here: https://github.com/roadrunner-server/http/blob/master/handler/request.go#L94

r.Body = http.MaxBytesReader(w, r.Body, MaxFileSize) 
r.ParseForm()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-bug Bug: bug, exception
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants