Project

General

Profile

Actions

Bug #965

closed

Chained hosts query with "params" fails

Added by Bauke Karel over 13 years ago. Updated over 13 years ago.

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

Description

When chaining a "params" query on the hosts list using "and" or "or", it results in an error 500.

This occurs in version 0.3rc (unconfirmed with 0.3).

In these examples I have one host with a parameter named "monitor" with value "yes".

Example queries that work fine:

  • os = CentOS
  • environment = production and os = CentOS
  • params.monitor = yes

Example query that fails:

  • params.monitor = yes and os = CentOS

Below is the error message in the logfile for this last query:

Processing HostsController#index (for [myip] at 2011-06-07 12:27:31) [GET]
  Parameters: {"search"=>"params.monitor = yes and os = CentOS", "action"=>"index", "controller"=>"hosts"}

ActiveRecord::PreparedStatementInvalid (wrong number of bind variables (2 for 1) in: (id = 1) AND (`operatingsystems`.`name` = BINARY ?)):
  app/controllers/hosts_controller.rb:37:in `index'
  app/controllers/hosts_controller.rb:35:in `index'
  passenger (2.2.15) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
  passenger (2.2.15) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
  passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:441:in `start_request_handler'
  passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:381:in `handle_spawn_application'
  passenger (2.2.15) lib/phusion_passenger/utils.rb:252:in `safe_fork'
  passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:377:in `handle_spawn_application'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:163:in `start'
  passenger (2.2.15) lib/phusion_passenger/railz/application_spawner.rb:222:in `start'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:253:in `spawn_rails_application'
  passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:247:in `spawn_rails_application'
  passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
  passenger (2.2.15) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:246:in `spawn_rails_application'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:145:in `spawn_application'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:278:in `handle_spawn_application'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `__send__'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'

Rendering /usr/share/foreman/public/500.html (500 Internal Server Error)
Actions

Also available in: Atom PDF