backlogs / redmine_backlogs

A Redmine plugin for agile teams
https://backlogs.github.io/www/
GNU General Public License v2.0
773 stars 460 forks source link

got 500 error when i click 'sprints' menu #1147

Open namjae opened 6 years ago

namjae commented 6 years ago

hi, i'm using @TheMagician1 's fork with redmine 3.4.2.stable.

got following error when i click 'sprints' menu

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.

Back

log/production.log:

Started GET "/rb/sprints/infra" for 211.63.148.155 at 2017-08-21 03:06:12 +0900
Processing by RbSprintsRoadmapController#index as HTML
  Parameters: {"project_id"=>"infra"}
  Current user: dhpark (id=6)
Options: {:project=>3, :sprint=>1, :release=>nil}
SprintId: [1]; ReleaseId: ; TrackerId: [7]; GenScope: false;
Options: {:project=>3, :sprint=>1, :release=>nil}
SprintId: [1]; ReleaseId: ; TrackerId: [7]; GenScope: false;
  Rendered plugins/redmine_backlogs/app/views/rb_sprints_roadmap/_overview.html.erb (8.5ms)
  Rendered plugins/redmine_backlogs/app/views/rb_sprints_roadmap/index.html.erb within layouts/base (12.2ms)
Completed 500 Internal Server Error in 28ms (ActiveRecord: 6.9ms)

ActionView::Template::Error (PG::GroupingError: ERROR:  column "issues.position" must appear in the GROUP BY clause or be used in an aggregate function
LINE 4: ...d IN (1)) GROUP BY "issues"."status_id"  ORDER BY issues.pos...
                                                             ^
: SELECT COUNT(*) AS count_all, "issues"."status_id" AS issues_status_id FROM "issues" INNER JOIN "projects" ON "projects"."id" = "issues"."project_id" WHERE (projects.status <> 9 AND EXISTS (SELECT 1 AS one FROM enabled_modules em WHERE em.project_id = projects.id AND em.name='issue_tracking')) AND (
        project_id = 3
        and tracker_id in (7)
        and fixed_version_id IN (1)) GROUP BY "issues"."status_id"  ORDER BY issues.position):
    19: </ul>
    20: <% end %>
    21: 
    22: <% if version.issues_count > 0 %>
    23:     <%= progress_bar([version.closed_percent, version.completed_percent],
    24:                      :titles =>
    25:                        ["%s: %0.0f%" % [l(:label_closed_issues_plural), version.closed_percent],
  plugins/redmine_backlogs/app/models/rb_sprint.rb:162:in `load_issue_counts'
  app/models/version.rb:168:in `issues_count'
  plugins/redmine_backlogs/app/views/rb_sprints_roadmap/_overview.html.erb:22:in `_plugins_redmine_backlogs_app_views_rb_sprints_roadmap__overview_html_erb___4415765111336970270_70105918376660'
  plugins/redmine_backlogs/app/views/rb_sprints_roadmap/index.html.erb:31:in `block in _plugins_redmine_backlogs_app_views_rb_sprints_roadmap_index_html_erb__153815755200380439_70105919134840'
  plugins/redmine_backlogs/app/views/rb_sprints_roadmap/index.html.erb:11:in `each'
  plugins/redmine_backlogs/app/views/rb_sprints_roadmap/index.html.erb:11:in `_plugins_redmine_backlogs_app_views_rb_sprints_roadmap_index_html_erb__153815755200380439_70105919134840'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

my environment:

Environment:
  Redmine version                3.4.2.stable
  Ruby version                   2.3.1-p112 (2016-04-26) [x86_64-linux-gnu]
  Rails version                  4.2.8
  Environment                    production
  Database adapter               PostgreSQL
SCM:
  Git                            2.7.4
  Filesystem                     
Redmine plugins:
  redmine_backlogs               v2.0.2
cure commented 6 years ago

You can comment out the definition of load_issue_counts in app/models/rb_sprint.rb to make this problem go away.

Note that you should file this issue on @TheMagician1 's fork !