ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

ViewGantt: ActionView::TemplateError (Bug #787)


Added by Denny Schierz at 2011-12-21 03:08 pm. Updated at 2012-03-23 12:12 pm.


Status:Closed Start date:2011-12-21
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:Gantt chart
Target version:-
Remote issue URL: Affected version:

Description

hi,

Some (not all) have problems with viewing the Gantt charts. Click on the view produce an internal error:

=============
lib/redmine/helpers/gantt.rb:246:in `render_version'
lib/redmine/helpers/gantt.rb:213:in `render_project'
lib/redmine/helpers/gantt.rb:212:in `each'
lib/redmine/helpers/gantt.rb:212:in `render_project'
lib/redmine/helpers/gantt.rb:185:in `render'
app/models/project.rb:619:in `project_tree'
app/models/project.rb:615:in `each'
app/models/project.rb:615:in `project_tree'
lib/redmine/helpers/gantt.rb:183:in `render'
app/views/gantts/show.html.erb:63
app/controllers/gantts_controller.rb:35:in `show'
app/controllers/gantts_controller.rb:34:in `show'
/usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:92:in `process_request'
/usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:358:in `handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in `start'
/usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:213:in `start'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
/usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/usr/lib/phusion_passenger/passenger-spawn-server:61

Rendering /var/www/chili-2.5.0/public/500.html (500 Internal Server Error)

=====================

Base system Chili 2.5.0 on Debian Squeeze with Apache2 as frontend:

About your application's environment
Ruby version 1.8.7 (x86_64-linux)
RubyGems version 1.3.7
Rack version 1.1.2
Rails version 2.3.14
Active Record version 2.3.14
Active Resource version 2.3.14
Action Mailer version 2.3.14
Active Support version 2.3.14
Application root /var/www/chili-2.5.0
Environment production
Database adapter mysql
Database schema version 20111014073605

About your Redmine plugins
Auto Project plugin 1.0.0
Ensure Project Hierarchy plugin 1.0.0
ChiliProject Nissue 1.0.0
ChiliProject Backlogs 1.1.0
Redmine Checkout plugin 0.5
Redmine Onevision Permission plugin 0.0.1
SCM Creator 0.3.0

bundle show
Gems included by the bundle: * Ascii85 (1.0.1) * actionmailer (2.3.14) * actionpack (2.3.14) * activerecord (2.3.14) * activeresource (2.3.14) * activesupport (2.3.14) * acts_as_silent_list (1.2.0) * bundler (1.0.17) * coderay (0.9.8) * columnize (0.3.6) * edavis10-object_daddy (0.4.3) * fastercsv (1.5.4) * i18n (0.4.2) * json (1.6.3) * linecache (0.46) * metaclass (0.0.1) * mocha (0.10.0) * mysql (2.8.1) * mysql2 (0.2.18) * net-ldap (0.2.2) * pdf-inspector (1.0.1) * pdf-reader (0.10.1) * prawn (0.8.4) * prawn-core (0.8.4) * prawn-layout (0.8.4) * prawn-security (0.8.4) * rack (1.1.2) * rails (2.3.14) * rake (0.8.7) * rbx-require-relative (0.0.5) * rdoc (3.12) * ruby-debug (0.10.4) * ruby-debug-base (0.10.4) * ruby-openid (2.1.8) * rubytree (0.5.3) * shoulda (2.10.3)

any hints?


History

Updated by Denny Schierz at 2011-12-21 03:12 pm

Missed some lines:

Processing GanttsController#show (for 130.83.160.152 at 2011-12-21 15:58:48) [GET]
Parameters: {"project_id"=>"ti21uziv", "action"=>"show", "controller"=>"gantts"}
Rendering template within layouts/base
Rendering gantts/show

ActionView::TemplateError (comparison of Issue with Issue failed) on line #63 of app/views/gantts/show.html.erb:
60: # Width of the entire chart
61: g_width = (@gantt.date_to - @gantt.date_from + 1)*zoom
62:
63: @gantt.render(:top => headers_height + 8, :zoom => zoom, :g_width => g_width, :subject_width => subject_width)
64:
65: g_height = [(20 * (@gantt.number_of_rows + 6))+150, 206].max
66: t_height = g_height + headers_height

[...]

Updated by Denny Schierz at 2011-12-21 03:24 pm

Found a similar problem under redmine: http://www.redmine.org/issues/7579

Updated by Holger Just at 2012-01-03 03:52 pm

At first, sorry for the delay.

This issues is probably caused by inconsistent data in your issues table, specifically the information about the tree of parent issues.

Please run the following command from within RAILS_ENV=production script/console:

Issue.rebuild!

It will rebuild the parent issue trees. As it looks rather deeply at the data, it can take some time depending on the number of issues in your database. After the rebuilding has finished you can then exit the console by typing quit

As you are operating on your live database here, it is advisable to have a recent backup before starting.

Please report back on your results.

  • Status changed from Open to Needs more information

Updated by Denny Schierz at 2012-01-05 07:24 am

Holger Just wrote:

At first, sorry for the delay.

no problem at all :-)

Please report back on your results.

?> Issue.rebuild!
ActiveRecord::StaleObjectError: Attempted to update a stale object: Issue
    from /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/locking/optimistic.rb:100:in `update_without_dirty'
    from /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/dirty.rb:146:in `update_without_timestamps'
    from /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/timestamp.rb:64:in `update_without_callbacks'
    from /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/callbacks.rb:282:in `update'
    from /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:2927:in `create_or_update_without_callbacks'
    from /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/callbacks.rb:250:in `create_or_update'
    from /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/base.rb:2594:in `save_without_validation!'
    from /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/validations.rb:1099:in `save_without_dirty!'
    from /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/dirty.rb:87:in `save_without_transactions!'
    from /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:200:in `save!'
    from /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
    from /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:182:in `transaction'
    from /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:200:in `save!'
    from /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
    from /var/lib/gems/1.8/gems/activerecord-2.3.14/lib/active_record/transactions.rb:200:in `save!'
    from /var/www/chili-2.5.0/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb:187:in `rebuild!'
    from /var/www/chili-2.5.0/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb:184:in `call'
    from /var/www/chili-2.5.0/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb:184:in `rebuild!'
    from /var/www/chili-2.5.0/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb:184:in `each'
    from /var/www/chili-2.5.0/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb:184:in `rebuild!'
    from /var/www/chili-2.5.0/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb:194:in `call'
    from /var/www/chili-2.5.0/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb:194:in `rebuild!'
    from /var/www/chili-2.5.0/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb:191:in `each'
    from /var/www/chili-2.5.0/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb:191:in `rebuild!'

Updated by Holger Just at 2012-01-05 07:37 am

Denny Schierz wrote:

?> Issue.rebuild!
ActiveRecord::StaleObjectError: Attempted to update a stale object: Issue

This happens if issues are updated by two processes (or users) at the same time. I guess you haven't stopped your ChiliProject and one of your users updated an issue at an unfortunate time. It should work if you stop your live ChiliProject before hand and make sure you are the only one accessing the database.

Updated by Denny Schierz at 2012-01-05 07:43 am

Holger Just wrote:

This happens if issues are updated by two processes (or users) at the same time. I guess you haven't stopped your ChiliProject and one of your users updated an issue at an unfortunate time. It should work if you stop your live ChiliProject before hand and make sure you are the only one accessing the database.

I've stopped Apache (no rake/chili processes are active), but results are the same.

Updated by Denny Schierz at 2012-01-27 09:39 am

hi,

any more ideas?

Updated by Felix Schäfer at 2012-01-29 06:20 pm

Other than "Issue.rebuild! should do the trick", no. You might be able to correct by hand by looking at the issues table and look for rows with empty lft or root_id fields. If none are missing, there might be issues with the same lft and root_id, which would be a data inconsistency too.

Updated by Denny Schierz at 2012-01-30 08:34 am

The only one I can see, is the first row:

lft root_id
1 1

all others are different (which I can see, with my less SQL Know How ;-) ..), but I think it's normal.

cu denny

Updated by Denny Schierz at 2012-01-30 08:41 am

My SQL:

mysql> select COUNT(), lft,root_id FROM issues GROUP BY lft,root_id HAVING COUNT()>1;
Empty set (0.00 sec)

mysql> select lft,root_id from issues where lft is null;
Empty set (0.00 sec)

mysql> select lft,root_id from issues where root_id is null;
Empty set (0.00 sec)

Updated by Felix Schäfer at 2012-01-30 01:20 pm

I'm not that firm in SQL either, but yeah, I meant issues where the pair root_id,lft is the same.

Could you attach here or send me from the issues table the following columns: id, lft, rgt, root_id, project_id, parent_id? Thanks!

Updated by Denny Schierz at 2012-03-23 12:12 pm

Problem disapears ... don't know the reason why, but after the CHili update and some weeks later. :-/

  • Status changed from Needs more information to Closed

Also available in: Atom PDF