Project

General

Profile

Actions

Defect #13557

closed

Error on Gantt chart and calendar in v 2.3.0 with Sql Server

Added by Stéphane POTTIER almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Gantt
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

Hi,

After migrating MySQL database to SqlServer database, everything Ok.
But i got an error when accessing Gantt chart (error 500) et the calendar don't show any issues.

Here is the log for the gantt chart

Completed 500 Internal Server Error in 1298ms

ActionView::Template::Error (comparison of Date with ActiveSupport::TimeWithZone failed):
89:
90: # Width of the entire chart
91: g_width = ((@gantt.date_to - @gantt.date_from + 1) * zoom).to_i
92: @gantt.render(:top => headers_height + 8,
93: :zoom => zoom,
94: :g_width => g_width,
95: :subject_width => subject_width)
lib/redmine/helpers/gantt.rb:657:in `>'
lib/redmine/helpers/gantt.rb:657:in `coordinates'
lib/redmine/helpers/gantt.rb:401:in `line_for_issue'
lib/redmine/helpers/gantt.rb:234:in `block in render_issues'
lib/redmine/helpers/gantt.rb:232:in `each'
lib/redmine/helpers/gantt.rb:232:in `render_issues'
lib/redmine/helpers/gantt.rb:219:in `render_project'
lib/redmine/helpers/gantt.rb:201:in `block in render'
app/models/project.rb:733:in `block in project_tree'

Thanks for help

Actions #1

Updated by Etienne Massip almost 12 years ago

  • Status changed from New to Needs feedback
  • Affected version (unused) set to 2.3.0
  • Resolution set to Cant reproduce
  • Affected version set to 2.3.0

Can't reproduce.

What does your setup looks like, SQL Server version, do you have any plugins installed, etc. (see SubmittingBugs)

Are you sure your issue table start_date and due_date definition and data are fine in DB after migration?
They should be defined with 'date' type.

Actions #2

Updated by Stéphane POTTIER almost 12 years ago

rake db:migrate : no messages.

SQL Server 2005.
Plugins:
- DMSF v1.4.5 stable
- Redmine Impasse plugin : 1.2.2
- Issue CheckList plugin: 2.0.0
- Stealth plugin : 0.6.0
- Sidebar content: 0.1.0

Columns in issue table seems Ok (both are date format).

Actions #3

Updated by Etienne Massip almost 12 years ago

  • Status changed from Needs feedback to Closed
  • Resolution changed from Cant reproduce to Invalid

Sorry but SQL Server 2005 support has not been tested, Redmine supports 2008 and higher as stated in requirements.

Anyway, could you try with SQL Server 2008 and reopen this issue if the error persist?

It might be caused by a plugin too, maybe you should try with no plugin installed if you can.

Actions #4

Updated by Stéphane POTTIER almost 12 years ago

  • Status changed from Closed to Reopened

My base is now Under SQL Server 2008 -
Same results on gantt chart and calendar.

Seems to be a probleme on date format.

Can you give me more information about database config (database encoding, ...) so i can look further to a solution.

Thanks

Actions #5

Updated by Stéphane POTTIER almost 12 years ago

Sorry, not exactly same error on log file :)

ActionView::Template::Error (can't convert Date into an exact number)
89:
90: # Width of the entire chart
91: g_width = ((@gantt.date_to - @gantt.date_from + 1) * zoom).to_i
92: @gantt.render(:top => headers_height + 8,
93: :zoom => zoom,
94: :g_width => g_width,
95: :subject_width => subject_width)
lib/redmine/helpers/gantt.rb:641:in `coordinates'
lib/redmine/helpers/gantt.rb:289:in `line_for_project'

Actions #6

Updated by Etienne Massip almost 12 years ago

Stéphane POTTIER wrote:

My base is now Under SQL Server 2008 -

Did you backup/restore from SQL Server 2005 or recreate the database from migration?

Edit:

Can you give me more information about database config (database encoding, ...) so i can look further to a solution.

All default, no specific configuration is needed.

Actions #7

Updated by Stéphane POTTIER almost 12 years ago

I did a backup/restore from SQL Server 2005, and change due_date / start_date to date type in management studio (with migration it was in datetime).

Actions #8

Updated by Etienne Massip almost 12 years ago

Stéphane POTTIER wrote:

I did a backup/restore from SQL Server 2005, and change due_date / start_date to date type in management studio (with migration it was in datetime).

Could you run migration to create the schema objects then restore data only?

Actions #9

Updated by Stéphane POTTIER almost 12 years ago

Calendar error resolved (with date type) but gantt style on error.

Message change in log file:

ActionView::Template::Error (comparison of Date with Time failed):
89:
90: # Width of the entire chart
91: g_width = ((@gantt.date_to - @gantt.date_from + 1) * zoom).to_i
92: @gantt.render(:top => headers_height + 8,
93: :zoom => zoom,
94: :g_width => g_width,
95: :subject_width => subject_width)

Actions #10

Updated by Etienne Massip almost 12 years ago

Stéphane POTTIER wrote:

Calendar error resolved (with date type) but gantt style on error.

I'm sorry, what do you mean exactly?

Actions #11

Updated by Stéphane POTTIER almost 12 years ago

Don't be sorry :)

Issues now appear in calendar vue but i've still get error 500 on gantt visualisation.

Actions #12

Updated by Etienne Massip almost 12 years ago

Ok, could you please give the full error stack (the lines starting with lib/redmine/helpers) then?

Actions #13

Updated by Stéphane POTTIER almost 12 years ago

Here is the log. Thanks again

Started GET "/redmine/projects/si-rh-tdc/issues/gantt" for 172.18.1.23 at 2013-03-22 16:42:03 +0100
Processing by GanttsController#show as HTML
Parameters: {"project_id"=>"si-rh-tdc"}
Current user: spottier (id=1)
Rendered queries/_filters.html.erb (31.3ms)
Rendered gantts/show.html.erb within layouts/base (93.8ms)
Completed 500 Internal Server Error in 1000ms

ActionView::Template::Error (comparison of Date with Time failed):
89:
90: # Width of the entire chart
91: g_width = ((@gantt.date_to - @gantt.date_from + 1) * zoom).to_i
92: @gantt.render(:top => headers_height + 8,
93: :zoom => zoom,
94: :g_width => g_width,
95: :subject_width => subject_width)
app/models/project.rb:561:in `each'
app/models/project.rb:561:in `max'
app/models/project.rb:561:in `due_date'
app/models/project.rb:568:in `overdue?'
lib/redmine/helpers/gantt.rb:271:in `subject_for_project'
lib/redmine/helpers/gantt.rb:210:in `render_project'
lib/redmine/helpers/gantt.rb:201:in `block in render'
app/models/project.rb:733:in `block in project_tree'
app/models/project.rb:729:in `each'
app/models/project.rb:729:in `project_tree'
lib/redmine/helpers/gantt.rb:199:in `render'
app/views/gantts/show.html.erb:92:in `_app_views_gantts_show_html_erb__326700193_30497328'
app/controllers/gantts_controller.rb:43:in `block (2 levels) in show'
app/controllers/gantts_controller.rb:42:in `show'

Actions #14

Updated by Etienne Massip almost 12 years ago

Is the 'effective_date' of your 'versions' table a date too?

Actions #15

Updated by Stéphane POTTIER over 11 years ago

Hi,

That's it ! The effective_date type in versions table was wrong.

Thanks a lot for your help!

Actions #16

Updated by Etienne Massip over 11 years ago

  • Status changed from Reopened to Closed

No problem. Always stick to the requirements =)

Actions #17

Updated by Etienne Massip over 11 years ago

Stéphane POTTIER wrote:

That's it ! The effective_date type in versions table was wrong.

Although it should not be if you created this table from migration in SQL Server 2008?

Actions #18

Updated by Olivier Houdas over 11 years ago

Wow, I finally understood why we're having issues on our Redmine installation from reading that bug...

We've been using an MS SQL 2005, which does NOT support DATE field types, it only has DATETIME or SMALLDATETIME or TIMESTAMP, which all include the time in the output.

The conclusion is that indeed, Redmine is NOT compatible with MS SQL 2005...

Actions

Also available in: Atom PDF