Comments (10)
Oh no, I'm not actively contributing; I only chimed in to provide context, since I was the original implementer.
from honeybadger-ruby.
Yeah, that's the case. To elaborate, we could decide to enable the Rails error reporter for all cases, but when errors are raised in third-party systems like Sidekiq, the Rails error reporter doesn't have access to any useful context about the job (as at then, at least). By contrast, our middleware integrates with Sidekiq, so it has more context accessible.
One fix here would be to look at the source
parameter and check it it's from Solid Queue (dunno what value it uses), and then go ahead to report it.
from honeybadger-ruby.
Hello! Was just about to email Josh before checking to see if an issue was open for this. I just spent a few hours feeling REALLY DUMB trying to figure out why activejob (backed by solid queue in my case) wasn't being reported by honeybadger default (especially since I couldn't find any mention in the documentation about a manual setup step for reporting errors from failed jobs, I assumed this was being done by the gem)
from honeybadger-ruby.
It looks like the issue is here.
from honeybadger-ruby.
It looks like the issue is here.
Based on the comment in that file, I think the issue is that we let our rack middleware catch unhandled errors in web requests, but we have no such catchall middleware for ActiveJob. Does that sound right, @shalvah?
Does anyone have an opinion on the best way to fix it?
from honeybadger-ruby.
One fix here would be to look at the source parameter and check it it's from Solid Queue (dunno what value it uses), and then go ahead to report it.
Can we have a register of the middleware we have defined and report if the source
is not in that register instead of just checking the handled
flag? Or even a combination of these two checks?
from honeybadger-ruby.
The source parameter has nothing to do with our middleware... It's an entirely new concept that was introduced with the error reporter, so checking what middleware is registered won't do much, unless you also maintain a mapping of middleware to sources. But also note that the source is not very reliable (an integration has to set it, or it defaults to active_support
).
from honeybadger-ruby.
unless you also maintain a mapping of middleware to sources
Yes, that's what I was suggesting. Would you be against that? Though, if source
is not reliable, it doesn't make sense to do it.
One fix here would be to look at the source parameter and check it it's from Solid Queue (dunno what value it uses), and then go ahead to report it.
I guess we are left with this solution? I can go ahead and try it if you haven't started working on it already.
from honeybadger-ruby.
For anyone stumbling on this via Google, this is what I did to trigger notifications manually (and to print errors to stdout outside production, which solid queue's CLI does not do by default):
class ApplicationJob < ActiveJob::Base
rescue_from(StandardError) do |error|
if Rails.env.production?
Honeybadger.notify(error, {
controller: self.class.name,
context: {
job_id:,
arguments:
}
})
else
SolidQueue.logger.error "Exception occurred processing job #{job_id}: #{error.message}"
SolidQueue.logger.error error.backtrace.join("\n")
end
end
end
from honeybadger-ruby.
Here’s another example of working around the issue.
from honeybadger-ruby.
Related Issues (20)
- Minitest: Test Backend Notices Not Added to `Honeybadger::Backend::Test` HOT 9
- Invalid class_name param in documentation HOT 1
- Use nested context from objects where available
- Sidekiq 7.1.5 and later changes number of arguments for error handlers
- Add check-in configuration sync HOT 2
- Automate releases with Github Actions
- Flaky test in JRuby test matrix entry
- Allow check-ins to be made by slug as well as id. HOT 8
- Avoid bundling unnecessary dependencies in published gem HOT 3
- Sanitizer#filter_key? returns a warning for Numeric hash keys HOT 5
- ActiveJob premature reporting HOT 2
- ActiveJob rescued exceptions should not be reported HOT 2
- Honeybadger.context returns Honeybadger::Agent when passing a block
- good_job related exception at app startup HOT 8
- exception if active job is configured to use a queue adapter via a class HOT 3
- Insights support appears to not work on Rails 3.2 HOT 3
- Change `events.ignored` array configuration setting to allow objects
- The `bigdecimal` gem needs to be added as an explicit dependency HOT 2
- Console logs are being polluted after latest version bump HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from honeybadger-ruby.