Project

General

Profile

Actions

Bug #4288

open

ORDER BY error when searching for compute resources

Added by Tyler L over 10 years ago. Updated about 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Compute resources
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Compute resource searches fail because the SQL ORDER BY statement lacks a table name.

Can be reproduced by adding a new compute resource to a fresh foreman instance and attempting to search.

Mysql::Error: Column 'type' in order clause is ambiguous: SELECT DISTINCT `compute_resources`.id FROM `compute_resources` LEFT OUTER JOIN `taxable_taxonomies` ON `taxable_taxonomies`.`taxable_id` = `compute_resources`.`id` AND `taxable_taxonomies`.`taxable_type` = 'ComputeResource' LEFT OUTER JOIN `taxonomies` ON `taxonomies`.`id` = `taxable_taxonomies`.`taxonomy_id` AND taxonomies.type='Location' LEFT OUTER JOIN `taxable_taxonomies` `taxable_taxonomies_compute_resources_join` ON `taxable_taxonomies_compute_resources_join`.`taxable_id` = `compute_resources`.`id` AND `taxable_taxonomies_compute_resources_join`.`taxable_type` = 'ComputeResource' LEFT OUTER JOIN `taxonomies` `organizations_compute_resources` ON `organizations_compute_resources`.`id` = `taxable_taxonomies_compute_resources_join`.`taxonomy_id` AND taxonomies.type='Organization' WHERE ((`taxonomies`.`name` LIKE '%kvm%' OR `taxonomies`.`name` LIKE '%kvm%' OR `compute_resources`.`name` LIKE '%kvm%')) ORDER BY type, name LIMIT 20 OFFSET 0

No data to display

Actions

Also available in: Atom PDF