-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
premature "Nextpart: EOF" on POST /api/v0/add request #8567
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
This almost certainly has nothing to do with multiple packets on the wire (unless there's a very strange bug deep in the go HTTP implementation). How are you making your POST requests? |
as per report above the POST requests are both times the |
Can you post your config? TinyProxy can do a lot more than break requests up into smaller packets. But my guess is that this is because go-ipfs starts streaming its response before it reads the entire request. Go's HTTP library has some bugs around this, and I wouldn't be surprised if TinyProxy does to. Specifically, it's probably closing the request body when it starts seeing a response from the server. |
tinyproxy config
|
would "closing the request body when it starts seeing a response" be something we see in the pcap. |
You'd see a FIN packet. |
Hm. Maybe. That or a zero length chunk. |
Let me dig into those pcaps more. Something fishy is definitely going on here. |
🐟 |
Ok, so the only thing I can think of is that somewhere in go-ipfs we're closing the inbound connection early. This could be due to #5168, or it could be something else entirely. |
if there's a bug in the HTTP stack then this could have broader implications |
Well, if it's related to the issue I posted above, then it's not an issue for most users. It's only an issue when an HTTP server starts responding to a request before reading the entire request.
The strange thing is that we _have_ a workaround for this issue which _should_ "trick" Go's HTTP library into not truncating the body. So I'm not convinced this is the issue.
|
Encountered the same issue when reverse proxying ipfs rpc behind nginx.
Could anyone tell me how to config the reverse proxy like nginx... , it has blocked me for weeks... QQ |
I have the same issue. |
Checklist
Installation method
built from source
Version
Config
Description
POST /api/v0/add
will prematurely respond with "Nextpart: EOF" before even the first part has been sent if the HTTP request is split into multiple packets./ipfs/QmXNuNB13zYS6WDAjkq8YG6mPtdni9xUNrcSzX6xufda8Z/broken.pcap
shows a packet dump. note that the HTTP header set comes in two packets, after the second the API responds with the error before the HTTP request even had a chance to send the first part of the multipart request.by comparison
/ipfs/QmcNL9Dv9XQ6GBDmHmaHByAhNUe5bNCNPkgpMTaDgqpJrP/works.pcap
is the exact same situation except that all HTTP headers come in one packet.the latter is IPFS command line standard behavior. the former (broken) can e.g. per provoked by inserting an HTTP proxy like tinyproxy in the middle.
The text was updated successfully, but these errors were encountered: