* [ruby-core:120855] [Ruby master Bug#21104] Net::HTTP connections failing in Ruby >= 3.4.0 on macOS with Happy Eyeballs enabled
@ 2025-02-01 22:19 mjt58 (Mike Thompson) via ruby-core
2025-02-02 14:27 ` [ruby-core:120863] " shioimm (Misaki Shioi) via ruby-core
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: mjt58 (Mike Thompson) via ruby-core @ 2025-02-01 22:19 UTC (permalink / raw)
To: ruby-core; +Cc: mjt58 (Mike Thompson)
Issue #21104 has been reported by mjt58 (Mike Thompson).
----------------------------------------
Bug #21104: Net::HTTP connections failing in Ruby >= 3.4.0 on macOS with Happy Eyeballs enabled
https://bugs.ruby-lang.org/issues/21104
* Author: mjt58 (Mike Thompson)
* Status: Open
* ruby -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
A project I work on recently upgraded Ruby to 3.4.1 from 3.3.5. Following the upgrade, and when running locally on my Mac, all attempts to connect to an external service within the project over http(s) fail.
We use `mise` for managing development tool dependencies, including Ruby, and I am using macOS 15.3.
For example running something as simple as:
```
require 'net/http'
puts Net::HTTP.get(URI('https://bbc.co.uk'))
```
Will fail with the following stack trace:
```
/path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/protocol.rb:46:in 'OpenSSL::SSL::SSLSocket#connect_nonblock': Connection reset by peer - SSL_connect (Errno::ECONNRESET)
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/protocol.rb:46:in 'Net::Protocol#ssl_socket_connect'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1736:in 'Net::HTTP#connect'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1636:in 'Net::HTTP#do_start'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1625:in 'Net::HTTP#start'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1064:in 'Net::HTTP.start'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:824:in 'Net::HTTP.get_response'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:805:in 'Net::HTTP.get'
from request.rb:2:in '<main>'
```
I tried different versions of Ruby and confirmed that the issue appears with 3.4.0. After reading the release notes for this version, I tried setting `RUBY_TCP_NO_FAST_FALLBACK=1` and this worked, allowing me to work around the problem.
This issue has also been encountered by others, please see:
https://github.com/rubygems/rubygems/issues/8390
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* [ruby-core:120863] [Ruby master Bug#21104] Net::HTTP connections failing in Ruby >= 3.4.0 on macOS with Happy Eyeballs enabled
2025-02-01 22:19 [ruby-core:120855] [Ruby master Bug#21104] Net::HTTP connections failing in Ruby >= 3.4.0 on macOS with Happy Eyeballs enabled mjt58 (Mike Thompson) via ruby-core
@ 2025-02-02 14:27 ` shioimm (Misaki Shioi) via ruby-core
2025-02-03 9:29 ` [ruby-core:120868] " mjt58 (Mike Thompson) via ruby-core
2025-02-04 12:27 ` [ruby-core:120876] " shioimm (Misaki Shioi) via ruby-core
2 siblings, 0 replies; 4+ messages in thread
From: shioimm (Misaki Shioi) via ruby-core @ 2025-02-02 14:27 UTC (permalink / raw)
To: ruby-core; +Cc: shioimm (Misaki Shioi)
Issue #21104 has been updated by shioimm (Misaki Shioi).
I suspect that this issue might be caused by an interaction between the specifications of Happy Eyeballs v2 and certain intermediate devices along the network path.
This is because, according to the report you linked, the problem occurs for some people but not for others, even though they are using the same OS, the same Ruby version, the same OpenSSL version, and connecting to the same destination (https://rubygems.org/). I also haven't been able to reproduce this issue in my own environment.
To help narrow down the cause, could you provide more information on the following?
- You specified 'https://bbc.co.uk' as the host you're connecting to. Does the same issue occur when connecting to other hosts as well?
- Does the issue still occur when you use a different network environment? For example, when connecting from your workplace, a cafe, or when using a VPN?
----------------------------------------
Bug #21104: Net::HTTP connections failing in Ruby >= 3.4.0 on macOS with Happy Eyeballs enabled
https://bugs.ruby-lang.org/issues/21104#change-111736
* Author: mjt58 (Mike Thompson)
* Status: Open
* ruby -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
A project I work on recently upgraded Ruby to 3.4.1 from 3.3.5. Following the upgrade, and when running locally on my Mac, all attempts to connect to an external service within the project over http(s) fail.
We use `mise` for managing development tool dependencies, including Ruby, and I am using macOS 15.3.
For example running something as simple as:
```
require 'net/http'
puts Net::HTTP.get(URI('https://bbc.co.uk'))
```
Will fail with the following stack trace:
```
/path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/protocol.rb:46:in 'OpenSSL::SSL::SSLSocket#connect_nonblock': Connection reset by peer - SSL_connect (Errno::ECONNRESET)
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/protocol.rb:46:in 'Net::Protocol#ssl_socket_connect'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1736:in 'Net::HTTP#connect'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1636:in 'Net::HTTP#do_start'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1625:in 'Net::HTTP#start'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1064:in 'Net::HTTP.start'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:824:in 'Net::HTTP.get_response'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:805:in 'Net::HTTP.get'
from request.rb:2:in '<main>'
```
I tried different versions of Ruby and confirmed that the issue appears with 3.4.0. After reading the release notes for this version, I tried setting `RUBY_TCP_NO_FAST_FALLBACK=1` and this worked, allowing me to work around the problem.
This issue has also been encountered by others, please see:
https://github.com/rubygems/rubygems/issues/8390
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* [ruby-core:120868] [Ruby master Bug#21104] Net::HTTP connections failing in Ruby >= 3.4.0 on macOS with Happy Eyeballs enabled
2025-02-01 22:19 [ruby-core:120855] [Ruby master Bug#21104] Net::HTTP connections failing in Ruby >= 3.4.0 on macOS with Happy Eyeballs enabled mjt58 (Mike Thompson) via ruby-core
2025-02-02 14:27 ` [ruby-core:120863] " shioimm (Misaki Shioi) via ruby-core
@ 2025-02-03 9:29 ` mjt58 (Mike Thompson) via ruby-core
2025-02-04 12:27 ` [ruby-core:120876] " shioimm (Misaki Shioi) via ruby-core
2 siblings, 0 replies; 4+ messages in thread
From: mjt58 (Mike Thompson) via ruby-core @ 2025-02-03 9:29 UTC (permalink / raw)
To: ruby-core; +Cc: mjt58 (Mike Thompson)
Issue #21104 has been updated by mjt58 (Mike Thompson).
shioimm (Misaki Shioi) wrote in #note-1:
> To help narrow down the cause, could you provide more information on the following?
>
> - You specified 'https://bbc.co.uk' as the host you're connecting to. Does the same issue occur when connecting to other hosts as well?
Yes, I saw it first running `bundle install` with errors like:
```
Bundler::HTTPError Could not fetch specs from https://rubygems.org/ due to underlying error <Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://rubygems.org/specs.4.8.gz)>
```
> - Does the issue still occur when you use a different network environment? For example, when connecting from your workplace, a cafe, or when using a VPN?
Yes, I see it on, home wifi, office wifi and when tethered off my phone.
----------------------------------------
Bug #21104: Net::HTTP connections failing in Ruby >= 3.4.0 on macOS with Happy Eyeballs enabled
https://bugs.ruby-lang.org/issues/21104#change-111742
* Author: mjt58 (Mike Thompson)
* Status: Open
* ruby -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
A project I work on recently upgraded Ruby to 3.4.1 from 3.3.5. Following the upgrade, and when running locally on my Mac, all attempts to connect to an external service within the project over http(s) fail.
We use `mise` for managing development tool dependencies, including Ruby, and I am using macOS 15.3.
For example running something as simple as:
```
require 'net/http'
puts Net::HTTP.get(URI('https://bbc.co.uk'))
```
Will fail with the following stack trace:
```
/path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/protocol.rb:46:in 'OpenSSL::SSL::SSLSocket#connect_nonblock': Connection reset by peer - SSL_connect (Errno::ECONNRESET)
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/protocol.rb:46:in 'Net::Protocol#ssl_socket_connect'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1736:in 'Net::HTTP#connect'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1636:in 'Net::HTTP#do_start'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1625:in 'Net::HTTP#start'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1064:in 'Net::HTTP.start'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:824:in 'Net::HTTP.get_response'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:805:in 'Net::HTTP.get'
from request.rb:2:in '<main>'
```
I tried different versions of Ruby and confirmed that the issue appears with 3.4.0. After reading the release notes for this version, I tried setting `RUBY_TCP_NO_FAST_FALLBACK=1` and this worked, allowing me to work around the problem.
This issue has also been encountered by others, please see:
https://github.com/rubygems/rubygems/issues/8390
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* [ruby-core:120876] [Ruby master Bug#21104] Net::HTTP connections failing in Ruby >= 3.4.0 on macOS with Happy Eyeballs enabled
2025-02-01 22:19 [ruby-core:120855] [Ruby master Bug#21104] Net::HTTP connections failing in Ruby >= 3.4.0 on macOS with Happy Eyeballs enabled mjt58 (Mike Thompson) via ruby-core
2025-02-02 14:27 ` [ruby-core:120863] " shioimm (Misaki Shioi) via ruby-core
2025-02-03 9:29 ` [ruby-core:120868] " mjt58 (Mike Thompson) via ruby-core
@ 2025-02-04 12:27 ` shioimm (Misaki Shioi) via ruby-core
2 siblings, 0 replies; 4+ messages in thread
From: shioimm (Misaki Shioi) via ruby-core @ 2025-02-04 12:27 UTC (permalink / raw)
To: ruby-core; +Cc: shioimm (Misaki Shioi)
Issue #21104 has been updated by shioimm (Misaki Shioi).
@mjt58
Thank you for your reply. Since you're seeing this issue across different environments, I'm starting to think it's more likely influenced by software running on the host rather than a problem with network intermediaries.
Could you also check the following?
- Do you get any errors when running `TCPSocket.new` directly without using net/http? For example, try executing a script like this:
```ruby
require "socket"
p TCPSocket.new("bbc.co.uk", 80, fast_fallback: true)
```
- Could you verify via packet capture whether the source IP of the RST is the client host itself? You can see which IP address sends an RST by using tcpdump, for example, by running `sudo tcpdump -i <interface name> host bbc.co.uk`, and then executing `Net::HTTP.get(URI("https://bbc.co.uk"))`.
I'd appreciate your help with further debugging.
----------------------------------------
Bug #21104: Net::HTTP connections failing in Ruby >= 3.4.0 on macOS with Happy Eyeballs enabled
https://bugs.ruby-lang.org/issues/21104#change-111751
* Author: mjt58 (Mike Thompson)
* Status: Open
* ruby -v: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
A project I work on recently upgraded Ruby to 3.4.1 from 3.3.5. Following the upgrade, and when running locally on my Mac, all attempts to connect to an external service within the project over http(s) fail.
We use `mise` for managing development tool dependencies, including Ruby, and I am using macOS 15.3.
For example running something as simple as:
```
require 'net/http'
puts Net::HTTP.get(URI('https://bbc.co.uk'))
```
Will fail with the following stack trace:
```
/path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/protocol.rb:46:in 'OpenSSL::SSL::SSLSocket#connect_nonblock': Connection reset by peer - SSL_connect (Errno::ECONNRESET)
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/protocol.rb:46:in 'Net::Protocol#ssl_socket_connect'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1736:in 'Net::HTTP#connect'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1636:in 'Net::HTTP#do_start'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1625:in 'Net::HTTP#start'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:1064:in 'Net::HTTP.start'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:824:in 'Net::HTTP.get_response'
from /path/to/.local/share/mise/installs/ruby/3.4.1/lib/ruby/3.4.0/net/http.rb:805:in 'Net::HTTP.get'
from request.rb:2:in '<main>'
```
I tried different versions of Ruby and confirmed that the issue appears with 3.4.0. After reading the release notes for this version, I tried setting `RUBY_TCP_NO_FAST_FALLBACK=1` and this worked, allowing me to work around the problem.
This issue has also been encountered by others, please see:
https://github.com/rubygems/rubygems/issues/8390
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-04 12:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-01 22:19 [ruby-core:120855] [Ruby master Bug#21104] Net::HTTP connections failing in Ruby >= 3.4.0 on macOS with Happy Eyeballs enabled mjt58 (Mike Thompson) via ruby-core
2025-02-02 14:27 ` [ruby-core:120863] " shioimm (Misaki Shioi) via ruby-core
2025-02-03 9:29 ` [ruby-core:120868] " mjt58 (Mike Thompson) via ruby-core
2025-02-04 12:27 ` [ruby-core:120876] " shioimm (Misaki Shioi) via ruby-core
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).