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

[BUG]: Net::OpenTimeout (Faraday::ConnectionFailed) for request in threads #1680

Open
1 task done
DenisDenis9331 opened this issue Apr 15, 2024 · 1 comment
Open
1 task done
Labels
Type: Bug Something isn't working as documented

Comments

@DenisDenis9331
Copy link

DenisDenis9331 commented Apr 15, 2024

What happened?

I have this Net::OpenTimeout (Faraday::ConnectionFailed) in my ruby threads, but you can reproduce the error in irb:

Exec this steps in irb:
1. require 'octokit'; client = Octokit::Client.new(access_token: 'access_token')
2. contents_url = "https://api.github.com/repos/octokit/octokit.rb/contents/Gemfile?ref=main"
3. file = client.get(contents_url)
4. client.get(file.download_url)
5. repeat 4. step three times

Actual result:

irb(main):033> client.get(file.download_url)
/home/denis/.rvm/gems/ruby-3.1.3/gems/net-protocol-0.2.1/lib/net/protocol.rb:43:in `ssl_socket_connect': Net::OpenTimeout (Faraday::ConnectionFailed)
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/net-http-0.4.1/lib/net/http.rb:1674:in `connect'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/net-http-0.4.1/lib/net/http.rb:1580:in `do_start'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/net-http-0.4.1/lib/net/http.rb:1569:in `start'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-net_http-3.1.0/lib/faraday/adapter/net_http.rb:112:in `request_with_wrapped_block'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-net_http-3.1.0/lib/faraday/adapter/net_http.rb:102:in `perform_request'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-net_http-3.1.0/lib/faraday/adapter/net_http.rb:66:in `block in call'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-2.9.0/lib/faraday/adapter.rb:45:in `connection'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-net_http-3.1.0/lib/faraday/adapter/net_http.rb:65:in `call'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-2.9.0/lib/faraday/middleware.rb:17:in `call'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-2.9.0/lib/faraday/middleware.rb:17:in `call'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-2.9.0/lib/faraday/middleware.rb:17:in `call'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/octokit-8.1.0/lib/octokit/middleware/follow_redirects.rb:73:in `perform_with_redirection'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/octokit-8.1.0/lib/octokit/middleware/follow_redirects.rb:61:in `call'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-retry-2.2.0/lib/faraday/retry/middleware.rb:153:in `call'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-2.9.0/lib/faraday/rack_builder.rb:152:in `build_response'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-2.9.0/lib/faraday/connection.rb:444:in `run_request'
	... 10 levels...
/home/denis/.rvm/gems/ruby-3.1.3/gems/net-protocol-0.2.1/lib/net/protocol.rb:43:in `ssl_socket_connect': Net::OpenTimeout (Net::OpenTimeout)
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/net-http-0.4.1/lib/net/http.rb:1674:in `connect'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/net-http-0.4.1/lib/net/http.rb:1580:in `do_start'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/net-http-0.4.1/lib/net/http.rb:1569:in `start'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-net_http-3.1.0/lib/faraday/adapter/net_http.rb:112:in `request_with_wrapped_block'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-net_http-3.1.0/lib/faraday/adapter/net_http.rb:102:in `perform_request'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-net_http-3.1.0/lib/faraday/adapter/net_http.rb:66:in `block in call'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-2.9.0/lib/faraday/adapter.rb:45:in `connection'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-net_http-3.1.0/lib/faraday/adapter/net_http.rb:65:in `call'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-2.9.0/lib/faraday/middleware.rb:17:in `call'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-2.9.0/lib/faraday/middleware.rb:17:in `call'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-2.9.0/lib/faraday/middleware.rb:17:in `call'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/octokit-8.1.0/lib/octokit/middleware/follow_redirects.rb:73:in `perform_with_redirection'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/octokit-8.1.0/lib/octokit/middleware/follow_redirects.rb:61:in `call'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-retry-2.2.0/lib/faraday/retry/middleware.rb:153:in `call'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-2.9.0/lib/faraday/rack_builder.rb:152:in `build_response'
	from /home/denis/.rvm/gems/ruby-3.1.3/gems/faraday-2.9.0/lib/faraday/connection.rb:444:in `run_request'
	... 10 levels...

Additional info: I started to get this error on April 10th. I texted this problem to GitHub support, but they said that if this problem occurs only in irb and code with octokit, I should post an issue to octokit.

Now I use retry for this error, but I think this way is not good.

Versions

ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
octokit (8.1.0)

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@DenisDenis9331 DenisDenis9331 added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Apr 15, 2024
Copy link

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@kfcampbell kfcampbell removed the Status: Triage This is being looked at and prioritized label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as documented
Projects
Status: 🔥 Backlog
Development

No branches or pull requests

2 participants