dfop02
dfop02

Reputation: 133

How can I disable ActiveSupport::Notifications on Rails 7?

I'm trying to upgrade my API from Rails 6 to Rails 7, and got this error after solving dependences and running my app:

Error:

ActiveSupport::Notifications::InstrumentationSubscriberError (Exception(s) occurred within instrumentation subscribers: NoMethodError, NoMethodError)

I never use this feature, searching all my files doesn't exist any mention to this Notifications. Couldn't identify who and why is calling this notifications and neither find on Rails 7 Docs how can I disable this feature to solve my problem. Anyone know how can I do it?

Tried remove completely the ahoy_matey gem that appears in traceback and change de API mode to false on config/application.rb but both doesn't work.

I expect disabling this feature can fix my problem.

Upvotes: 1

Views: 752

Answers (2)

Tim Sullivan
Tim Sullivan

Reputation: 16888

I was getting this exact same error, and the listed solution didn't work for me.

My specific error was an old version of the Airbrake notifier library (v10, updating the v13 fixed it), but to track it down I looked at the error page, which included the NoMethodError error traces below the main application trace.

So if this happens to you, hopefully you won't lose two days to it like I just have. 😬

Upvotes: 4

dfop02
dfop02

Reputation: 133

after spend few hours searching the docs of rails 7, I finally found it. Right here, where it says:

Controls behavior when parameters that are not explicitly permitted are found. The default value is :log in test and development environments.

:log to emit an ActiveSupport::Notifications.instrument event on the unpermitted_parameters.action_controller topic and log at the DEBUG level

The solution was add config.action_controller.action_on_unpermitted_parameters = false on my config/application.rb file.

Upvotes: 1

Related Questions