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

File upload gives net:ERR_CONNECTION_RESET #6152

Closed
rijkr opened this issue Apr 10, 2021 · 8 comments
Closed

File upload gives net:ERR_CONNECTION_RESET #6152

rijkr opened this issue Apr 10, 2021 · 8 comments

Comments

@rijkr
Copy link

rijkr commented Apr 10, 2021

Jetty version
9.4.39.v20210325

Java version

OpenJDK 64-Bit Server VM - 1.8.0_282

OS type/version

Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-140-generic x86_64)

Description

Our Jetty Web Server application is deployed on various servers and can be accessed over the Internet via router port forwarding or Apache reverse proxy. After upgrading Jetty 9.4.38.v20210224 to 9.4.39.v20210325, one server gives a "(failed) net:ERR_CONNECTION_RESET" error for large 2MB< file uploads via https://fail.example.com : upload of smaller files, such as 60 KB, will work fine. This finding cannot be reproduced on our reference site https://okay.example.org : all types of file uploads work fine there. (URLs are obfuscated for privacy. The error is observed in Chromium Browser > Development tools > Network.)

So what is the difference between the two sites? After numerous checks and tests the only difference we see is the kind of SSL cert used:

  1. https://fail.example.com uses a wild card certificate having two "Not Critical" Subject Alternative DNS Names: *.example.com and example.com (in that order).
  2. https://okay.example.org uses a plain (no wild card) Let's Encrypt certificate with explicit Subject Alternative DNS Name okay.example.org (DNS names for other subdomains are also present).

The upload errors for https://fail.example.com disappear when we revert to Jetty 9.4.38.v20210224.

Could this behavior be related to #6034 ?

@joakime
Copy link
Contributor

joakime commented Apr 10, 2021

Can you capture DEBUG logs for the failing example and attach them here?

@rijkr
Copy link
Author

rijkr commented Apr 10, 2021

@joakime That's a bit hard to do as it's a production environment for a user organisation. Yesterday I spent a lot of time figuring out what was going on, and I finally solved the problem by creating a new installer with the older Jetty version. If absolutely necessary I have to ask the user to set up a debugging session when web activity is low. If you can somehow get clues from the code itself, that would be preferable.
P.S. The log4j log file show no warnings or errors.

@gregw
Copy link
Contributor

gregw commented Apr 10, 2021

This may be fixed by #6142
We introduced an issue in 9.4.39 with SSL buffering, that can sometimes result in an underflow state when the buffer could be compacted. I'm not exactly sure how the different certificates could effect that, but then it is at least plausible. Can you test that branch in production (or do a build with just that change applied?)

Either way, we are likely to make a new release early next week.

@rijkr
Copy link
Author

rijkr commented Apr 10, 2021

@gregw Thanks for your quick reply! I'd rather wait for the next 9.4.40 (?) release with the #6142 fix. I can then set DEBUG right away during installation. What log4j DEBUG scope should I use? I assume log4j.logger.org.eclipse.jetty=DEBUG will probably create too much log entries?

@gregw
Copy link
Contributor

gregw commented Apr 10, 2021 via email

@rijkr
Copy link
Author

rijkr commented Apr 10, 2021

@gregw When we install the new release we will have enough time to test and set log levels as needed. Thanks for your support. I'll keep you posted about the results.

@rijkr
Copy link
Author

rijkr commented Apr 19, 2021

@gregw We installed 9.4.40.v20210413 and first tests show the issue is solved. We deployed to production and will remain alert to user reports for the next few days.

sarutak added a commit to apache/spark that referenced this issue Apr 24, 2021
…SET issue

### What changes were proposed in this pull request?

This PR proposes to upgrade Jetty to 9.4.40.

### Why are the changes needed?

