Project

General

Profile

Actions

Bug #4443

closed

Auto-completion of organization search fails as sort column is not in result set

Added by Thomas McKay about 10 years ago. Updated almost 6 years ago.

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

Description

'name' is still available in the UI autocomplete but triggers errors when trying to display available values. 'title' does work


Related issues 2 (0 open2 closed)

Related to Foreman - Bug #4486: Cannot search for an organization by name, only labelClosedTomáš Strachota02/27/2014Actions
Related to Foreman - Bug #4789: search auto completer on progress many times failDuplicate03/24/2014Actions
Actions #1

Updated by Dominic Cleal about 10 years ago

  • Subject changed from organization no searchable by name to organization not searchable by name
  • Category changed from 19 to Search
  • Status changed from New to Need more information

Please provide the errors?

Actions #2

Updated by Thomas McKay about 10 years ago

Started GET "/organizations/auto_complete_search?search=name+%3D+" for 127.0.0.1 at 2014-02-25 08:05:19 -0500
Processing by OrganizationsController#auto_complete_search as JSON
  Parameters: {"search"=>"name = "}
  User Load (0.4ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1  [["id", 1]]
Setting current user thread-local variable to Admin User
   (0.3ms)  SELECT COUNT(*) FROM "taxonomies" WHERE "taxonomies"."type" IN ('Organization')
  Organization Load (0.5ms)  SELECT "taxonomies".* FROM "taxonomies" WHERE "taxonomies"."type" IN ('Organization') AND "taxonomies"."id" = 10 ORDER BY title LIMIT 1
Setting current organization thread-local variable to Mega Corporation
   (0.3ms)  SELECT COUNT(*) FROM "taxonomies" WHERE "taxonomies"."type" IN ('Location')
Setting current location thread-local variable to none
  Organization Load (0.8ms)  SELECT DISTINCT "taxonomies".name FROM "taxonomies" WHERE "taxonomies"."type" IN ('Organization') ORDER BY title LIMIT 20
PG::InvalidColumnReference: ERROR:  for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ... "taxonomies"."type" IN ('Organization') ORDER BY title LIMI...
                                                             ^
: SELECT  DISTINCT "taxonomies".name FROM "taxonomies"  WHERE "taxonomies"."type" IN ('Organization') ORDER BY title LIMIT 20
Completed 500 Internal Server Error in 27.8ms

ActiveRecord::StatementInvalid (PG::InvalidColumnReference: ERROR:  for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ... "taxonomies"."type" IN ('Organization') ORDER BY title LIMI...
                                                             ^
: SELECT  DISTINCT "taxonomies".name FROM "taxonomies"  WHERE "taxonomies"."type" IN ('Organization') ORDER BY title LIMIT 20):
  app/controllers/concerns/foreman/controller/auto_complete_search.rb:7:in `auto_complete_search'
  app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
  lib/middleware/catch_json_parse_errors.rb:9:in `call'

  Rendered /home/tomckay/.rvm/gems/ruby-1.9.3-p327@foreman/gems/actionpack-3.2.17/lib/action_dispatch/middleware/templates/rescues/_trace.erb (2.4ms)
  Rendered /home/tomckay/.rvm/gems/ruby-1.9.3-p327@foreman/gems/actionpack-3.2.17/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.6ms)
  Rendered /home/tomckay/.rvm/gems/ruby-1.9.3-p327@foreman/gems/actionpack-3.2.17/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (11.8ms)
Actions #3

Updated by Dominic Cleal about 10 years ago

  • Status changed from Need more information to New
Actions #4

Updated by Og Maciel about 10 years ago

Same happens for CLI:

# hammer -v organization list --search 'name=ACME_Corporation'
[ERROR 2014-02-27 09:18:26 Exception] Error: 400 Bad Request
Error: 400 Bad Request
[ERROR 2014-02-27 09:18:26 Exception]

RestClient::BadRequest (400 Bad Request):
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/abstract_response.rb:48:in `return!'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:220:in `process_result'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:169:in `transmit'
    /usr/lib/ruby/1.8/net/http.rb:543:in `start'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:166:in `transmit'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:60:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:31:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/resource.rb:54:in `get'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/base.rb:70:in `send'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/base.rb:70:in `http_call'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/base.rb:51:in `perform_call'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/resources/organization.rb:22:in `index'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/resource.rb:53:in `send'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/resource.rb:53:in `call'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/read_command.rb:17:in `retrieve_data'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/commands.rb:48:in `retrieve_data'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/commands.rb:93:in `retrieve_and_print'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/commands.rb:68:in `execute'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/resource_supported_test.rb:9:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/bin/hammer:61
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19
Actions #5

Updated by Dominic Cleal about 10 years ago

  • Related to Bug #4486: Cannot search for an organization by name, only label added
Actions #6

Updated by Tomáš Strachota about 10 years ago

  • Related to deleted (Bug #4486: Cannot search for an organization by name, only label)
Actions #7

Updated by Tomáš Strachota about 10 years ago

  • Is duplicate of Bug #4486: Cannot search for an organization by name, only label added
Actions #8

Updated by Tomáš Strachota about 10 years ago

  • Status changed from New to Duplicate
Actions #9

Updated by Tomáš Strachota about 10 years ago

  • Status changed from Duplicate to New
Actions #10

Updated by Tomáš Strachota about 10 years ago

  • Is duplicate of deleted (Bug #4486: Cannot search for an organization by name, only label)
Actions #11

Updated by Tomáš Strachota about 10 years ago

  • Related to Bug #4486: Cannot search for an organization by name, only label added
Actions #12

Updated by Dominic Cleal about 10 years ago

  • Subject changed from organization not searchable by name to Auto-completion of organization search fails as sort column is not in result set
Actions #13

Updated by Dominic Cleal about 10 years ago

  • Related to Bug #4789: search auto completer on progress many times fail added
Actions #14

Updated by Dominic Cleal about 10 years ago

  • Status changed from New to Closed
  • Assignee set to Amos Benari
  • Target version set to 1.9.0
  • % Done changed from 0 to 100
  • translation missing: en.field_release set to 4

scoped_search 2.7.1 resolves the issue reported in comment 2. RPM built into nightly, bundler users should run `bundle update scoped_search`.

Actions

Also available in: Atom PDF