Project

General

Profile

Gantt Chart Gives 500 Error After Migration From 2.x to 3.1.1

Added by Ryan Corbin over 8 years ago

I have just migrated my Redmine 2.X installation to the Redmine 3.1.1. My current environment is:

--------
sh: darcs: command not found
sh: hg: command not found
sh: bzr: command not found
Environment:
Redmine version 3.1.1.stable
Ruby version 1.9.3-p551 (2014-11-13) [x86_64-linux]
Rails version 4.2.4
Environment production
Database adapter MySQL
SCM:
Subversion 1.6.11
Git 1.7.1
Filesystem
Redmine plugins:
no plugin installed
--------

I am currently experiencing the following error when I try to view the Gantt chart for any project:

--------
Started GET "/projects/mt04/issues/gantt" for 108.232.10.196 at 2015-09-26 10:17:17 -0400
Processing by GanttsController#show as HTML
Parameters: {"project_id"=>"mt04"}
Current user: rcorbin (id=35)
Rendered queries/_filters.html.erb (46.8ms)
Rendered gantts/show.html.erb within layouts/base (222.8ms)
Completed 500 Internal Server Error in 990ms (ActiveRecord: 47.9ms)

ActionView::Template::Error (comparison of BigDecimal with Date failed):
102:
103: # Width of the entire chart
104: g_width = ((@gantt.date_to - @gantt.date_from + 1) * zoom).to_i
105: @gantt.render(:top => headers_height + 8,
106: :zoom => zoom,
107: :g_width => g_width,
108: :subject_width => subject_width)
app/models/project.rb:573:in `each'
app/models/project.rb:573:in `max'
app/models/project.rb:573:in `due_date'
app/models/project.rb:580:in `overdue?'
lib/redmine/helpers/gantt.rb:665:in `html_subject_content'
lib/redmine/helpers/gantt.rb:674:in `html_subject'
lib/redmine/helpers/gantt.rb:324:in `subject'
lib/redmine/helpers/gantt.rb:286:in `subject_for_project'
lib/redmine/helpers/gantt.rb:257:in `render_object_row'
lib/redmine/helpers/gantt.rb:216:in `render_project'
lib/redmine/helpers/gantt.rb:205:in `block in render'
app/models/project.rb:768:in `block in project_tree'
app/models/project.rb:764:in `each'
app/models/project.rb:764:in `project_tree'
lib/redmine/helpers/gantt.rb:203:in `render'
app/views/gantts/show.html.erb:105:in `_app_views_gantts_show_html_erb___354608090039183384_48092520'
app/controllers/gantts_controller.rb:43:in `block (2 levels) in show'
app/controllers/gantts_controller.rb:42:in `show'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'
--------

It seems like my database has the dates stored in a "Date" format but the current Gantt render expects it to be in a number format. My knowledge of databases is limited so I am unsure if it is possible to do perform a conversion. Has anybody experienced this error before? Please let me know if there is relevant information that I left out.

UPDATE
I created a new project and the Gantt chart module displayed correctly. So, there must be an incompatibility with how Redmine used to store issue data and how the Gantt chart module in Redmine 3.1.1 expects that data.