SPARK-34988 (#32091) upgraded Jetty to 9.4.39 for CVE-2021-28165.
But after the upgrade, Jetty 9.4.40 was released to fix the ERR_CONNECTION_RESET issue (jetty/jetty.project#6152).
This issue seems to affect Jetty 9.4.39 when POST method is used with SSL.
For Spark, job submission using REST and ThriftServer with HTTPS protocol can be affected.

### Does this PR introduce _any_ user-facing change?

No. No released version uses Jetty 9.3.39.

### How was this patch tested?

CI.

Closes #32318 from sarutak/upgrade-jetty-9.4.40.

Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com>
Signed-off-by: Kousuke Saruta <sarutak@oss.nttdata.com>
viirya pushed a commit to apache/spark that referenced this issue Apr 24, 2021
…ON_RESET issue

### What changes were proposed in this pull request?

This PR backports SPARK-35210 (#32318).
This PR proposes to upgrade Jetty to 9.4.40.

### Why are the changes needed?

SPARK-34988 (#32091) upgraded Jetty to 9.4.39 for CVE-2021-28165.
But after the upgrade, Jetty 9.4.40 was released to fix the ERR_CONNECTION_RESET issue (jetty/jetty.project#6152).
This issue seems to affect Jetty 9.4.39 when POST method is used with SSL.
For Spark, job submission using REST and ThriftServer with HTTPS protocol can be affected.

### Does this PR introduce _any_ user-facing change?

No. No released version uses Jetty 9.3.39.

### How was this patch tested?

CI.

Closes #32324 from sarutak/backport-3.1-SPARK-35210.

Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com>
Signed-off-by: Liang-Chi Hsieh <viirya@gmail.com>
viirya pushed a commit to apache/spark that referenced this issue Apr 24, 2021
…ON_RESET issue

### What changes were proposed in this pull request?

This PR backports SPARK-35210 (#32318).
This PR proposes to upgrade Jetty to 9.4.40.

### Why are the changes needed?

SPARK-34988 (#32091) upgraded Jetty to 9.4.39 for CVE-2021-28165.
But after the upgrade, Jetty 9.4.40 was released to fix the ERR_CONNECTION_RESET issue (jetty/jetty.project#6152).
This issue seems to affect Jetty 9.4.39 when POST method is used with SSL.
For Spark, job submission using REST and ThriftServer with HTTPS protocol can be affected.

### Does this PR introduce _any_ user-facing change?

No. No released version uses Jetty 9.3.39.

### How was this patch tested?

CI.

Closes #32323 from sarutak/backport-3.0-SPARK-35210.

Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com>
Signed-off-by: Liang-Chi Hsieh <viirya@gmail.com>
viirya pushed a commit to apache/spark that referenced this issue Apr 25, 2021
…ON_RESET issue

### What changes were proposed in this pull request?

This PR backports SPARK-35210 (#32318).
This PR proposes to upgrade Jetty to 9.4.40.

### Why are the changes needed?

SPARK-34988 (#32091) upgraded Jetty to 9.4.39 for CVE-2021-28165.
But after the upgrade, Jetty 9.4.40 was released to fix the ERR_CONNECTION_RESET issue (jetty/jetty.project#6152).
This issue seems to affect Jetty 9.4.39 when POST method is used with SSL.
For Spark, job submission using REST and ThriftServer with HTTPS protocol can be affected.

### Does this PR introduce _any_ user-facing change?

No. No released version uses Jetty 9.3.39.

### How was this patch tested?

CI.

Closes #32322 from sarutak/backport-SPARK-35210.

Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com>
Signed-off-by: Liang-Chi Hsieh <viirya@gmail.com>
@sbordet
Copy link
Contributor

sbordet commented May 20, 2021

@rijkr closing this as solved. Please reopen if you still have problems.

@sbordet sbordet closed this as completed May 20, 2021
flyrain pushed a commit to flyrain/spark that referenced this issue Sep 21, 2021
…ON_RESET issue

This PR backports SPARK-35210 (apache#32318).
This PR proposes to upgrade Jetty to 9.4.40.

SPARK-34988 (apache#32091) upgraded Jetty to 9.4.39 for CVE-2021-28165.
But after the upgrade, Jetty 9.4.40 was released to fix the ERR_CONNECTION_RESET issue (jetty/jetty.project#6152).
This issue seems to affect Jetty 9.4.39 when POST method is used with SSL.
For Spark, job submission using REST and ThriftServer with HTTPS protocol can be affected.

No. No released version uses Jetty 9.3.39.

CI.

Closes apache#32324 from sarutak/backport-3.1-SPARK-35210.

Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com>
Signed-off-by: Liang-Chi Hsieh <viirya@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants