Bug:Uncaught Exception in New After Party Task
FireLemons opened this issue · 8 comments
Impacted User Types
- volunteers
- supervisors
- admins
Description
Running the new set_case_contacts_as_active
after party task causes the attempted creation of invalid additional expenses.
Stacktrace:
ActiveRecord::RecordInvalid: Validation failed: Additional expenses is invalid (ActiveRecord::RecordInvalid)
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/validations.rb:80:in `raise_validation_error'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/validations.rb:53:in `save!'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/transactions.rb:302:in `block in save!'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/transactions.rb:354:in `block in with_transaction_returning_status'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/database_statements.rb:314:in `transaction'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/transactions.rb:350:in `with_transaction_returning_status'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/transactions.rb:302:in `save!'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/suppressor.rb:54:in `save!'
/app/vendor/bundle/ruby/3.2.0/gems/scout_apm-5.3.5/lib/scout_apm/instruments/active_record.rb:428:in `save!'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/persistence.rb:782:in `block in update!'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/transactions.rb:354:in `block in with_transaction_returning_status'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/transaction.rb:319:in `block in within_new_transaction'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/database_statements.rb:316:in `transaction'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/transactions.rb:350:in `with_transaction_returning_status'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/persistence.rb:780:in `update!'
/app/lib/tasks/deployment/20231125151610_set_case_contacts_as_active.rake:7:in `block (3 levels) in <top (required)>'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/relation/delegation.rb:88:in `each'
/app/vendor/bundle/ruby/3.2.0/gems/activerecord-7.0.8/lib/active_record/relation/delegation.rb:88:in `each'
/app/lib/tasks/deployment/20231125151610_set_case_contacts_as_active.rake:6:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/3.2.0/gems/bugsnag-6.26.1/lib/bugsnag/integrations/rake.rb:20:in `execute'
/app/vendor/bundle/ruby/3.2.0/gems/after_party-1.11.2/lib/tasks/deploy_task_runner.rake:6:in `block (3 levels) in <top (required)>'
/app/vendor/bundle/ruby/3.2.0/gems/after_party-1.11.2/lib/tasks/deploy_task_runner.rake:6:in `each'
/app/vendor/bundle/ruby/3.2.0/gems/after_party-1.11.2/lib/tasks/deploy_task_runner.rake:6:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/3.2.0/gems/bugsnag-6.26.1/lib/bugsnag/integrations/rake.rb:20:in `execute'
/app/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/exe/rake:27:in `<top (required)>'
/app/bin/bundle:133:in `load'
/app/bin/bundle:133:in `<main>'
Tasks: TOP => after_party:set_case_contacts_as_active
Make the task handle the unexpected expenses
Login Emails:
- volunteer1@example.com view site as a volunteer
- supervisor1@example.com view site as a supervisor
- casa_admin1@example.com view site as an admin
- all_casa_admin1@example.com view site as an all casa admin
- go to
/all_casa_admins/sign_in
- go to
password for all users: 12345678
Questions? Join Slack!
We highly recommend that you join us in slack #casa channel to ask questions quickly. And discord for office hours (currently Tuesday 5-7pm Pacific), stakeholder news, and upcoming new issues.
@FireLemons It's not trying to create new ones. It's causing the validation on additional expenses validates_associated :additional_expenses
(case_contact.rb:42), which had a validation added after the fact and doesn't have a default for the column.
The fix here is to set a default, either on the database column or in the AfterParty task.
I'll bet if you printed the CaseContacts breaking this, they would all be old.
@FireLemons This will print the IDs of the case contacts and the last one will give us the one causing the error. Can you merge and deploy and then point me to the stacktrace when it fails?
#5529
This issue has been inactive for 249 hours (10.38 days) and will be unassigned after 111 more hours (4.63 days). If you have questions, please
If you are still working on this, comment here to tell the bot to give you more time
This issue has been inactive for 369 hours (15.38 days) and is past the limit of 360 hours (15.00 days) so is being unassigned.You’ve just been unassigned from this ticket due to inactivity – but feel free to pick it back up (or a new one!) in the future! Thank you again for your contribution to this project.
This has been successfully released.