Problem with redmine-charts plugin (with trunk)

Added by Stefan Verstege over 8 years ago

When i want to look at the charts/burndown graph i see the following error in the log:

ActiveRecord::StatementInvalid (Mysql::Error: Every derived table must have its own alias: select sum(journal_details.value*issues.estimated_hours)/sum(issues.estimated_hours) as ratio_done from (select max(journal_details.id) as journal_details_id, journals.journalized_id as issue_id from issues left join journals on journals.journalized_id = issues.id and journals.journalized_type ='Issue' left join journal_details on journals.id = journal_details.journal_id and journal_details.prop_key = 'done_ratio' where issues.project_id in (7) and (journals.id is null or journals.created_on <= '2009-03-07 23:59:59') group by issues.id) left join issues on issues.id = issue_id left join journal_details on journal_details.id = journal_details_id):

All other charts are working fine!

Using the trunk from the plugin and the trunk from redmine.

Can anyone help me out here?

Thnx

Replies (30)

RE: Problem with redmine-charts plugin (with trunk) - Added by Mischa The Evil over 8 years ago

I came across this issue also while doing a sort of plugin round-up. I've reported it by opening an issue on it's GitHub.

Regards,

Mischa.

RE: Problem with redmine-charts plugin (with trunk) - Added by Nanda P over 8 years ago

I am getting the same error "Mysql::Error: Every derived table must have its own alias:" with trunk

RE: Problem with redmine-charts plugin (with trunk) - Added by Nanda P over 8 years ago

Open Flash Chart
IO ERROR
Loading test data
Error #2032
This is the URL that I tried to open:/projects/it/charts/burndown/data?range_in=weeks&range_offset=1&range_steps=10

this is only with Burndown all other charts working fine.

RE: Problem with redmine-charts plugin (with trunk) - Added by Marshall Wu over 8 years ago

I add an alias phrase "as issues2" after "journals.created_on <= ?) group by issues.id)" in line 59 of app/controller/charts_burndown_controller.rb
The problem went away though I don't know whether I was correct

RE: Problem with redmine-charts plugin (with trunk) - Added by Nanda P over 8 years ago

Adding the alias phrase "issues2" fixed the issue for me as well.!! :)

I noticed you updated the issue on GitHub as well

Thanks a lot Marshall.

RE: Problem with redmine-charts plugin (with trunk) - Added by Mischa The Evil over 8 years ago

To whom it may concern: The author of the plugin has just released version 0.0.12 of the plugin which includes a fix for the here dicussed issue.

Kind regards,

Mischa.

RE: Problem with redmine-charts plugin (with trunk) - Added by Nanda P over 8 years ago

Burndown chart is working fine now, But I am getting the following error with "Logged hours deviations" chart.

Open Flash Chart
IO ERROR
Loading test data
Error # 2032

Log details :

A FloatDomainError occurred in charts#data:

  Infinity
  C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/float/rounding.rb

RE: Problem with redmine-charts plugin (with trunk) - Added by Mischa The Evil over 8 years ago

Nanda Palaniswamy wrote:

Burndown chart is working fine now, But I am getting the following error with "Logged hours deviations" chart.

[...]

Log details :

[...]

I am not able to reproduce that problem currently, but that might be due to my test-environment. I'd suggest to open a new issue to the tracker over at GitHub including the entire stack-trace and all other logs, details etc.

Btw: I did the same for an error I have experience with the new release (and also in the "Logged hours deviations" chart): http://github.com/mszczytowski/redmine_charts/issues#issue/13

Regards,

Mischa.

RE: Problem with redmine-charts plugin (with trunk) - Added by Maciej Szczytowski over 8 years ago

Nanda Palaniswamy wrote:

Burndown chart is working fine now, But I am getting the following error with "Logged hours deviations" chart.

Log details :

A FloatDomainError occurred in charts#data:

Infinity
C:/Program Files/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/float/rounding.rb

Can You send a full stacktrace? It looks like "division by zero", but I can't reproduce it and I don't know where exactly the divition took place.

Regards,
Maciek

RE: Problem with redmine-charts plugin (with trunk) - Added by Thomas Pihl over 8 years ago

FloatDomainError (Infinity):
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/float/rounding.rb:19:in `round_without_precision'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/float/rounding.rb:19:in `round'
/vendor/plugins/redmine_charts/lib/redmine_charts/utils.rb:35:in `round'
/vendor/plugins/redmine_charts/app/controllers/charts_deviation_controller.rb:242:in `get_remaining_hint'
/vendor/plugins/redmine_charts/app/controllers/charts_deviation_controller.rb:66:in `get_data'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1907:in `each_with_index'
/vendor/plugins/redmine_charts/app/controllers/charts_deviation_controller.rb:33:in `each'
/vendor/plugins/redmine_charts/app/controllers/charts_deviation_controller.rb:33:in `each_with_index'
/vendor/plugins/redmine_charts/app/controllers/charts_deviation_controller.rb:33:in `get_data'
/vendor/plugins/redmine_charts/app/controllers/charts_controller.rb:85:in `data'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:in `send'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:in `perform_action_without_filters'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:617:in `call_filters'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
C:/Tools/Ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/rescue.rb:136:in `perform_action_without_caching'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/query_cache.rb:8:in `cache'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in `send'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in `process_without_filters'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:606:in `process_without_session_management_support'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/session_management.rb:134:in `process'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:392:in `process'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:183:in `handle_request'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:110:in `dispatch_unlocked'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:123:in `dispatch'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:in `synchronize'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:in `dispatch'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:132:in `dispatch_cgi'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:39:in `dispatch'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:103:in `handle_dispatch'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:74:in `service'
C:/Tools/Ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
C:/Tools/Ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
C:/Tools/Ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
C:/Tools/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
C:/Tools/Ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
C:/Tools/Ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
C:/Tools/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
C:/Tools/Ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
C:/Tools/Ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
C:/Tools/Ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:60:in `dispatch'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/servers/webrick.rb:66
C:/Tools/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
C:/Tools/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
C:/Tools/Ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/server.rb:49
C:/Tools/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
C:/Tools/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/script/server:3

RE: Problem with redmine-charts plugin (with trunk) - Added by Nanda P about 8 years ago

Here is my Log details for this.

FloatDomainError occurred in charts#data:

Infinity
 c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/float/rounding.rb

-------------------------------
Backtrace:
-------------------------------

 FloatDomainError (Infinity):
    c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/float/rounding.rb:19:in `round_without_precision'
    c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/float/rounding.rb:19:in `round'
    /vendor/plugins/redmine_charts/lib/redmine_charts/utils.rb:35:in `round'
    /vendor/plugins/redmine_charts/app/controllers/charts_deviation_controller.rb:242:in `get_remaining_hint'
    /vendor/plugins/redmine_charts/app/controllers/charts_deviation_controller.rb:66:in `get_data'
    c:/ruby/lib/ruby/1.8/webrick/httpservlet/filehandler.rb:281:in `each_with_index'
    /vendor/plugins/redmine_charts/app/controllers/charts_deviation_controller.rb:33:in `each'
    /vendor/plugins/redmine_charts/app/controllers/charts_deviation_controller.rb:33:in `each_with_index'
    /vendor/plugins/redmine_charts/app/controllers/charts_deviation_controller.rb:33:in `get_data'
    /vendor/plugins/redmine_charts/app/controllers/charts_controller.rb:85:in `data'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:in `send'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:in `perform_action_without_filters'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:617:in `call_filters'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/rescue.rb:136:in `perform_action_without_caching'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/query_cache.rb:8:in `cache'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in `send'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in `process_without_filters'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:606:in `process_without_session_management_support'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/session_management.rb:134:in `process'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:392:in `process'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:183:in `handle_request'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:110:in `dispatch_unlocked'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:123:in `dispatch'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:in `synchronize'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:in `dispatch'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:132:in `dispatch_cgi'
    c:/ruby/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:39:in `dispatch'
    c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:103:in `handle_dispatch'
    c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:74:in `service'
    c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
    c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
    c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
    c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/webrick_server.rb:60:in `dispatch'
    c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/servers/webrick.rb:66
    c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
    c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
    c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
    c:/ruby/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/commands/server.rb:49
    c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    /script/server:3

Rendering C:/Program Files/redmine/current/public/500.html (500 Error)
rendering section "request" 
rendering section "session" 
rendering section "environment" 
rendering section "backtrace" 

RE: Problem with redmine-charts plugin (with trunk) - Added by pa riera about 8 years ago

Any news on this problem. I have the same error

RE: Problem with redmine-charts plugin (with trunk) - Added by Mischa The Evil about 8 years ago

Can anyone experiencing this problem test the "patch" provided in the plugins issue 15 at GitHub?

Kind regards,

Mischa.

RE: Problem with redmine-charts plugin (with trunk) - Added by Thomas Pihl about 8 years ago

Well, it will not dump anymore. Looks reasonable as well.

/T

RE: Problem with redmine-charts plugin (with trunk) - Added by Dave Land about 8 years ago

I installed the plugins and configurated in the project, and I could view the chart from the project menu, this is the default burndown chart. But I have no project_id in the url when I click any link in the chart pages, and got a 404 error. I do some hack in the "app/helpers/charts_helper.rb"

res << separator << link_to(link_name, :controller => controller_name)

changed to :

res << separator << link_to(link_name, :controller => controller_name, :project_id => @project)

So it is right in the chart menu, but I still got 404 error in other links. Anyone got this error, and how to fix it?

Dave Land

RE: Problem with redmine-charts plugin (with trunk) - Added by Dave Land about 8 years ago

Also, I have a Chinese version language file for this plugin.

zh.yml Magnifier (4.24 KB)

RE: Problem with redmine-charts plugin (with trunk) - Added by David Kruger about 8 years ago

Dave Land wrote:

I installed the plugins and configurated in the project, and I could view the chart from the project menu, this is the default burndown chart. But I have no project_id in the url when I click any link in the chart pages, and got a 404 error. I do some hack in the "app/helpers/charts_helper.rb"

res << separator << link_to(link_name, :controller => controller_name)

changed to :

res << separator << link_to(link_name, :controller => controller_name, :project_id => @project)

So it is right in the chart menu, but I still got 404 error in other links. Anyone got this error, and how to fix it?

Dave Land

This seemed to work for me with redmine 0.8.5 and version e9a3ba33dfc40878d07ede4ece5eeb211b7c8149 of redmine_charts. I am not a ruby programmer so I am not sure how correct this is.

diff --git a/app/controllers/charts_controller.rb b/app/controllers/charts_controller.rb
index 765b0a9..e13cb39 100644
--- a/app/controllers/charts_controller.rb
+++ b/app/controllers/charts_controller.rb
@@ -237,6 +237,7 @@ class ChartsController < ApplicationController
   # Finds current project or raises 404
   def find_project
     @project = Project.find(params[:project_id])
+    @project_id = params[:project_id]
   rescue ActiveRecord::RecordNotFound
     render_404
   end
diff --git a/app/helpers/charts_helper.rb b/app/helpers/charts_helper.rb
index df932d7..ff1119d 100644
--- a/app/helpers/charts_helper.rb
+++ b/app/helpers/charts_helper.rb
@@ -13,7 +13,7 @@ module ChartsHelper
       if controller.controller_name == controller_name
         res << separator << link_name
       else
-        res << separator << link_to(link_name, :controller => controller_name)
+        res << separator << link_to(link_name, :controller => controller_name, :project_id => @project)
       end
     end
     res
diff --git a/app/views/charts/index.rhtml b/app/views/charts/index.rhtml
index 4926fbf..c28b1c1 100644
--- a/app/views/charts/index.rhtml
+++ b/app/views/charts/index.rhtml
@@ -18,6 +18,7 @@

       <% form_tag '#', :method => :get do %>
         <%= hidden_field_tag :page, @page %>
+        <%= hidden_field_tag :project_id, @project_id %>

         <% if @show_conditions %>
           <% if @sub_project_condition %>
@@ -62,4 +63,4 @@
       </div>
     <% end %>

-</div>
\ No newline at end of file
+</div>

RE: Problem with redmine-charts plugin (with trunk) - Added by rafael mascayano about 8 years ago

Only Administrator users can see chart on each project in my redmine installation. Anyone knows why?

RE: Problem with redmine-charts plugin (with trunk) - Added by Thomas Pihl about 8 years ago

There is a new permission you need to give to the right roles!

/T

RE: Problem with redmine-charts plugin (with trunk) - Added by Nanda P about 8 years ago

David,

After applying the patch (Manually), 404 error is gone. but I am getting this "« Earlier - Later »" adding up every time I click "show" or reload the page..

Regards,
Nanda

1 2 (1-25/30)