Project

General

Profile

Actions

Bug #3920

closed

Foreman throws 500 when searching for not supported term

Added by Daniel Lobato Garcia over 10 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Search
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

I've found this through hammer.

Some fields, such as fullname for OS, aren't searchable. However, the api/UI throw
an ugly 500 reminder that the search term is not available.

From the UI side it's ugly but at least the user knows what's going on. API clients however, don't, and get a 500 error.

I'll try to fix both, and add fullname as a supported search term for OSs.

Actions #1

Updated by Og Maciel over 10 years ago

I was searching for a specific operating system by typing the name of the OS in the searchbox. They UI displayed this error:

PGError: ERROR: column reference "id" is ambiguous LINE 1: SELECT id FROM "operatingsystems" INNER JOIN "parameters" p... ^ : SELECT id FROM "operatingsystems" INNER JOIN "parameters" parameters_324772 ON ("operatingsystems".id = parameters_324772.reference_id) WHERE ((parameters_324772."name" = '') AND ("operatingsystems"."name" ILIKE '%3yiltmqb%' OR "operatingsystems"."major" ILIKE '%3yiltmqb%' OR "operatingsystems"."minor" ILIKE '%3yiltmqb%' OR "operatingsystems"."description" ILIKE '%3yiltmqb%' OR "operatingsystems"."type" ILIKE '%3yiltmqb%' OR "architectures"."name" ILIKE '%3yiltmqb%' OR "media"."name" ILIKE '%3yiltmqb%' OR "config_templates"."name" ILIKE '%3yiltmqb%' OR parameters_324772."value" ILIKE '%3yiltmqb%')) ORDER BY operatingsystems.name LIMIT 20 OFFSET 0

Searching by using the pattern "name = $FOO" works though.

Could we get this done within the next sprint?

Actions #2

Updated by Daniel Lobato Garcia over 10 years ago

We probably should finish this as it affects Hammer as well.

Basically the way we handle ScopedSearch errors works for a few controllers but not for most of them.

broken: usergroups
settings
models
images
bookmarks
architectures
trends
media
roles
auth_source_ldaps
smart_proxy
ptables
operatingsystems
environments
domains
common_parametesr
subnets
fine:   compute_resources
hosts
reports
users
lookup_values
hostgroups
config_templates
puppetclasses
autosign
lookup_keys
puppetca
fact_values
audits
n/a:    statistics
dashboard
facts
about
compute_resources_vms

I'm on it now, and probably after this we should refactor it all into a rails concern to handle errors. Error handling code is sprinkled all around Foreman.

Actions #4

Updated by Dominic Cleal over 10 years ago

  • Status changed from New to Ready For Testing
  • Target version set to 1.9.3
Actions #5

Updated by Anonymous over 10 years ago

  • Target version changed from 1.9.3 to 1.9.2
Actions #6

Updated by Dominic Cleal about 10 years ago

  • translation missing: en.field_release set to 2
Actions #7

Updated by Daniel Lobato Garcia about 10 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF