-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
6.14.0
Description of problem:
Filter hosts with search criteria "class = puppet-class" fails with exception "Error: Request failed with status code 500"
How reproducible:
100%
Is this issue a regression from an earlier version:
Satellite version 6.14 and 6.15
Steps to Reproduce:
1. Satelite with puppet enabled.
2. Import default env from the puppet.
3. Assing and configure the puppet module to the client registered to the satellite.
4. Filter the host using the assigned puppet classes
From Configure -> Puppet Enc -> Classes - We would like to filter the hosts that are ordered to this class. When we click on the blue number to get back all hosts, we could see the below exception:
Actual behavior:
==> /var/log/foreman/production.log <==
2024-06-27T12:44:35 [I|app|50f578b4] Started GET "/hosts/auto_complete_search?search=class+%3D" for [ipaddr] at 2024-06-27 12:44:35 +0530
2024-06-27T12:44:35 [I|app|50f578b4] Processing by HostsController#auto_complete_search as JSON
2024-06-27T12:44:35 [I|app|50f578b4] Parameters:
2024-06-27T12:44:35 [W|app|50f578b4] undefined method `klass' for nil:NilClass
2024-06-27T12:44:35 [I|app|50f578b4] Backtrace for 'undefined method `klass' for nil:NilClass' error (NoMethodError): undefined method `klass' for nil:NilClass
50f578b4 | /usr/share/gems/gems/scoped_search-4.1.11/lib/scoped_search/definition.rb:99:in `klass'
50f578b4 | /usr/share/gems/gems/scoped_search-4.1.11/lib/scoped_search/auto_complete_builder.rb:222:in `completer_scope'
50f578b4 | /usr/share/gems/gems/scoped_search-4.1.11/lib/scoped_search/auto_complete_builder.rb:210:in `complete_value_from_db'
50f578b4 | /usr/share/gems/gems/scoped_search-4.1.11/lib/scoped_search/auto_complete_builder.rb:205:in `complete_value'
50f578b4 | /usr/share/gems/gems/scoped_search-4.1.11/lib/scoped_search/auto_complete_builder.rb:48:in `build_autocomplete_options'
50f578b4 | /usr/share/gems/gems/scoped_search-4.1.11/lib/scoped_search/auto_complete_builder.rb:21:in `auto_complete'
50f578b4 | /usr/share/gems/gems/scoped_search-4.1.11/lib/scoped_search/definition.rb:355:in `complete_for'
50f578b4 | /usr/share/foreman/app/models/host/managed.rb:40:in `complete_for'
[Describe what should be happening instead]
should filter hosts without any issues.
Business Impact / Additional info: