airbrake-ruby icon indicating copy to clipboard operation
airbrake-ruby copied to clipboard

Error notifications are disabled (missing doc?)

Open SaimonL opened this issue 1 year ago • 1 comments

Hi when there is an error in my application, I keep getting the error message "error notifications are disabled" regardless of what I do in config and in any environment. I get the same error when I do rake airbrake:test Digging in to the code I came across "/lib/airbrake-ruby/config/validator.rb"

Line 47

unless config.error_notifications
  return promise.reject('error notifications are disabled')
end

Can you please explain how I can set error_notifications in my configuration. If I delete that code from "/lib/airbrake-ruby/config/validator.rb" everything works fine.

Googling it I see no docs out there for it. Some suggested that I set config.consider_all_requests_local = false which does not work either. Going to this page absolutely did not help what so ever.

My Config

I have set the proper value in ENV variables AIRBRAKE_PROJECT_ID and AIRBRAKE_PROJECT_KEY

if (project_id = ENV['AIRBRAKE_PROJECT_ID']) &&
   project_key = (ENV['AIRBRAKE_PROJECT_KEY'] || ENV['AIRBRAKE_API_KEY'])
  Airbrake.configure do |c|
    c.project_id = project_id
    c.project_key = project_key

    c.root_directory = Rails.root
    c.logger = Airbrake::Rails.logger
    c.environment = Rails.env
    c.ignore_environments = %w[test]
    c.blocklist_keys = [/password/i, /authorization/i]
  end
else
  Rails.logger.warn(
    "#{__FILE__}: Airbrake project id or project key is not set. " \
    "Skipping Airbrake configuration"
  )
end

I even tried setting c.error_notifications = true but no luck

SaimonL avatar Oct 28 '23 14:10 SaimonL

I know this is an old issue but you could try adding c.remote_config = false in your configuration

nicolabba avatar Mar 26 '24 15:03 nicolabba