Project

General

Profile

Defect #1534

"Error 500" when creating a new task for a specific sprint

Added by Wesllen Queiroz almost 7 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
High
Category:
Issues list & form
Target version:
Source:
Testing
Detected on version:
Blocked:
Yes
Alone:
No
Milestones:
Sprint:

Description

I am dropping into an Internalerror 500 page when creating a new task, of type functionality for specific sprints. Apparently it is something related to the Scrum plugin, which is even in its latest stable version (0.18).


Files

log-redmine-eduzz.txt (4.28 KB) log-redmine-eduzz.txt Log file Wesllen Queiroz, 2018-01-24 12:38
error-log-redmine.txt (4.07 KB) error-log-redmine.txt Miroslw Burzynski, 2018-02-15 10:56
#1

Updated by jfrlbn jfrlbn almost 7 years ago

Hello

We get a very similar error when updating an existing issue by adding a sprint :

Started PATCH "/issues/9606" for 127.0.0.1 at 2018-02-14 08:49:46 +0100
Processing by IssuesController#update as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"...", "form_update_triggered_by"=>"", "issue"=>{"is_private"=>"0", "project_id"=>"297", "tracker_id"=>"1", "subject"=>"...", "description"=>"...", "status_id"=>"1", "priority_id"=>"3", "assigned_to_id"=>"", "fixed_version_id"=>"", "parent_issue_id"=>"", "start_date"=>"2017-11-22", "due_date"=>"", "estimated_hours"=>"0.25", "done_ratio"=>"0", "sprint_id"=>"19", "pending_effort"=>"", "tag_list"=>"hpoo", "notes"=>"", "private_notes"=>"0", "lock_version"=>"2"}, "was_default_status"=>"1", "time_entry"=>{"hours"=>"", "activity_id"=>"", "comments"=>""}, "last_journal_id"=>"26585", "commit"=>"Submit", "prev_issue_id"=>"9621", "next_issue_id"=>"9585", "issue_position"=>"23", "issue_count"=>"36", "id"=>"9606"}
  Current user: ... (id=9)
Completed 500 Internal Server Error in 115ms (ActiveRecord: 28.8ms)

NoMethodError (undefined method `>' for nil:NilClass):
  plugins/scrum/lib/scrum/issue_patch.rb:564:in `block in max_position'
  plugins/scrum/lib/scrum/issue_patch.rb:563:in `each'
  plugins/scrum/lib/scrum/issue_patch.rb:563:in `max_position'
  plugins/scrum/lib/scrum/issue_patch.rb:576:in `move_issue_to_the_end_of_the_sprint'
  plugins/scrum/lib/scrum/issue_patch.rb:463:in `update_position'
  app/models/issue.rb:210:in `create_or_update'
  app/controllers/issues_controller.rb:558:in `block in save_issue_with_child_records'
  app/controllers/issues_controller.rb:546:in `save_issue_with_child_records'
  app/controllers/issues_controller.rb:168:in `update'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

We use plugin version 0.18.1

#2

Updated by Miroslw Burzynski almost 7 years ago

Hello,
We have "Internal error" when updating task (when we moving ticket to backlog).
We use plugin version 0.17.0

#3

Updated by Shreyas Moolya almost 7 years ago

Even I am facing the same problem

#4

Updated by Yann Autissier almost 7 years ago

Hi,

I got same issue with redmine v3.4.4 and scrum plugin v0.18.1.

Resolved by editing the file plugins/scrum/lib/scrum/issue_patch.rb on line 564 :

replace

              max = pbi.position if max.nil? or (pbi.position > max)

by
              max = pbi.position if max.nil? or (pbi.position || 0 > max)

Update the line 554 too.

PS. I cannot post a patch as I dont have git access to the repo.

#5

Updated by Wesllen Queiroz almost 7 years ago

Greetings Yann Autissier!

Thanks for the contribution. I will make the changes as mentioned and I will come back with the feedback.

Yann Autissier escribió:

Hi,

I got same issue with redmine v3.4.4 and scrum plugin v0.18.1.

Resolved by editing the file plugins/scrum/lib/scrum/issue_patch.rb on line 564 :

replace
[...]
by
[...]

Update the line 554 too.

PS. I cannot post a patch as I dont have git access to the repo.

#6

Updated by Emilio González Montaña almost 7 years ago

I don't see the point of the proposed change... it seems an error, the only thing that you achieve is to disable the check...

#7

Updated by Emilio González Montaña almost 7 years ago

By the way, Wesllen GIT access is available for Patreon supporters:

https://www.patreon.com/ociotec

#8

Updated by Yann Autissier almost 7 years ago

The error occurs when pbi.position is nil, then (pbi.position > max) throws NoMethodError (undefined method `>' for nil:NilClass) exception.

We should compare min/max with 0 when pbi.position is nil (on a parent task).

Is it better adding parenthesis : ((pbi.position || 0) > max) ?

#9

Updated by Shreyas Moolya over 6 years ago

What happens when we use '||' operator here in this syntax? Does the 'pbi.position' render 'False' or 'True'?

Because in this case the pbi.position goes blank.

Kindly elaborate what you did here

replace

max = pbi.position if max.nil? or (pbi.position > max)

by

max = pbi.position if max.nil? or (pbi.position || 0 > max)
#10

Updated by Emilio González Montaña over 6 years ago

  • Blocked changed from No to Yes
  • Target version set to Scrum v0.18.2
  • Status changed from New to Resolved
  • Category set to Issues list & form
#11

Updated by Emilio González Montaña over 6 years ago

Support the plugin development at www.patreon.com/ociotec & gain access to the GIT repo! :)

Also available in: Atom PDF