Project

General

Profile

Bug #3863

when fact filters are added to a user, error column reference "id" is ambiguous for fact_values

Added by Dominic Cleal over 5 years ago. Updated 12 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Database
Target version:
Difficulty:
trivial
Triaged:
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

[ Cloning as we missed /fact_values ]

In 1.2.2, when fact filters are added to a user, this error is displayed when trying to view /dashboard or /fact_values

Started GET "/" for x.x.x.x at 2013-09-19 10:43:17 -0400
Processing by DashboardController#index as HTML
Rendered dashboard/_status_table.html.erb (9.3ms)
Rendered dashboard/index.html.erb within layouts/application (21.1ms)
Operation FAILED: PGError: ERROR: column reference "id" is ambiguous
LINE 1: SELECT id FROM "hosts" INNER JOIN "fact_values" ON "fact_val...
^
: SELECT id FROM "hosts" INNER JOIN "fact_values" ON "fact_values"."host_id" = "hosts"."id" WHERE "hosts"."type" IN ('Host::Managed') AND (((hosts.id = fact_values.host_id and fact_values.fact_name_id = 798 and fact_values.value = 'factname')) )
Rendered common/500.html.erb within layouts/application (6.6ms)
Completed 500 Internal Server Error in 101ms (Views: 7.9ms | ActiveRecord: 0.6ms)

Seems like same issue as http://projects.theforeman.org/issues/2579


Related issues

Related to Foreman - Bug #2579: Host groups with puppet classes triggers: column 'id' in field list is ambiguousClosed2013-05-28
Copied from Foreman - Bug #3122: when fact filters are added to a user, error column reference "id" is ambiguous for dashboard and fact_valuesClosed2013-09-19

History

#1 Updated by Dominic Cleal over 5 years ago

  • Copied from Bug #3122: when fact filters are added to a user, error column reference "id" is ambiguous for dashboard and fact_values added

#2 Updated by Dominic Cleal over 5 years ago

  • Related to Bug #2579: Host groups with puppet classes triggers: column 'id' in field list is ambiguous added

#3 Updated by m w about 5 years ago

still exists in 1.4.2

easy fix:

#done via INNER select automatically
where(:fact_values => {:host_id => Host.my_hosts.pluck('hosts.id')})

#4 Updated by Dominic Cleal about 5 years ago

  • Status changed from New to Resolved
  • Target version set to 1.8.4
  • Legacy Backlogs Release (now unused) set to 4

The authorization system has been rewritten in Foreman 1.5 and fact filters have become generic role filters, so this should be resolved in the upcoming release.

More info: http://projects.theforeman.org/projects/foreman/wiki/Auth_testing_for_Foreman_15

Also available in: Atom PDF