getsentry / sentry-ruby

Sentry SDK for Ruby
https://sentry.io/for/ruby
MIT License
927 stars 493 forks source link

Failed to open TCP connection ingest.us.sentry.io #2343

Closed leoburgos closed 3 weeks ago

leoburgos commented 1 month ago

Issue Description

App is failing to connect to Sentry DNS presumably by using the wrong port (433) and throws a Sentry::ExternalError exception, randomly and on very few specific occasions. It works correctly the other 99% of the times

Reproduction Steps

Use custom DNS from a Heroku add-on

I can't say if this comes from the few Sentry.capture_message custom calls that we have or from the default exception raising logging.

Expected Behavior

Connection should not be trying to connect to port 433 on any given time

Actual Behavior

Out of the hundreds of logs we've gotten in the past, 4 have seen this error

Error coming from gems/sentry-ruby-5.18.1/lib/sentry/transport/http_transport.rb:69:inrescue in send_data': Sentry::ExternalError: Failed to open TCP connection to XXXXXXXX.ingest.us.sentry.io:443 (getaddrinfo: Temporary failure in name resolution)`

Ruby Version

3.3.1

SDK Version

5.18.1

Integration and Its Version

No response

Sentry Config

This is the initializer sentry.rb

`Sentry.init do |config| config.dsn = ENV["SENTRY_DSN"]

get breadcrumbs from logs

config.breadcrumbs_logger = [:active_support_logger, :http_logger]

enable tracing

we recommend adjusting this value in production

config.traces_sample_rate = 0.5

enable profiling

this is relative to traces_sample_rate

config.profiles_sample_rate = 0.5

config.include_local_variables = true config.send_client_reports = true end`

ENV['SENTRY_DNS'] = https://xxxxxxxx:yyyyyyyyy@zzzzzzzz.ingest.us.sentry.io/450.......

sl0thentr0py commented 1 month ago

@leoburgos this seems like a DNS thing between your network and our servers, I'm not sure how the SDK could do anything differently for preventing network issues? Do you have a suggested fix?

Also 443 is the correct port for SSL connections so that is not the issue, the issue is in getaddrinfo which is a DNS problem. Maybe check your nameserver configs for your network?

This really seems like a heroku transient network state problem.

getsantry[bot] commented 4 weeks ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