-
Notifications
You must be signed in to change notification settings - Fork 393
[BUG]: Broken Rails console after upgrading to 2.9.0 #4531
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
Comments
@katiekeel I created a new rails 7.1 application and I am not getting these messages with dd-trace-rb 2.12.2. Can you try that? |
@katiekeel are you using I think this error might actually happen because it freezes Rails classes that |
I reproduced with console1984 following the setup instructions at https://github.com/basecamp/console1984/tree/02b1b9ee7fd7050174b6a98c2b43057553621dc4 + setting CONSOLE_USER:
Note that there is more output than just the instance_variable_get complaint. |
Stack trace:
|
The offending call is this: https://github.com/DataDog/dd-trace-rb/blob/master/lib/datadog/tracing/contrib/active_record/utils.rb#L52-L53 It retrieves AR adapter configuration. Patch to dd-trace-rb to make the complaint go away:
Based on this patch, I don't really see what console1984 is trying to accomplish by preventing calls to instance_variable_get since the same information can be trivially obtained by defining an accessor method. Another question is why dd-trace-rb needs all this information - I am not yet sure why the database host and port are needed but adapter name is used for determining dd-trace-rb configuration and, probably, it is also included in the trace. However it should be possible to obtain adapter name in a different way (such as from the adapter class name), not by inspecting database configuration. |
Uh oh!
There was an error while loading. Please reload this page.
Tracer Version(s)
2.12.2
Ruby Version(s)
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux-musl]
Relevent Library and Version(s)
pg (1.5.8)
Bug Report
Recently we upgraded our use of this gem from version
2.2.0
to2.9.0
. Afterward, we began to see a large number of errors being emitted in the Rails console on our Kubernetes runner pods, making the console unusable. Upgrading to2.12.2
has not fixed the issue. We've had to modify our initializer and would like to know if there is a better path, or a fix could be looked at.Any advice would be welcome.
Reproduction Code
rails c
Configuration Block
To fix this, we had to wrap our entire
Datadog.configure do
initializer with the following:unless Rails.const_defined?(:Console) && !Rails.env.local?
Error Logs
Sample error, being repeated many times for every entry into the console prompt:
Followed by
Operating System
x86_64-linux-musl
How does Datadog help you?
No response
The text was updated successfully, but these errors were encountered: