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

HTTP 1.1 multipart/form-data is not supported (chunks) #372

Closed
antonini opened this issue Jul 27, 2015 · 33 comments
Closed

HTTP 1.1 multipart/form-data is not supported (chunks) #372

antonini opened this issue Jul 27, 2015 · 33 comments

Comments

@antonini
Copy link
Contributor

When I try to upload large files using a multipart/form-data form, server's throws an error saying that there is no LF after CR in header, line #%d: \"%s\. on class RqLive.

To reproduce this error, run netbout in debug and put a breakpoint on that line. Try to upload a file with more that 5 mb.

Browser will try to upload the file in chunks, but takes does not support that.

@yegor256
Copy link
Owner

@antonini can you please suggest a test, which will reproduce this problem?

@antonini
Copy link
Contributor Author

@yegor256 Need to be a unit test? Or some steps to reproduce inside a real project, such as Netbout?

@yegor256
Copy link
Owner

@antonini just a unit test

@antonini
Copy link
Contributor Author

antonini commented Aug 3, 2015

@yegor256 I couldn't create a unit test that simulate that action, but what I saw is that we don't support chunked-body upload.

I was reading (RFC7230)[https://tools.ietf.org/html/rfc7230] the (Chunked Transfer Coding Section)[https://tools.ietf.org/html/rfc7230#page-36] and I didn't found that implemented on takes.

Netbout use takes, and I was able to receive an error when I tried to upload files larger then 5mb. Google Chrome split the file in chunks (trailers) and netbout return an error.

@yegor256
Copy link
Owner

yegor256 commented Aug 3, 2015

@antonini now it's clear, thanks!

@yegor256 yegor256 added the bug label Aug 3, 2015
@davvd
Copy link

davvd commented Aug 3, 2015

@antonini I am aware of the task, give me some time to find a developer...

@davvd
Copy link

davvd commented Aug 3, 2015

@antonini since the ticket has no milestone I set it to 1.0

@davvd davvd added this to the 1.0 milestone Aug 3, 2015
@davvd
Copy link

davvd commented Aug 3, 2015

@antonini thank you for the ticket reported, I topped your account for 15 mins, transaction AP-82A07418AK0281203

@davvd
Copy link

davvd commented Aug 26, 2015

@mstzn36 this task is for you, keep these principles in mind, and don't hesitate to ask any technical questions

30 mins is the budget of the task. This is exactly how much will be paid when the problem is solved (no matter how much time you will actually spend). See this for more information

@davvd davvd added the @mstzn36 label Aug 26, 2015
@mesut
Copy link

mesut commented Aug 27, 2015

@antonini I couldn't reproduce this bug in my local.I tried to run netbout in debug then upload 6mb file but server didn't throw any error. Can you help please ?

@antonini
Copy link
Contributor Author

@mstzn36 Server doesn't throw errors. To get that error I had to debug it. Have you tried to download the file after uploading it?

@mesut
Copy link

mesut commented Aug 27, 2015

@antonini Yes I did. But size of the downloaded file was 0 bytes. Also i put a breakpoint on RqLive class,it didn't stop :( What is type of file which you try to upload ?

@antonini
Copy link
Contributor Author

@mstzn36 So, you got the point. The downloaded file is "0" because you didn't uploaded it. Netbout hide exception that I said on issue description. What I suggested is to debug the upload process. I don't remember right now the class that throws it. What I saw is that because you are trying to upload a large file, the browser opens a lot of connections pushing small chunks. When I debugged HTTP that was been sent to server I saw that the last line of the first connection refers to "trailer".
What I suggest is to search on the source code the error that I describe on the issue description an put a breakpoint over there. You'll see that.

@mesut
Copy link

mesut commented Aug 27, 2015

@antonini But the result didn't change with the smaller file(151 kb).The downloaded file was still 0. I tried to debug on take and netbout but didn't see any error :( And the local server handled the uploaded file successfully (I checked size of the uploaded file.) I can't reproduce this bug on my local machine :(

Also when I tried to upload 6 MB file on my netbout account, it gave me below error.

java.nio.channels.ClosedByInterruptException
at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:202)
at java.nio.channels.Channels$ReadableByteChannelImpl.read(Channels.java:387)
at org.takes.rq.RqMultipart$Base.copy(RqMultipart.java:277)
at org.takes.rq.RqMultipart$Base.make(RqMultipart.java:248)
at org.takes.rq.RqMultipart$Base.buildRequests(RqMultipart.java:222)
at org.takes.rq.RqMultipart$Base.(RqMultipart.java:140)
at com.netbout.rest.bout.TkAttach.act(TkAttach.java:94)
at com.netbout.rest.bout.FkBout$3.act(FkBout.java:111)
at com.netbout.rest.bout.FkBout$2.act(FkBout.java:89)
at org.takes.facets.fork.FkRegex.route(FkRegex.java:189)
at com.netbout.rest.bout.FkBout.route(FkBout.java:81)
at com.netbout.rest.bout.FkBout.access$000(FkBout.java:

@antonini
Copy link
Contributor Author

@mstzn36 I think that the problem was solved on PR #328.
I just uploaded and downloaded a zip and a pdf file of 9mb to netbout.

@yegor256 Can you confirm that?

@mesut
Copy link

mesut commented Aug 27, 2015

@antonini try to upload a txt file which is larger than 5 mb to netbout and you will get that error. It seems there is a problem with txt file.

@antonini
Copy link
Contributor Author

@mstzn36 I just uploaded an txt with 1kb and another with 9mb. And everything worked fine.

@mesut
Copy link

mesut commented Aug 28, 2015

@antonini I created a new bout and uploaded file.It didn't throw any error. I guess the problem was with my bout which was created by yegor256/netbout#758.
Anyway we can upload and download large files. I can't still reproduce this bug :(

@antonini
Copy link
Contributor Author

@mstzn36 Have you tried with a bout created from web page?

@mesut
Copy link

mesut commented Aug 28, 2015

@antonini yes of course.It did not give any error.

@antonini
Copy link
Contributor Author

@mstzn36 So I think you don't need to change anything.

@yegor256 or @davvd Can you confirm it?

@yegor256
Copy link
Owner

@antonini it's your ticket, you're free to close it any moment

@antonini
Copy link
Contributor Author

@yegor256 Ok.

@antonini
Copy link
Contributor Author

@davvd I just checked and is working fine right now. I think PR #328 fixed that problem too.

@davvd
Copy link

davvd commented Aug 31, 2015

@davvd I just checked and is working fine right now. I think PR #328 fixed that problem too.

@antonini just close the ticket?

@antonini
Copy link
Contributor Author

@davvd Sorry, I did not understood what you meant with your question.

@davvd
Copy link

davvd commented Aug 31, 2015

@davvd Sorry, didn't understood what you me with your question.

@antonini the ticket is closed, we're good here

@davvd
Copy link

davvd commented Sep 1, 2015

@elenavolokhova please, let us know what do you think about this ticket, according to our QA rules

@elenavolokhova
Copy link

@davvd There was no solution provided in this ticket. So the quality is bad here.

@davvd
Copy link

davvd commented Sep 2, 2015

@davvd There was no solution provided in this ticket. So the quality is bad here.

@elenavolokhova thank you for paying attention

@davvd
Copy link

davvd commented Sep 2, 2015

@mstzn36 10 mins was added to the account of @elenavolokhova (for QA review), in transaction 64381283

@mesut
Copy link

mesut commented Sep 2, 2015

@davvd will I get 30 points ?

@davvd
Copy link

davvd commented Sep 3, 2015

@davvd will I get 30 points ?

@mstzn36 of course, in a few hours

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants