Closed cforce closed 11 years ago
I think my versipon don't have start and end date set of version, what indded isn't a mandory field. So please check if date filed is set <>nil before using with array access
proj_or_vers_data[0], proj_or_vers_data[1]
Thanks for the reporting.
We should use the current date when any of the dates is missing, but I guess there is a bug.
We'll take care of it and submit a patch today. Thanks.
Hi, Date constrains aren't in fact mandatory. I've tried to reproduced your error using the most recent setup (tested redmine 2.2.0, 2.1.5, 2.1.4; ruby MRI 1.9.3; rails 3.2.9; ) fresh instalation, with default redmine data loaded into redmine db (mysql). Created a project (only mandatory fields) and an empty version. No issues where created. EVM module activated. It runned fine. From what i've seen from the log you putted here, it seems there's a variable with nil set in an array of dates used to determine which is the most probable end date. That shouldn't be happening. When sources are nil or empty that date should be replaced with current date.
@JoaoCostaImag, this seems to be a compatibility issue with jRuby. Please try in this environment to see if we can reproduce the error.
I use jruby 1.7
I tried on redmine 2.2 and ruby 1.9.3 - Same error
It's not jruby problem!
Any schedule - wix wont't fix?
Hi @cforce,
Thanks for the input.
We didn't fix this yet because we were unable to reproduce the bug.
Is there any additional information that you can provide to reproduce it? Any specific details about the configuration of the project that is throwing this? If you have it in a database with dummy non classified data, can we have access to a dump?
I'm going to personally verify this one again today at EOD.
Thanks.
@cforce, I teste this again and was unable to reproduce. Do you have a simple proof of concept on how to reproduce it?
I tjink line 15 will raise nil error, because the method retrive_data(my_version) retrun nil.
Check retrive_data() on any unset vars ur var=nil. Maybe an not required value.
Hi Terence,
Thanks for the report. That code suffered severe changes on the since this ticket was reported.
Can you do a quick try with master, just to make sure it's still happening. If so, please past the exception and I'll take it from there.
Thanks.
ok the bug is now mich better debugable: Did you test with version and/or issue start/end dates not set? As i said none of them is required! Does the [..]-max method can handle "nil" values?
see message:
ArgumentError (comparison of NilClass with Date failed):
plugins/redmine_evm/lib/indicators_logic.rb:31:in each' plugins/redmine_evm/lib/indicators_logic.rb:31:in
max'
plugins/redmine_evm/lib/indicators_logic.rb:31:in calc_indicators' plugins/redmine_evm/app/controllers/ratios_controller.rb:42:in
evm'
plugins/redmine_evm/app/controllers/ratios_controller.rb:17:in block (3 levels) in index' activerecord (3.2.11) lib/active_record/relation/delegation.rb:6:in
each'
activerecord (3.2.11) lib/active_record/relation/delegation.rb:6:in each' plugins/redmine_evm/app/controllers/ratios_controller.rb:15:in
block (2 levels) in index'
actionpack (3.2.11) lib/action_controller/metal/mime_responds.rb:196:in call' actionpack (3.2.11) lib/action_controller/metal/mime_responds.rb:196:in
respond_to'
plugins/redmine_evm/app/controllers/ratios_controller.rb:10:in index' actionpack (3.2.11) lib/action_controller/metal/implicit_render.rb:4:in
send_action'
actionpack (3.2.11) lib/abstract_controller/base.rb:167:in process_action' actionpack (3.2.11) lib/action_controller/metal/rendering.rb:10:in
process_action'
actionpack (3.2.11) lib/abstract_controller/callbacks.rb:18:in block in process_action' activesupport (3.2.11) lib/active_support/callbacks.rb:469:in
_run150202187process_action164777186callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in __run_callback' activesupport (3.2.11) lib/active_support/callbacks.rb:385:in
_run_process_action_callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
i did some debugging and the value which is nil is "check_ary_all_issues"
Her my debug code
def self.calc_indicators(my_project_or_version, ary_reported_time_week_year, ary_all_issues)
puts 'ary_all_issues:' + ary_all_issues.to_s
output is:
ary_all_issues:[#<Issue id: 4254, tracker_id: 2, project_id: 21, subject: "Potenzialreport - Einrichtung von freien Vergleichs...", description: "Von diversen der Wuns...", due_date: nil, category_id: 92, status_id: 13, assigned_to_id: 147, priority_id: 4, fixed_version_id: 287, author_id: 11, lock_version: 18, created_on: "2011-08-16 08:56:14", updated_on: "2013-01-10 10:24:06", start_date: nil, done_ratio: 10, estimated_hours: 24.0, parent_id: nil, root_id: 4254, lft: 1, rgt: 2, votes_value: 0, is_private: false, bet_votes: 0, author_name: nil, author_mail: nil, customer_id: nil, customer_type: nil, s2b_position: 358, milestone_id: nil>]
Ok, found it!
Time.now.to_date :ary_all_issues.maximum(:start_date) must be checked for nil before conversion.
Please fix soon.
You shall check invarinat if any of the variables check_end_date,check_ary_reported_time_week_year, check_ary_all_issues is set. If none is set what is mx of 3 times nil? Then the whole indicator calc is worthless.
Close
Yo you check againats non mandatory fields are set like start and ed date .. etc.? Do you use constant as status names, isn't this localized?
Started GET "/projects/myproject/ratios/index" for 172.25.252.99 at 2012-12-19 15:00:06 +0100 Processing by RatiosController#index as HTML Parameters: {"id"=>"myproject"} Current user: 00001276 (id=3) Rendered plugins/redmine_evm/app/views/ratios/_head_js.html.erb (2.0ms) Rendered plugins/redmine_evm/app/views/ratios/_bottom_js.html.erb (27.0ms) Rendered plugins/redmine_evm/app/views/ratios/_head_js.html.erb (0.0ms) Rendered plugins/redmine_evm/app/views/ratios/_bottom_js.html.erb (4.0ms) Rendered plugins/redmine_evm/app/views/ratios/_head_js.html.erb (0.0ms) Rendered plugins/redmine_evm/app/views/ratios/index.html.erb within layouts/base (117.0ms) Completed 500 Internal Server Error in 32084ms
ActionView::Template::Error (comparison of NilClass with Date failed): 13: <% @project.versions.where(:status=>"open").each do |my_version|%> 14: <%= render "ratios/head_js" %> 15: <% proj_or_vers_data=IndicatorsLogic::retrive_data(my_version) %> 16: <% @proj_or_vers_indicators=IndicatorsLogic::calc_indicators(my_version, proj_or_vers_data[0], proj_or_vers_data[1]) %> 17: <%= render :partial=>"ratios/bottom_js", :locals=>{:name=>my_version.name}%> 18: <% end %> 19: org/jruby/RubyArray.java:1612:in
each' org/jruby/RubyEnumerable.java:1032:in
max' plugins/redmine_evm/lib/indicators_logic.rb:26:incalc_indicators' plugins/redmine_evm/app/views/ratios/index.html.erb:16:in
_plugins_redmine_evm_app_views_ratios_index_html_erb1286730508_1081284' org/jruby/RubyArray.java:1612:ineach' org/jruby/RubyBasicObject.java:1667:in
send' activerecord (3.2.8) lib/active_record/relation/delegation.rb:6:ineach' plugins/redmine_evm/app/views/ratios/index.html.erb:13:in
_plugins_redmine_evm_app_views_ratios_index_html_erb1286730508_1081284' org/jruby/RubyBasicObject.java:1679:in__send__' org/jruby/RubyKernel.java:2085:in
send' actionpack (3.2.8) lib/action_view/template.rb:145:inrender' activesupport (3.2.8) lib/active_support/notifications.rb:125:in
instrument' actionpack (3.2.8) lib/action_view/template.rb:143:inrender' actionpack (3.2.8) lib/action_view/renderer/template_renderer.rb:47:in
render_template' actionpack (3.2.8) lib/action_view/renderer/abstract_renderer.rb:38:ininstrument' activesupport (3.2.8) lib/active_support/notifications.rb:123:in
instrument' activesupport (3.2.8) lib/active_support/notifications/instrumenter.rb:20:ininstrument' activesupport (3.2.8) lib/active_support/notifications/instrumenter.rb:19:in
instrument' activesupport (3.2.8) lib/active_support/notifications.rb:123:ininstrument' actionpack (3.2.8) lib/action_view/renderer/abstract_renderer.rb:38:in
instrument' actionpack (3.2.8) lib/action_view/renderer/template_renderer.rb:46:inrender_template' actionpack (3.2.8) lib/action_view/renderer/template_renderer.rb:54:in
render_with_layout' actionpack (3.2.8) lib/action_view/renderer/template_renderer.rb:45:inrender_template' render_parent (0.0.5) lib/render_parent/rails3/on_load_action_view.rb:58:in
render_template_with_active_template' actionpack (3.2.8) lib/action_view/renderer/template_renderer.rb:18:inrender' actionpack (3.2.8) lib/action_view/renderer/renderer.rb:36:in
render_template' actionpack (3.2.8) lib/action_view/renderer/renderer.rb:17:inrender' actionpack (3.2.8) lib/abstract_controller/rendering.rb:110:in
_render_template' actionpack (3.2.8) lib/action_controller/metal/streaming.rb:225:in_render_template' actionpack (3.2.8) lib/abstract_controller/rendering.rb:103:in
render_to_body' actionpack (3.2.8) lib/action_controller/metal/renderers.rb:28:inrender_to_body' actionpack (3.2.8) lib/action_controller/metal/compatibility.rb:50:in
render_to_body' actionpack (3.2.8) lib/abstract_controller/rendering.rb:88:inrender' actionpack (3.2.8) lib/action_controller/metal/rendering.rb:16:in
render' actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:40:inrender' activesupport (3.2.8) lib/active_support/core_ext/benchmark.rb:5:in
ms' /home/sidfunktion/.rvm/rubies/jruby-1.7.0/lib/ruby/1.9/benchmark.rb:295:inrealtime' activesupport (3.2.8) lib/active_support/core_ext/benchmark.rb:5:in
ms' actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:40:inrender' actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:83:in
cleanup_view_runtime' activerecord (3.2.8) lib/active_record/railties/controller_runtime.rb:24:incleanup_view_runtime' actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:39:in
render' actionpack (3.2.8) lib/action_controller/metal/implicit_render.rb:10:indefault_render' actionpack (3.2.8) lib/action_controller/metal/implicit_render.rb:5:in
send_action' actionpack (3.2.8) lib/abstract_controller/base.rb:167:inprocess_action' actionpack (3.2.8) lib/action_controller/metal/rendering.rb:10:in
process_action' actionpack (3.2.8) lib/abstract_controller/callbacks.rb:18:inprocess_action' activesupport (3.2.8) lib/active_support/callbacks.rb:472:in
_run1901888727process_action1155311442callbacks' org/jruby/RubyBasicObject.java:1667:in__send__' org/jruby/RubyKernel.java:2077:in
send' activesupport (3.2.8) lib/active_support/callbacks.rb:405:in**run_callback' activesupport (3.2.8) lib/active_support/callbacks.rb:390:in
_run_process_action_callbacks' org/jruby/RubyBasicObject.java:1673:in__send**' org/jruby/RubyKernel.java:2081:in
send' activesupport (3.2.8) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (3.2.8) lib/abstract_controller/callbacks.rb:17:in
process_action' actionpack (3.2.8) lib/action_controller/metal/rescue.rb:29:inprocess_action' actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:30:in
process_action' activesupport (3.2.8) lib/active_support/notifications.rb:123:ininstrument' activesupport (3.2.8) lib/active_support/notifications/instrumenter.rb:20:in
instrument' activesupport (3.2.8) lib/active_support/notifications/instrumenter.rb:19:ininstrument' activesupport (3.2.8) lib/active_support/notifications.rb:123:in
instrument' actionpack (3.2.8) lib/action_controller/metal/instrumentation.rb:29:inprocess_action' actionpack (3.2.8) lib/action_controller/metal/params_wrapper.rb:207:in
process_action' activerecord (3.2.8) lib/active_record/railties/controller_runtime.rb:18:inprocess_action' actionpack (3.2.8) lib/abstract_controller/base.rb:121:in
process' actionpack (3.2.8) lib/abstract_controller/rendering.rb:45:inprocess' actionpack (3.2.8) lib/action_controller/metal.rb:203:in
dispatch' actionpack (3.2.8) lib/action_controller/metal/rack_delegation.rb:14:indispatch' actionpack (3.2.8) lib/action_controller/metal.rb:246:in
action' org/jruby/RubyProc.java:249:incall' actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:73:in
dispatch' actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:36:incall' journey (1.0.4) lib/journey/router.rb:68:in
call' org/jruby/RubyArray.java:1612:ineach' journey (1.0.4) lib/journey/router.rb:56:in
call' actionpack (3.2.8) lib/action_dispatch/routing/route_set.rb:600:incall' rack-openid (1.3.1) lib/rack/openid.rb:98:in
call' actionpack (3.2.8) lib/action_dispatch/middleware/best_standards_support.rb:17:incall' rack (1.4.1) lib/rack/etag.rb:23:in
call' rack (1.4.1) lib/rack/conditionalget.rb:25:incall' actionpack (3.2.8) lib/action_dispatch/middleware/head.rb:14:in
call' actionpack (3.2.8) lib/action_dispatch/middleware/params_parser.rb:21:incall' plugins/redmine_dmsf/lib/redmine_dmsf/webdav/no_parse.rb:33:in
call' actionpack (3.2.8) 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.8) lib/action_dispatch/middleware/cookies.rb:339:in
call' activerecord (3.2.8) lib/active_record/query_cache.rb:64:incall' activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in
call' actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:28:incall' activesupport (3.2.8) lib/active_support/callbacks.rb:408:in
_run2115711987call13889929callbacks' org/jruby/RubyBasicObject.java:1667:in**send**' org/jruby/RubyKernel.java:2077:in
send' activesupport (3.2.8) lib/active_support/callbacks.rb:405:in**run_callback' activesupport (3.2.8) lib/active_support/callbacks.rb:390:in
_run_call_callbacks' org/jruby/RubyBasicObject.java:1667:in__send**' org/jruby/RubyKernel.java:2077:in
send' activesupport (3.2.8) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in
call' actionpack (3.2.8) lib/action_dispatch/middleware/remote_ip.rb:31:incall' actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:16:in
call' actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:incall' railties (3.2.8) lib/rails/rack/logger.rb:26:in
call_app' railties (3.2.8) lib/rails/rack/logger.rb:16:incall' actionpack (3.2.8) 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.8) lib/active_support/cache/strategy/local_cache.rb:72:incall' rack (1.4.1) lib/rack/lock.rb:15:in
call' actionpack (3.2.8) 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.8) lib/rails/engine.rb:479:incall' railties (3.2.8) lib/rails/application.rb:223:in
call' rack (1.4.1) lib/rack/content_length.rb:14:incall' railties (3.2.8) lib/rails/rack/log_tailer.rb:17:in
call' rack (1.4.1) lib/rack/handler/webrick.rb:59:inservice' /home/sidfunktion/.rvm/rubies/jruby-1.7.0/lib/ruby/1.9/webrick/httpserver.rb:138:in
service' /home/sidfunktion/.rvm/rubies/jruby-1.7.0/lib/ruby/1.9/webrick/httpserver.rb:94:inrun' /home/sidfunktion/.rvm/rubies/jruby-1.7.0/lib/ruby/1.9/webrick/server.rb:191:in
start_thread'