Large number of Orphaned Err's #156

Closed
stevewoolley opened this Issue Feb 13, 2012 · 7 comments

Comments

Projects
None yet
6 participants

I may not understand the relationship between Errs, Problems, and Notices but.....

I am seeing a large number of (what I believe to be) orphaned Errs. My understanding is that there should be (pretty much) a one-to-many relationship between Problems and Errs (hense the presence of the problem_id field on Errs). However I am seeing a large number of Errs with nil problem_id:

1.9.3-p0 :001 > Err.count
=> 47148
1.9.3-p0 :002 > Problem.count
=> 647
1.9.3-p0 :003 > Notice.count
=> 10767
1.9.3-p0 :004 > Err.where(:problem_id => nil).count
=> 43569

I know their is a rake task to clean up related Problem>Err>Notice's but if the Err objects are not related to the Problem objects, they will never be cleaned up.

Am I lost?

Steve Woolley
swoolley@reverbnation.com

Owner

oruen commented Mar 6, 2012

I believe there is some bug in Errbit's codebase related to this issues, haven't found it yet.

Thanks for the update.

On Tue, Mar 6, 2012 at 12:52 PM, Nick Recobra <
reply@reply.github.com

wrote:

I believe there is some bug in Errbit's codebase related to this issues,
haven't found it yet.


Reply to this email directly or view it on GitHub:
#156 (comment)

ffmike commented Apr 26, 2012

Looks like we've been bit by this too, running current code:

irb(main):002:0> Err.count
=> 14370
irb(main):003:0> Problem.count
=> 99
irb(main):004:0> Notice.count
=> 45436
irb(main):005:0> Err.where(:problem_id => nil).count
=> 14273

Anything I can do to help diagnose? Can I just delete the errant Errs and hope that cleans it up?

We have taken to running this once a week:
Err.where(:problem_id => nil).each {|err| err.destroy}

Not that this is the best way to clean it up, but since without a problem_id on the Err object, I don't think you could access the Err objects anyway.
The difficult thing is that I do believe these are legitimate errors being recorded by errbit but since they are not properly associated with the Err/Problem hierarchy, they basically go unnoticed.

Same problem here. Anybody was able to find a way to reproduce it?

Contributor

boblail commented Aug 29, 2012

I found this to be true for me too; but all my orphaned errs also had nil for fields like message and fingerprint. Is that true for anyone else?

I found the nils puzzling, but also reassuring—there don't seem to be a pile of legitimate errors just missing a corresponding problem to make them visible.

If you've deleted your nil errs manually, have they ever come back?

I'm going to experiment with putting validates_presence_of :problem_id into Err to see if I start getting invalid Err exceptions.

Owner

shingara commented May 6, 2013

This bug is almost one year old and some improvement was done on problem clearing. I close it waiting a new report to fix it.

shingara closed this May 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment