You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# config/initializers/sentry.rb
Sentry.init do |config|
config.dsn = 'https://…' unless Rails.env.test?
config.breadcrumbs_logger = [:active_support_logger, :http_logger]
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for tracing.
# We recommend adjusting this value in production.
config.traces_sample_rate = 1.0
# or
# config.traces_sampler = lambda do |_context|
# true
# end
# Set profiles_sample_rate to profile 100%
# of sampled transactions.
# We recommend adjusting this value in production.
config.profiles_sample_rate = 1.0
end
and starting the app (rails s) we suddenly got
Host '10.0.0.1' is blocked because of many connection errors; unblock with 'mariadb-admin flush-hosts' (Mysql2::Error)
Taking a look into the MySQL logs unveiled
Aug 28 11:25:15 server mariadbd[913]: 2024-08-28 11:25:15 10232 [Warning] Aborted connection 10232 to db: 'unconnected' user: 'unauthenticated' host: '10.0.0.1' (This connection closed normally without authentication)
Without Sentry.init we don't see that problem. DB and User in Log message are unaltered, and do not match up with configured credentials.
And I'm quite confused how something could trigger this, cause the database seems to be initialised and not initialised at the same time. Database-Server-IP is used, but Database-Credentials aren't. I'm also missing a good starting point to debug this further.
I'm not really sure this is a problem related to sentry, or the way sentry integrates itself into rails, but somehow it's triggered by the integration.
Note: IP of DB-Host was altered here, but it should be mentioned that the database doesn't run on localhost
Reproduction Steps
I don't know yet.
Expected Behavior
No error? What ever tries to connect to the database should only after connection is initialised by active record?
Actual Behavior
Something triggers a database connection with no or wrong credentials.
I tried using your config in a Rails 6.1.7 app but couldn't reproduce the issue.
It's expected to have a connection triggered when booting a Rails app and it's also unclear to me how having Sentry.init would make it pick up incorrect configuration.
We'll need more information on this case for further investigation. Can you provide a full backtrace of the error?
Issue Description
Using
and starting the app (
rails s
) we suddenly gotTaking a look into the MySQL logs unveiled
Without
Sentry.init
we don't see that problem. DB and User in Log message are unaltered, and do not match up with configured credentials.And I'm quite confused how something could trigger this, cause the database seems to be initialised and not initialised at the same time. Database-Server-IP is used, but Database-Credentials aren't. I'm also missing a good starting point to debug this further.
I'm not really sure this is a problem related to sentry, or the way sentry integrates itself into rails, but somehow it's triggered by the integration.
Note: IP of DB-Host was altered here, but it should be mentioned that the database doesn't run on localhost
Reproduction Steps
I don't know yet.
Expected Behavior
No error? What ever tries to connect to the database should only after connection is initialised by active record?
Actual Behavior
Something triggers a database connection with no or wrong credentials.
Ruby Version
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [arm64-darwin22]
SDK Version
sentry-ruby (5.19.0)
Integration and Its Version
sentry-rails (5.19.0), rails (6.1.7.8)
Sentry Config
No response
The text was updated successfully, but these errors were encountered: