{"action":"created","issue":{"url":"https://api.github.com/repos/airbrake/airbrake/issues/490","labels_url":"https://api.github.com/repos/airbrake/airbrake/issues/490/labels{/name}","comments_url":"https://api.github.com/repos/airbrake/airbrake/issues/490/comments","events_url":"https://api.github.com/repos/airbrake/airbrake/issues/490/events","html_url":"https://github.com/airbrake/airbrake/issues/490","id":127713251,"number":490,"title":"NoMethodError: undefined method `call' for nil:NilClass","user":{"login":"nick-desteffen","id":174440,"avatar_url":"https://avatars.githubusercontent.com/u/174440?v=3","gravatar_id":"","url":"https://api.github.com/users/nick-desteffen","html_url":"https://github.com/nick-desteffen","followers_url":"https://api.github.com/users/nick-desteffen/followers","following_url":"https://api.github.com/users/nick-desteffen/following{/other_user}","gists_url":"https://api.github.com/users/nick-desteffen/gists{/gist_id}","starred_url":"https://api.github.com/users/nick-desteffen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nick-desteffen/subscriptions","organizations_url":"https://api.github.com/users/nick-desteffen/orgs","repos_url":"https://api.github.com/users/nick-desteffen/repos","events_url":"https://api.github.com/users/nick-desteffen/events{/privacy}","received_events_url":"https://api.github.com/users/nick-desteffen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/airbrake/airbrake/labels/Question","name":"Question","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-20T15:55:03Z","updated_at":"2016-01-22T13:52:10Z","closed_at":"2016-01-22T13:52:10Z","body":"* Airbrake version: 5.0.3\r\n* Ruby version: 2.2.2\r\n* Framework name & version: Rails 4.2.5\r\n\r\n#### Airbrake config\r\n\r\n```ruby\r\nAirbrake.configure do |config|\r\n  config.environment = Rails.env\r\n  config.ignore_environments = %w(development test)\r\n  config.project_key = 'XXXXXXXXX'\r\n  config.project_id = XXXXX\r\nend\r\n\r\nfilters_to_ignore = [\r\n  \"EventPublicationError\"\r\n]\r\n\r\nAirbrake.add_filter do |notice|\r\n  if notice[:errors].any? { |error| filters_to_ignore.include?(error[:type]) }\r\n    notice.ignore!\r\n  end\r\nend\r\n```\r\n\r\n#### Description\r\n\r\nAll of our applications keep getting this exception.  We aren't sure where it is coming from, the only information of use is on the context tab within Airbrake web application.\r\n\r\nHow can we go about stopping these?\r\n\r\nHere is the context tab:\r\n\r\n```json\r\n{\r\n  \"environment\": \"production\",\r\n  \"language\": \"ruby/2.2.2\",\r\n  \"notifier\": {\r\n    \"name\": \"airbrake-ruby\",\r\n    \"url\": \"https://github.com/airbrake/airbrake-ruby\",\r\n    \"version\": \"1.0.3\"\r\n  },\r\n  \"os\": \"x86_64-linux\",\r\n  \"remoteAddr\": \"XX.XXX.XXX.XXX\"\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/airbrake/airbrake/issues/comments/173926281","html_url":"https://github.com/airbrake/airbrake/issues/490#issuecomment-173926281","issue_url":"https://api.github.com/repos/airbrake/airbrake/issues/490","id":173926281,"user":{"login":"kyrylo","id":1079123,"avatar_url":"https://avatars.githubusercontent.com/u/1079123?v=3","gravatar_id":"","url":"https://api.github.com/users/kyrylo","html_url":"https://github.com/kyrylo","followers_url":"https://api.github.com/users/kyrylo/followers","following_url":"https://api.github.com/users/kyrylo/following{/other_user}","gists_url":"https://api.github.com/users/kyrylo/gists{/gist_id}","starred_url":"https://api.github.com/users/kyrylo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kyrylo/subscriptions","organizations_url":"https://api.github.com/users/kyrylo/orgs","repos_url":"https://api.github.com/users/kyrylo/repos","events_url":"https://api.github.com/users/kyrylo/events{/privacy}","received_events_url":"https://api.github.com/users/kyrylo/received_events","type":"User","site_admin":false},"created_at":"2016-01-22T13:52:10Z","updated_at":"2016-01-22T13:52:10Z","body":"I've been debugging this very thoroughly and came to the conclusion that it's a bug in Passenger. Unfortunately I don't know where exactly. I skimmed through the Passenger code and tried to debug that, but my knowledge of Passenger's internals is limited.\r\n\r\nHere's the proof. Given this Sinatra app...\r\n\r\n```ruby\r\nrequire 'sinatra'\r\n\r\nat_exit do\r\n  puts 'CONFIG.RU AT_EXIT'\r\n  if $!\r\n    puts \"EXITING BECAUSE OF AN EXCEPTION:\"\r\n    p $!\r\n    p $!.backtrace\r\n  end\r\nend\r\n\r\nget '/' { 'Hello world!' }\r\nrun Sinatra::Application\r\n```\r\n\r\n...launch it with `passenger start`. Then make a few requests and wait for 5 minutes. When 5 minutes passed check your console and evidence this:\r\n\r\n```\r\nApp 8923 stdout: CONFIG.RU AT_EXIT\r\n[ 2016-01-22 15:01:45.3458 8875/7f3ae0e58700 age/Cor/CoreMain.cpp:794 ]: Disconnecting long-running connections for process 12434, application /home/kyrylo/code/airbrake-passenger-demo/public (development)\r\nApp 12434 stdout: CONFIG.RU AT_EXIT\r\nApp 12434 stdout: EXITING BECAUSE OF AN EXCEPTION:\r\nApp 12434 stdout: #<NoMethodError: undefined method `call' for nil:NilClass>\r\nApp 12434 stdout: []\r\n[ 2016-01-22 15:01:50.2792 8875/7f3ae0e58700 age/Cor/CoreMain.cpp:794 ]: Disconnecting long-running connections for process 10205, application /home/kyrylo/code/airbrake-passenger-demo/public (development)\r\nApp 10205 stdout: CONFIG.RU AT_EXIT\r\nApp 10205 stdout: EXITING BECAUSE OF AN EXCEPTION:\r\nApp 10205 stdout: #<NoMethodError: undefined method `call' for nil:NilClass>\r\nApp 10205 stdout: []\r\n```\r\n\r\nAs you can see this error comes from Passenger and Airbrake simply reports it (instead of reporting we log the error in this app). Thus I am 101% sure it's not an issue with Airbrake.\r\n\r\nWhat this means to you? I am going to file an issue at Passenger's issue tracker and you should probably follow it. Until the issue is resolved I'd suggest to ignore this particular error:\r\n\r\n```ruby\r\nAirbrake.add_filter do |notice|\r\n  # See: https://github.com/airbrake/airbrake/issues/490\r\n  passenger_error = proc do |error|\r\n    error[:backtrace].empty? && error[:type] == 'NoMethodError'\r\n  end\r\n\r\n  notice.ignore! if notice[:errors].any?(&passenger_error)\r\nend\r\n```\r\n\r\nThanks for the report."}}