alexmonteiro / Redmine-Monitoring-Controlling

Redmine Plugin that works with Highcharts to show tasks on project throught Charts.
Other
131 stars 79 forks source link

Cannot open bookmark m&c on project - 500 error #72

Closed lukexx closed 11 years ago

lukexx commented 11 years ago

Hi! I am getting error when I'm trying to open bookmark on project:

Internal error

An error occurred on the page you were trying to access. If you continue to experience problems please contact your Redmine administrator for assistance.

If you are the Redmine administrator, check your log files for details about the error.

Log is telling:

Started GET "/home_monitoring_controlling_project/index/test1" for 192.168.79.207 at 2012-11-28 11:21:35 +0100 Processing by HomeMonitoringControllingProjectController#index as HTML Parameters: {"id"=>"test1"} Current user: admin (id=1) Completed 500 Internal Server Error in 18ms

ActiveRecord::StatementInvalid (PG::Error: ERROR: division by zero : SELECT _, ((SELECT COUNT(1) FROM issues where project_id in (1) and status_id = issue_statuses.id) / (SELECT COUNT(1) FROM issues where project_id in (1)))_100 as percent, (SELECT COUNT(1) FROM issues where project_id in (1) and status_id = issue_statuses.id) AS totalissues FROM issue_statuses;): activerecord (3.2.9) lib/active_record/connection_adapters/postgresql_adapter.rb:1153:in async_exec' activerecord (3.2.9) lib/active_record/connection_adapters/postgresql_adapter.rb:1153:inexec_no_cache' activerecord (3.2.9) lib/active_record/connection_adapters/postgresql_adapter.rb:662:in block in exec_query' activerecord (3.2.9) lib/active_record/connection_adapters/abstract_adapter.rb:280:inblock in log' activesupport (3.2.9) lib/active_support/notifications/instrumenter.rb:20:in instrument' activerecord (3.2.9) lib/active_record/connection_adapters/abstract_adapter.rb:275:inlog' activerecord (3.2.9) lib/active_record/connection_adapters/postgresql_adapter.rb:661:in exec_query' activerecord (3.2.9) lib/active_record/connection_adapters/postgresql_adapter.rb:1248:inselect' activerecord (3.2.9) lib/active_record/connection_adapters/abstract/database_statements.rb:18:in select_all' activerecord (3.2.9) lib/active_record/connection_adapters/abstract/query_cache.rb:61:inblock in select_all' activerecord (3.2.9) lib/active_record/connection_adapters/abstract/query_cache.rb:75:in cache_sql' activerecord (3.2.9) lib/active_record/connection_adapters/abstract/query_cache.rb:61:inselect_all' activerecord (3.2.9) lib/active_record/querying.rb:38:in block in find_by_sql' activerecord (3.2.9) lib/active_record/explain.rb:40:inlogging_query_plan' activerecord (3.2.9) lib/active_record/querying.rb:37:in find_by_sql' plugins/redmine_monitoring_controlling/app/controllers/home_monitoring_controlling_project_controller.rb:47:inindex' actionpack (3.2.9) lib/action_controller/metal/implicit_render.rb:4:in send_action' actionpack (3.2.9) lib/abstract_controller/base.rb:167:inprocess_action' actionpack (3.2.9) lib/action_controller/metal/rendering.rb:10:in process_action' actionpack (3.2.9) lib/abstract_controller/callbacks.rb:18:inblock in process_action' activesupport (3.2.9) lib/active_support/callbacks.rb:480:in _run__854542849775518398__process_action__821197791585288032__callbacks' activesupport (3.2.9) lib/active_support/callbacks.rb:405:inrun_callback' activesupport (3.2.9) lib/active_support/callbacks.rb:385:in _run_process_action_callbacks' activesupport (3.2.9) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (3.2.9) lib/abstract_controller/callbacks.rb:17:in process_action' actionpack (3.2.9) lib/action_controller/metal/rescue.rb:29:inprocess_action' actionpack (3.2.9) lib/action_controller/metal/instrumentation.rb:30:in block in process_action' activesupport (3.2.9) lib/active_support/notifications.rb:123:inblock in instrument' activesupport (3.2.9) lib/active_support/notifications/instrumenter.rb:20:in instrument' activesupport (3.2.9) lib/active_support/notifications.rb:123:ininstrument' actionpack (3.2.9) lib/action_controller/metal/instrumentation.rb:29:in process_action' actionpack (3.2.9) lib/action_controller/metal/params_wrapper.rb:207:inprocess_action' activerecord (3.2.9) lib/active_record/railties/controller_runtime.rb:18:in process_action' actionpack (3.2.9) lib/abstract_controller/base.rb:121:inprocess' actionpack (3.2.9) lib/abstract_controller/rendering.rb:45:in process' actionpack (3.2.9) lib/action_controller/metal.rb:203:indispatch' actionpack (3.2.9) lib/action_controller/metal/rack_delegation.rb:14:in dispatch' actionpack (3.2.9) lib/action_controller/metal.rb:246:inblock in action' actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:73:in call' actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:73:indispatch' actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:36:in call' journey (1.0.4) lib/journey/router.rb:68:inblock in call' journey (1.0.4) lib/journey/router.rb:56:in each' journey (1.0.4) lib/journey/router.rb:56:incall' actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:601:in call' rack-openid (1.3.1) lib/rack/openid.rb:98:incall' actionpack (3.2.9) lib/action_dispatch/middleware/best_standards_support.rb:17:in call' rack (1.4.1) lib/rack/etag.rb:23:incall' rack (1.4.1) lib/rack/conditionalget.rb:25:in call' actionpack (3.2.9) lib/action_dispatch/middleware/head.rb:14:incall' actionpack (3.2.9) lib/action_dispatch/middleware/params_parser.rb:21:in call' actionpack (3.2.9) lib/action_dispatch/middleware/flash.rb:242:incall' rack (1.4.1) lib/rack/session/abstract/id.rb:205:in context' rack (1.4.1) lib/rack/session/abstract/id.rb:200:incall' actionpack (3.2.9) lib/action_dispatch/middleware/cookies.rb:341:in call' activerecord (3.2.9) lib/active_record/query_cache.rb:64:incall' activerecord (3.2.9) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in call' actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:28:inblock in call' activesupport (3.2.9) lib/active_support/callbacks.rb:405:in _run__1283065372942731631__call__3833842449810096564__callbacks' activesupport (3.2.9) lib/active_support/callbacks.rb:405:inrun_callback' activesupport (3.2.9) lib/active_support/callbacks.rb:385:in _run_call_callbacks' activesupport (3.2.9) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:27:in call' actionpack (3.2.9) lib/action_dispatch/middleware/remote_ip.rb:31:incall' actionpack (3.2.9) lib/action_dispatch/middleware/debug_exceptions.rb:16:in call' actionpack (3.2.9) lib/action_dispatch/middleware/show_exceptions.rb:56:incall' railties (3.2.9) lib/rails/rack/logger.rb:32:in call_app' railties (3.2.9) lib/rails/rack/logger.rb:16:inblock in call' activesupport (3.2.9) lib/active_support/tagged_logging.rb:22:in tagged' railties (3.2.9) lib/rails/rack/logger.rb:16:incall' actionpack (3.2.9) lib/action_dispatch/middleware/request_id.rb:22:in call' rack (1.4.1) lib/rack/methodoverride.rb:21:incall' rack (1.4.1) lib/rack/runtime.rb:17:in call' activesupport (3.2.9) lib/active_support/cache/strategy/local_cache.rb:72:incall' rack (1.4.1) lib/rack/lock.rb:15:in call' actionpack (3.2.9) lib/action_dispatch/middleware/static.rb:62:incall' rack-cache (1.2) lib/rack/cache/context.rb:136:in forward' rack-cache (1.2) lib/rack/cache/context.rb:245:infetch' rack-cache (1.2) lib/rack/cache/context.rb:185:in lookup' rack-cache (1.2) lib/rack/cache/context.rb:66:incall!' rack-cache (1.2) lib/rack/cache/context.rb:51:in call' railties (3.2.9) lib/rails/engine.rb:479:incall' railties (3.2.9) lib/rails/application.rb:223:in call' railties (3.2.9) lib/rails/railtie/configurable.rb:30:inmethod_missing' passenger (3.0.18) lib/phusion_passenger/rack/request_handler.rb:96:in process_request' passenger (3.0.18) lib/phusion_passenger/abstract_request_handler.rb:516:inaccept_and_process_next_request' passenger (3.0.18) lib/phusion_passenger/abstract_request_handler.rb:274:in main_loop' passenger (3.0.18) lib/phusion_passenger/rack/application_spawner.rb:206:instart_request_handler' passenger (3.0.18) lib/phusion_passenger/rack/application_spawner.rb:171:in block in handle_spawn_application' passenger (3.0.18) lib/phusion_passenger/utils.rb:470:insafe_fork' passenger (3.0.18) lib/phusion_passenger/rack/application_spawner.rb:166:in handle_spawn_application' passenger (3.0.18) lib/phusion_passenger/abstract_server.rb:357:inserver_main_loop' passenger (3.0.18) lib/phusion_passenger/abstract_server.rb:206:in start_synchronously' passenger (3.0.18) lib/phusion_passenger/abstract_server.rb:180:instart' passenger (3.0.18) lib/phusion_passenger/rack/application_spawner.rb:129:in start' passenger (3.0.18) lib/phusion_passenger/spawn_manager.rb:253:inblock (2 levels) in spawn_rack_application' passenger (3.0.18) lib/phusion_passenger/abstract_server_collection.rb:132:in lookup_or_add' passenger (3.0.18) lib/phusion_passenger/spawn_manager.rb:246:inblock in spawn_rack_application' passenger (3.0.18) lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'

:10:in`synchronize' passenger (3.0.18) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize' passenger (3.0.18) lib/phusion_passenger/spawn_manager.rb:244:in`spawn_rack_application' passenger (3.0.18) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application' passenger (3.0.18) lib/phusion_passenger/spawn_manager.rb:275:in`handle_spawn_application' passenger (3.0.18) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop' passenger (3.0.18) lib/phusion_passenger/abstract_server.rb:206:in`start_synchronously' passenger (3.0.18) helper-scripts/passenger-spawn-server:99:in `
' I have the latest version of redmine -> 2.1.4 ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux] Rails 3.2.9 Passenger version 3.0.18 Today I did update from (redmine 2.1.2, ruby 1.8; rails 3.2.8) On this environment I got this error too. Thanks for your help
alexmonteiro commented 11 years ago

This plugin just run at Ruby 1.8.7 version. Sooner will upgrade it to support ruby 1.9.x . Thanks for report.

lukexx commented 11 years ago

It was the same problem at Ruby 1.8.7, so I have done update.

alexmonteiro commented 11 years ago

Will check PG::Error: ERROR: division by zero.

lukexx commented 11 years ago

Hi, I migrated db from trac to redmine and when I clicking m&c it works. I am getting that log:

Started GET "/" for 192.168.79.207 at 2012-12-12 10:26:00 +0100 Processing by WelcomeController#index as HTML Current user: admin (id=1) Rendered welcome/index.html.erb within layouts/base (9.4ms) Rendered plugins/advanced_roadmap/app/views/hooks/_stylesheet.html.erb (0.5ms) Completed 200 OK in 35ms (Views: 22.5ms | ActiveRecord: 5.2ms) Started GET "/projects/esod" for 192.168.79.207 at 2012-12-12 10:26:03 +0100 Processing by ProjectsController#show as HTML Parameters: {"id"=>"esod"} Current user: admin (id=1) Rendered projects/_members_box.html.erb (31.1ms) Rendered plugins/advanced_roadmap/app/views/hooks/_milestones.html.erb (1.2ms) Rendered projects/show.html.erb within layouts/base (39.3ms) Rendered plugins/advanced_roadmap/app/views/hooks/_stylesheet.html.erb (0.4ms) Completed 200 OK in 293ms (Views: 59.3ms | ActiveRecord: 165.6ms) Started GET "/home_monitoring_controlling_project/index/esod" for 192.168.79.207 at 2012-12-12 10:26:06 +0100 Processing by HomeMonitoringControllingProjectController#index as HTML Parameters: {"id"=>"esod"} Current user: admin (id=1) Rendered plugins/redmine_monitoring_controlling/app/views/mc_menu/_contentHeader.html.erb (3.2ms) Rendered plugins/redmine_monitoring_controlling/app/views/home_monitoring_controlling_project/_index.html.erb (13.5ms) Rendered plugins/redmine_monitoring_controlling/app/views/mc_menu/_progressbar.html.erb (27.0ms) Rendered plugins/redmine_monitoring_controlling/app/views/mc_menu/_mcmenu.html.erb (30.7ms) Rendered plugins/redmine_monitoring_controlling/app/views/home_monitoring_controlling_project/index.html.erb within layouts/base (9616.0ms) Rendered plugins/advanced_roadmap/app/views/hooks/_stylesheet.html.erb (0.4ms) Completed 200 OK in 15180ms (Views: 9870.3ms | ActiveRecord: 1272.0ms)

But in new projects it's still the same error:

Started GET "/home_monitoring_controlling_project/index/test3" for 192.168.79.207 at 2012-12-12 10:23:27 +0100 Processing by HomeMonitoringControllingProjectController#index as HTML Parameters: {"id"=>"test3"} Current user: admin (id=1) Completed 500 Internal Server Error in 15ms

ActiveRecord::StatementInvalid (PG::Error: ERROR: division by zero : SELECT _, ((SELECT COUNT(1) FROM issues where project_id in (6) and status_id = issue_statuses.id) / (SELECT COUNT(1) FROM issues where project_id in (6)))_100 as percent, (SELECT COUNT(1) FROM issues where project_id in (6) and status_id = issue_statuses.id) AS totalissues FROM issue_statuses;): activerecord (3.2.9) lib/active_record/connection_adapters/postgresql_adapter.rb:1153:in async_exec' activerecord (3.2.9) lib/active_record/connection_adapters/postgresql_adapter.rb:1153:inexec_no_cache' activerecord (3.2.9) lib/active_record/connection_adapters/postgresql_adapter.rb:662:in block in exec_query' activerecord (3.2.9) lib/active_record/connection_adapters/abstract_adapter.rb:280:inblock in log' activesupport (3.2.9) lib/active_support/notifications/instrumenter.rb:20:in instrument' activerecord (3.2.9) lib/active_record/connection_adapters/abstract_adapter.rb:275:inlog' activerecord (3.2.9) lib/active_record/connection_adapters/postgresql_adapter.rb:661:in exec_query' activerecord (3.2.9) lib/active_record/connection_adapters/postgresql_adapter.rb:1248:inselect' activerecord (3.2.9) lib/active_record/connection_adapters/abstract/database_statements.rb:18:in select_all' activerecord (3.2.9) lib/active_record/connection_adapters/abstract/query_cache.rb:61:inblock in select_all' activerecord (3.2.9) lib/active_record/connection_adapters/abstract/query_cache.rb:75:in cache_sql' activerecord (3.2.9) lib/active_record/connection_adapters/abstract/query_cache.rb:61:inselect_all' activerecord (3.2.9) lib/active_record/querying.rb:38:in block in find_by_sql' activerecord (3.2.9) lib/active_record/explain.rb:40:inlogging_query_plan' activerecord (3.2.9) lib/active_record/querying.rb:37:in find_by_sql' plugins/redmine_monitoring_controlling/app/controllers/home_monitoring_controlling_project_controller.rb:47:inindex' actionpack (3.2.9) lib/action_controller/metal/implicit_render.rb:4:in send_action' actionpack (3.2.9) lib/abstract_controller/base.rb:167:inprocess_action' actionpack (3.2.9) lib/action_controller/metal/rendering.rb:10:in process_action' actionpack (3.2.9) lib/abstract_controller/callbacks.rb:18:inblock in process_action' activesupport (3.2.9) lib/active_support/callbacks.rb:480:in _run__1036904996729553601__process_action__3684522941706520238__callbacks' activesupport (3.2.9) lib/active_support/callbacks.rb:405:inrun_callback' activesupport (3.2.9) lib/active_support/callbacks.rb:385:in _run_process_action_callbacks' activesupport (3.2.9) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (3.2.9) lib/abstract_controller/callbacks.rb:17:in process_action' actionpack (3.2.9) lib/action_controller/metal/rescue.rb:29:inprocess_action' actionpack (3.2.9) lib/action_controller/metal/instrumentation.rb:30:in block in process_action' activesupport (3.2.9) lib/active_support/notifications.rb:123:inblock in instrument' activesupport (3.2.9) lib/active_support/notifications/instrumenter.rb:20:in instrument' activesupport (3.2.9) lib/active_support/notifications.rb:123:ininstrument' actionpack (3.2.9) lib/action_controller/metal/instrumentation.rb:29:in process_action' actionpack (3.2.9) lib/action_controller/metal/params_wrapper.rb:207:inprocess_action' activerecord (3.2.9) lib/active_record/railties/controller_runtime.rb:18:in process_action' actionpack (3.2.9) lib/abstract_controller/base.rb:121:inprocess' actionpack (3.2.9) lib/abstract_controller/rendering.rb:45:in process' actionpack (3.2.9) lib/action_controller/metal.rb:203:indispatch' actionpack (3.2.9) lib/action_controller/metal/rack_delegation.rb:14:in dispatch' actionpack (3.2.9) lib/action_controller/metal.rb:246:inblock in action' actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:73:in call' actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:73:indispatch' actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:36:in call' journey (1.0.4) lib/journey/router.rb:68:inblock in call' journey (1.0.4) lib/journey/router.rb:56:in each' journey (1.0.4) lib/journey/router.rb:56:incall' actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:601:in call' rack-openid (1.3.1) lib/rack/openid.rb:98:incall' actionpack (3.2.9) lib/action_dispatch/middleware/best_standards_support.rb:17:in call' rack (1.4.1) lib/rack/etag.rb:23:incall' rack (1.4.1) lib/rack/conditionalget.rb:25:in call' actionpack (3.2.9) lib/action_dispatch/middleware/head.rb:14:incall' actionpack (3.2.9) lib/action_dispatch/middleware/params_parser.rb:21:in call' actionpack (3.2.9) lib/action_dispatch/middleware/flash.rb:242:incall' rack (1.4.1) lib/rack/session/abstract/id.rb:205:in context' rack (1.4.1) lib/rack/session/abstract/id.rb:200:incall' actionpack (3.2.9) lib/action_dispatch/middleware/cookies.rb:341:in call' activerecord (3.2.9) lib/active_record/query_cache.rb:64:incall' activerecord (3.2.9) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in call' actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:28:inblock in call' activesupport (3.2.9) lib/active_support/callbacks.rb:405:in _run__1918253025424596615__call__100589422576041574__callbacks' activesupport (3.2.9) lib/active_support/callbacks.rb:405:inrun_callback' activesupport (3.2.9) lib/active_support/callbacks.rb:385:in _run_call_callbacks' activesupport (3.2.9) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:27:in call' actionpack (3.2.9) lib/action_dispatch/middleware/remote_ip.rb:31:incall' actionpack (3.2.9) lib/action_dispatch/middleware/debug_exceptions.rb:16:in call' actionpack (3.2.9) lib/action_dispatch/middleware/show_exceptions.rb:56:incall' railties (3.2.9) lib/rails/rack/logger.rb:32:in call_app' railties (3.2.9) lib/rails/rack/logger.rb:16:inblock in call' activesupport (3.2.9) lib/active_support/tagged_logging.rb:22:in tagged' railties (3.2.9) lib/rails/rack/logger.rb:16:incall' actionpack (3.2.9) lib/action_dispatch/middleware/request_id.rb:22:in call' rack (1.4.1) lib/rack/methodoverride.rb:21:incall' rack (1.4.1) lib/rack/runtime.rb:17:in call' activesupport (3.2.9) lib/active_support/cache/strategy/local_cache.rb:72:incall' rack (1.4.1) lib/rack/lock.rb:15:in call' actionpack (3.2.9) lib/action_dispatch/middleware/static.rb:62:incall' rack-cache (1.2) lib/rack/cache/context.rb:136:in forward' rack-cache (1.2) lib/rack/cache/context.rb:245:infetch' rack-cache (1.2) lib/rack/cache/context.rb:185:in lookup' rack-cache (1.2) lib/rack/cache/context.rb:66:incall!' rack-cache (1.2) lib/rack/cache/context.rb:51:in call' railties (3.2.9) lib/rails/engine.rb:479:incall' railties (3.2.9) lib/rails/application.rb:223:in call' railties (3.2.9) lib/rails/railtie/configurable.rb:30:inmethod_missing' passenger (3.0.18) lib/phusion_passenger/rack/request_handler.rb:96:in process_request' passenger (3.0.18) lib/phusion_passenger/abstract_request_handler.rb:516:inaccept_and_process_next_request' passenger (3.0.18) lib/phusion_passenger/abstract_request_handler.rb:274:in main_loop' passenger (3.0.18) lib/phusion_passenger/rack/application_spawner.rb:206:instart_request_handler' passenger (3.0.18) lib/phusion_passenger/rack/application_spawner.rb:171:in block in handle_spawn_application' passenger (3.0.18) lib/phusion_passenger/utils.rb:470:insafe_fork' passenger (3.0.18) lib/phusion_passenger/rack/application_spawner.rb:166:in handle_spawn_application' passenger (3.0.18) lib/phusion_passenger/abstract_server.rb:357:inserver_main_loop' passenger (3.0.18) lib/phusion_passenger/abstract_server.rb:206:in start_synchronously' passenger (3.0.18) lib/phusion_passenger/abstract_server.rb:180:instart' passenger (3.0.18) lib/phusion_passenger/rack/application_spawner.rb:129:in start' passenger (3.0.18) lib/phusion_passenger/spawn_manager.rb:253:inblock (2 levels) in spawn_rack_application' passenger (3.0.18) lib/phusion_passenger/abstract_server_collection.rb:132:in lookup_or_add' passenger (3.0.18) lib/phusion_passenger/spawn_manager.rb:246:inblock in spawn_rack_application' passenger (3.0.18) lib/phusion_passenger/abstract_server_collection.rb:82:in `block in synchronize'

:10:in`synchronize' passenger (3.0.18) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize' passenger (3.0.18) lib/phusion_passenger/spawn_manager.rb:244:in`spawn_rack_application' passenger (3.0.18) lib/phusion_passenger/spawn_manager.rb:137:in `spawn_application' passenger (3.0.18) lib/phusion_passenger/spawn_manager.rb:275:in`handle_spawn_application' passenger (3.0.18) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop' passenger (3.0.18) lib/phusion_passenger/abstract_server.rb:206:in`start_synchronously' passenger (3.0.18) helper-scripts/passenger-spawn-server:99:in `
'
alexmonteiro commented 11 years ago

Hi @lukexx, I got the error. The projects with no issues return the database error division by zero on postgres. I didnt get it before because Im developing on mysql and this kind of error the sgbd ignores and return null.

I fixed the problem put a verifying param before generate the charts. Check it out on commit 66791b24cb.

lukexx commented 11 years ago

OK, thank you very much for resolve my problem. Have a nice day :)