Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search autocomplete on puppetclass throws errors #365

Open
nadjaheitmann opened this issue Aug 1, 2023 · 2 comments
Open

Search autocomplete on puppetclass throws errors #365

nadjaheitmann opened this issue Aug 1, 2023 · 2 comments

Comments

@nadjaheitmann
Copy link
Collaborator

In UI, you can see
Error: Request failed with status code 500

In the logs, you can see (not sure what is relevant here)
09:16:11 rails.1 | 2023-08-01T09:16:11 [I|app|fe9dade4] Started GET "/hosts/auto_complete_search?search=puppetclass++%3D" for 192.168.121.1 at 2023-08-01 09:16:11 +0000
09:16:11 rails.1 | 2023-08-01T09:16:11 [I|app|fe9dade4] Processing by HostsController#auto_complete_search as JSON
09:16:11 rails.1 | 2023-08-01T09:16:11 [I|app|fe9dade4] Parameters: {"search"=>"puppetclass ="}
09:16:11 rails.1 | 2023-08-01T09:16:11 [I|app|fe9dade4] Completed 500 Internal Server Error in 17ms (ActiveRecord: 3.9ms | Allocations: 9776)
09:16:11 rails.1 | fe9dade4 |
09:16:11 rails.1 | fe9dade4 |
09:16:11 rails.1 | 2023-08-01T09:16:11 [F|app|fe9dade4]
09:16:11 rails.1 | fe9dade4 | NoMethodError (undefined method 'klass' for nil:NilClass):
09:16:11 rails.1 | fe9dade4 |
09:16:11 rails.1 | fe9dade4 | app/models/host/managed.rb:40:in 'complete_for'
09:16:11 rails.1 | fe9dade4 | app/controllers/concerns/foreman/controller/auto_complete_search.rb:12:in 'auto_complete_search'
09:16:11 rails.1 | fe9dade4 | app/controllers/concerns/foreman/controller/timezone.rb:10:in 'set_timezone'
09:16:11 rails.1 | fe9dade4 | app/models/concerns/foreman/thread_session.rb:32:in 'clear_thread'
09:16:11 rails.1 | fe9dade4 | app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in 'set_topbar_sweeper_controller'
09:16:11 rails.1 | fe9dade4 | /home/vagrant/katello/lib/katello/middleware/organization_created_enforcer.rb:18:in 'call'
09:16:11 rails.1 | fe9dade4 | /home/vagrant/katello/lib/katello/middleware/event_daemon.rb:10:in 'call'
09:16:11 rails.1 | fe9dade4 | lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in 'call'
09:16:11 rails.1 | fe9dade4 | lib/foreman/middleware/telemetry.rb:10:in 'call'
09:16:11 rails.1 | fe9dade4 | lib/foreman/middleware/logging_context_session.rb:22:in 'call'
09:16:11 rails.1 | fe9dade4 | lib/foreman/middleware/logging_context_request.rb:11:in 'call'
09:16:11 rails.1 | fe9dade4 | /home/vagrant/katello/lib/katello/prevent_json_parsing.rb:12:in 'call'
09:16:12 rails.1 | 2023-08-01T09:16:12 [I|app|fe9dade4] Rendered .vendor/ruby/2.7.0/gems/actionpack-6.1.7.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb (Duration: 7.9ms | Allocations: 1804)

Foreman-rake console (this one is actually fixed but it sepicts where it was failing all along):
pry(main)> Hostgroup.search_for('class = motd') NoMethodError: undefined method 'klass' for nil:NilClass from /home/vagrant/foreman/.vendor/ruby/2.7.0/gems/scoped_search-4.1.11/lib/scoped_search/definition.rb:99:in 'klass'

@nadjaheitmann
Copy link
Collaborator Author

The autocomplete also fails for host/hostgroup search for the config_group keyword

@nadjaheitmann
Copy link
Collaborator Author

@stejskalleos Are you going to look into this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant