Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SystemStackError when deleting a non-paranoid model #93

Closed
davidbiehl opened this issue Mar 12, 2018 · 3 comments
Closed

SystemStackError when deleting a non-paranoid model #93

davidbiehl opened this issue Mar 12, 2018 · 3 comments

Comments

@davidbiehl
Copy link

Rails 5.0.6, Ruby 2.3.1.

Models that are "paranoid" (acts_as_paranoid is called in the body of the model) are soft-deleted just fine.

However, calling destroy on any other model results in SystemStackError (stack level too deep): referencing the line of code where destroy was called on the model. I confirmed that removing the acts_as_paranoid from the project returns destroying to the expected behavior.

@WaKeMaTTa
Copy link

Check in your destroy_with_dependencies! if you have broken code, you will get stack level too deep

@glindsey
Copy link

glindsey commented Apr 8, 2019

I'm running into a similar issue in our codebase which appears to be a conflict between acts_as_paranoid and newrelic_rpm: both attempt to wrap delete_all which results in a callstack looking like:

/gems/activerecord-5.0.7.2/lib/active_record/dynamic_matchers.rb:32 in each
/gems/activerecord-5.0.7.2/lib/active_record/dynamic_matchers.rb:32 in find
/gems/activerecord-5.0.7.2/lib/active_record/dynamic_matchers.rb:32 in match
/gems/activerecord-5.0.7.2/lib/active_record/dynamic_matchers.rb:7 in respond_to?
/gems/activesupport-5.0.7.2/lib/active_support/core_ext/object/try.rb:6 in try
/gems/acts_as_paranoid-0.6.0/lib/acts_as_paranoid/relation.rb:6 in paranoid?
/gems/acts_as_paranoid-0.6.0/lib/acts_as_paranoid/relation.rb:23 in delete_all
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/active_record_prepend.rb:49 in block in delete_all
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/transaction.rb:813 in with_database_metric_name
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent.rb:643 in with_database_metric_name
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/active_record_prepend.rb:48 in delete_all
/gems/acts_as_paranoid-0.6.0/lib/acts_as_paranoid/relation.rb:18 in delete_all!
/gems/acts_as_paranoid-0.6.0/lib/acts_as_paranoid/relation.rb:26 in delete_all
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/active_record_prepend.rb:49 in block in delete_all
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/transaction.rb:813 in with_database_metric_name
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent.rb:643 in with_database_metric_name
/gems/newrelic_rpm-6.2.0.354/lib/new_relic/agent/instrumentation/active_record_prepend.rb:48 in delete_all
/gems/acts_as_paranoid-0.6.0/lib/acts_as_paranoid/relation.rb:18 in delete_all!
/gems/acts_as_paranoid-0.6.0/lib/acts_as_paranoid/relation.rb:26 in delete_all

...and so on, repeating those six frames over and over until the stack is exhausted.

@mvz
Copy link
Contributor

mvz commented May 1, 2022

Closing this as there was no more feedback on the original issue. @glindsey I moved your problem to a new issue: #280.

@mvz mvz closed this as completed May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants