ActionView::Template::Error: PG::InvalidColumnReference: ERROR: for SELECT DISTINCT, ORDER BY ex...
https://sentry.gitlap.com/gitlab/gitlabcom/issues/4414/
PG::InvalidColumnReference: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ...d')) AND "issues"."project_id" = 278964 ORDER BY milestones...
^
app/views/projects/issues/_issues.html.haml:2:in `_app_views_projects_issues__issues_html_haml__338232447414937433_69907659589700'
= render @issues
app/views/projects/issues/index.html.haml:25:in `_app_views_projects_issues_index_html_haml___3555281479378510342_64019880'
= render "issues"
app/controllers/projects/issues_controller.rb:38:in `index'
respond_to do |format|
lib/gitlab/metrics/rack_middleware.rb:17:in `block in call'
retval = trans.run { @app.call(env) }
lib/gitlab/metrics/transaction.rb:45:in `run'
yield
...
(166 additional frame(s) were not displayed)
ActiveRecord::StatementInvalid: PG::InvalidColumnReference: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ...d')) AND "issues"."project_id" = 278964 ORDER BY milestones...
^
: SELECT DISTINCT "issues".* FROM "issues" INNER JOIN "milestones" ON "milestones"."id" = "issues"."milestone_id" WHERE "issues"."deleted_at" IS NULL AND "issues"."confidential" = $1 AND ("issues"."state" IN ('opened','reopened')) AND "issues"."project_id" = 278964 ORDER BY milestones.due_date DESC, milestones.id DESC LIMIT 20 OFFSET 0
app/views/projects/issues/_issues.html.haml:2:in `_app_views_projects_issues__issues_html_haml__338232447414937433_69907659589700'
= render @issues
app/views/projects/issues/index.html.haml:25:in `_app_views_projects_issues_index_html_haml___3555281479378510342_64019880'
= render "issues"
app/controllers/projects/issues_controller.rb:38:in `index'
respond_to do |format|
lib/gitlab/metrics/rack_middleware.rb:17:in `block in call'
retval = trans.run { @app.call(env) }
lib/gitlab/metrics/transaction.rb:45:in `run'
yield
...
(166 additional frame(s) were not displayed)
ActionView::Template::Error: PG::InvalidColumnReference: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ...d')) AND "issues"."project_id" = 278964 ORDER BY milestones...
^
: SELECT DISTINCT "issues".* FROM "issues" INNER JOIN "milestones" ON "milestones"."id" = "issues"."milestone_id" WHERE "issues"."deleted_at" IS NULL AND "issues"."confidential" = $1 AND ("issues"."state" IN ('opened','reopened')) AND "issues"."project_id" = 278964 ORDER BY milestones.due_date DESC, milestones.id DESC LIMIT 20 OFFSET 0
app/views/projects/issues/_issues.html.haml:2:in `_app_views_projects_issues__issues_html_haml__338232447414937433_69907659589700'
= render @issues
app/views/projects/issues/index.html.haml:25:in `_app_views_projects_issues_index_html_haml___3555281479378510342_64019880'
= render "issues"
app/controllers/projects/issues_controller.rb:38:in `index'
respond_to do |format|
lib/gitlab/metrics/rack_middleware.rb:17:in `block in call'
retval = trans.run { @app.call(env) }
lib/gitlab/metrics/transaction.rb:45:in `run'
yield
...
(166 additional frame(s) were not displayed)
I believe the issue was introduced by https://gitlab.com/gitlab-org/gitlab-ce/commit/dc13f7c31dee2c0515c36fba2398bc8b843a8108 since we now perform a SELECT DISTINCT
.
/cc @yorickpeterse