The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #14974

Error 500 when using "Inventory Search"

Added by Julien Cornuwel almost 2 years ago. Updated over 1 year ago.

Status:DuplicateStart date:06/12/2012
Priority:NormalDue date:
Assignee:Matthaus Owens% Done:

0%

Category:-
Target version:-
Keywords: Affected URL:
Branch: Affected Dashboard version:1.2.7

Description

Hi,

My Puppet setup is configured to store inventory data from facter. I can see the data on each node page fine.

However, when I try to search for a particular fact, i get an error 500. Here is dashboard’s logfile :

Processing NodesController#search (for 172.29.5.29 at 2012-06-12 11:35:40) [GET]
Parameters: {"controller"=>"nodes", "action"=>"search", "search_params"=>[{"comparator"=>"eq", "fact"=>"operatingsystem", "value"=>"SLES"}]}
Net::HTTPServerException (400 "Bad Request"):
/usr/lib/ruby/1.8/net/http.rb:2105:in `error!'
lib/puppet_https.rb:34:in `get'
app/models/node.rb:85:in `find_from_inventory_search'
app/controllers/nodes_controller.rb:44:in `search'
app/controllers/nodes_controller.rb:40:in `search'
sass (3.1.2) [v] rails/./lib/sass/plugin/rack.rb:54:in `call'
passenger (3.0.9) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
passenger (3.0.9) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
passenger (3.0.9) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
passenger (3.0.9) lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
passenger (3.0.9) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'
passenger (3.0.9) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'
passenger (3.0.9) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.9) lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
passenger (3.0.9) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.9) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.9) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.9) lib/phusion_passenger/abstract_server.rb:180:in `start'
passenger (3.0.9) lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
passenger (3.0.9) lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
passenger (3.0.9) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
passenger (3.0.9) lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
passenger (3.0.9) lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
passenger (3.0.9) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
passenger (3.0.9) lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
passenger (3.0.9) lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
passenger (3.0.9) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
passenger (3.0.9) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.9) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
passenger (3.0.9) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
passenger (3.0.9) helper-scripts/passenger-spawn-server:99
Rendering /usr/share/puppet-dashboard/public/500.html (500 Internal Server Error)

Related issues

Duplicates Puppet - Bug #16376: Inventory service fails on fact search with `undefined me... Closed 09/12/2012

History

#1 Updated by Grant Byers almost 2 years ago

Seconded. I’m also seeing this problem. This broke for me after upgrading from 1.2.4 to 1.2.9.

Happy to hack around with this, if anyone has any ideas.

root# cat /etc/redhat-release
CentOS release 6.2 (Final)


root# uname -a
Linux puppet.ourithub.net 2.6.32-220.13.1.el6.x86_64 #1 SMP Tue Apr 17 23:56:34 BST 2012 x86_64 x86_64 x86_64 GNU/Linux


root# ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]


root# gem list -l
*** LOCAL GEMS ***
actionmailer (2.3.14)
actionpack (2.3.14)
activerecord (2.3.14)
activeresource (2.3.14)
activesupport (2.3.14)
daemon_controller (1.0.0, 0.2.6)
fastthread (1.0.7)
gem2rpm (0.6.0)
json (1.7.3)
mysql (2.8.1)
passenger (3.0.13)
puppet-lint (0.1.12)
puppet-module (0.3.4)
rack (1.3.5, 1.1.2)
rails (2.3.14)
rake (0.8.7)

#2 Updated by Grant Byers almost 2 years ago

FYI, querying the inventory URL directly revealed the following ;

# https://<puppetmaster>:8140/production/facts_search/search?facts.hardwareisa.eq=i386
undefined method `has_fact_with_value' for #<Class:0x7f3bdf139fd0>

The problem has been resolved by updating rails to latest stable release.

#3 Updated by Timur Batyrshin almost 2 years ago

I see this bug also in dashboard 1.2.7 However I have rails installed from deb-package (Ubuntu Lucid) but not from gem so I can’t try upgrading the rails.

#4 Updated by Timur Batyrshin almost 2 years ago

Actually I’ve just realized that this is not a bug in puppet dashboard but in puppet itself.

Dashboard’s flaw here is throwing 500 error to the user instead of producing sane error message.

#5 Updated by Julien Cornuwel over 1 year ago

Problem still present in Dashboard 1.2.10 / Puppet 2.7.18

#6 Updated by Matthaus Owens over 1 year ago

  • Status changed from Unreviewed to Duplicate
  • Assignee set to Matthaus Owens

This bug affects those using activerecord < 3.0 on their inventory service. There is a pull request against puppet to address this (https://github.com/puppetlabs/puppet/pull/1136)

The affected puppet versions are those > 2.7.14 (when the change was introduced)

Also available in: Atom PDF