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
tomerfriedman
changed the title
Active Record Fails because of an unexpected arguments
Active Record Fails because of an unexpected arguments in find_or_create_by function
Jan 10, 2023
Thanks for reporting this issue. This is an issue with the protected_attributes_extended gem overriding and changing ActiveRecord Persistence create signature.
The original Rails create method only accepts a single attributes hash argument:
During initialization time, the protected attributes gem is mixed in, which adds the parameter, then the OTel instrumentation is mixed and reverts the signature back.
Then when your code runs... 💣 ArgumentError.
I'd argue here that this isn't a bug with the instrumentation but rather with protected attributes because it should not change ActiveRecords public API.
To get your app working again using OTel I recommend that you disable the AR instrumentation but I think that ultimately this should be something that needs to be fixed in the protected attributes gem.
Disabling AR instrumentation should still give you some useful traces.
Could not initialize ActiveRecord because of an unexpected error that is thrown and crashs my app.
Share details about your runtime
RUBY_ENGINE: "ruby"
RAILS: "6.0.4.7"
Getting the following error on "find_or_create_by" function:
Attached picture:
The text was updated successfully, but these errors were encountered: