Defect #7018
closed'undefined method `reschedule_after' for nil:NilClass' on new issues
Added by Bruno Medeiros almost 16 years ago. Updated almost 16 years ago.
Description
Updated by Bruno Medeiros almost 16 years ago
Actions
#1
I did several tests now and no pattern yet. Submitting the same xml works once, then fails, then works again. The full stack is:
/home/bruno.medeiros/Aptana RadRails Workspace/redmine-1.0/app/models/issue_relation.rb:88:in `set_issue_to_dates' /home/bruno.medeiros/Aptana RadRails Workspace/redmine-1.0/app/models/issue.rb:764:in `reschedule_following_issues' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_collection.rb:369:in `method_missing' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_proxy.rb:215:in `method_missing' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_proxy.rb:215:in `each' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_proxy.rb:215:in `send' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_proxy.rb:215:in `method_missing' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/associations/association_collection.rb:369:in `method_missing' /home/bruno.medeiros/Aptana RadRails Workspace/redmine-1.0/app/models/issue.rb:763:in `reschedule_following_issues' /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in `send' /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in `evaluate_method' /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:166:in `call' /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:93:in `run' /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in `each' /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in `send' /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in `run' /var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:276:in `run_callbacks' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:344:in `callback' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:251:in `create_or_update' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2538:in `save_without_validation' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:1078:in `save_without_dirty' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/dirty.rb:79:in `save_without_transactions' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `send' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `with_transaction_returning_status' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:182:in `transaction' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:228:in `with_transaction_returning_status' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in `save' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:208:in `rollback_active_record_state!' /var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in `save' /home/bruno.medeiros/Aptana RadRails Workspace/redmine-1.0/app/controllers/issues_controller.rb:129:in `create'
It seems that some code creates a IssueRelation with 'issue_to' nil.
Updated by Bruno Medeiros almost 16 years ago
Actions
#2
I did a new 1.0.4 checkout and the problem doesn't seem to be present. It's very strange, because a diff in both working copies only show unrelated files..
Is there any change that a deleted plugin caused something like that? Is there any way to reset any plugin data?
Updated by Bruno Medeiros almost 16 years ago
Actions
#3
Mi thoughts on previuos post were wrong, the problem happens also with the new 1.0.4 checkout.
After several hours of debugging, I tried to see if there was something wrong with my data. so I ran the following query:
select * FROM issue_relations where issue_from_id not in (select id from issues) or issue_to_id not in (select id from issues)
Surprisingly, this query returned a lot of lines!! After delete those entries, the problem was gone.
I don't understand how could invalid entries on the table issue_relation could influence the creation of a new issue, but it does indeed. I created a new issue asking for FK contraints, #7032.
Please close it as 'not a bug'.
Updated by Jean-Philippe Lang almost 16 years ago
Actions
#4
- Subject changed from Issue REST API giving 'undefined method `reschedule_after' for nil:NilClass' on new issues to 'undefined method `reschedule_after' for nil:NilClass' on new issues
- Status changed from New to Resolved
- Target version set to 1.0.5
- Resolution set to Fixed
r4467 will prevent this error to occur.
Updated by Jean-Philippe Lang almost 16 years ago
Actions
#5
- Status changed from Resolved to Closed
Fix merged in 1.0-stable.