question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CIO] java.io.EOFException when parsing response to multi-part form data

See original GitHub issue

Ktor Version and Engine Used (client or server and name) 1.2.6 and 1.3.0-beta-2, ktor-client-cio

Describe the bug About 30% of the time, when sending a multi-part form data request to Discord’s servers, the CIO client fails to parse the response sent by the server and ceases to function. The error thrown is java.io.EOFException: Failed to parse HTTP response: unexpected EOF, which causes a java.io.IOException: Connection reset by peer, which essentially softlocks the HttpClient. This does not happen with ktor-client-okhttp, only CIO. The trace is here: https://hastebin.com/cikecature.txt

To Reproduce I can’t provide an easy method of reproduction, as I’m not sure what part of the response is causing this behavior, and it could be specific to this scenario. If it helps, I can provide a packet capture from Wireshark.

Expected behavior I expected the client to correctly parse the response.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dmitrievanthonycommented, Dec 16, 2019

Hi, @serebit. I’ve just merged the fix, so it will be included in 1.3.0.

0reactions
serebitcommented, Dec 18, 2019

Yep, just updated to 1.3.0-rc and hammered my test application with attachments, seems like that did it! Much appreciated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.io.EOFException when using Multipart form - JBoss.org
Trinidad notices that it's a multipart form data and tries to parse it by itself to find uploaded files and since the stream...
Read more >
exception when parsing multipart form data - Stack Overflow
I've modified the application to simply write the needed response instead of redirecting. This problem was observed and fixed as described in ...
Read more >
EOFException - ktor
ktor-io/io.ktor.utils.io.errors/EOFException. EOFException. common js jvm posix. expect open class EOFException( message: String) : IOException.
Read more >
java.io.IOException: Posted content type isn't multipart/form-data
I'm getting the following error: java.io.IOException: Posted content type isn't multipart/form-data.
Read more >
Processing of multipart/form-data request failed. null - Apache
Processing of multipart/form-data request failed. null ... have successfully been transmitted yet parsing the request, ultimately, fails.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found