Project

General

Profile

Actions

Bug #19142

closed

Error: unknown attribute 'status' for Class.

Added by Josh Pavel about 7 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Foreman 1.14.2
Katello 3.3.1

When attempting to filter hosts, "facts." no longer works, and I receive "Error: unknown attribute 'status' for Class." (this error doesn't seem to be limited to a filtering based on facts, but that is where it is most often seen)

==> /var/log/foreman/production.log <==
2017-04-03 17:35:27 b5447e50 [app] [I] Started GET "/hosts/auto_complete_search?search=name" for 172.16.57.18 at 2017-04-03 17:35:27 +0000
2017-04-03 17:35:27 b5447e50 [app] [I] Processing by HostsController#auto_complete_search as JSON
2017-04-03 17:35:27 b5447e50 [app] [I]   Parameters: {"search"=>"name"}
2017-04-03 17:35:27 b5447e50 [app] [W] Action failed
 | ActiveRecord::UnknownAttributeError: unknown attribute 'status' for Class.
 | /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.3.0/lib/scoped_search/definition.rb:88:in `column'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.3.0/lib/scoped_search/definition.rb:96:in `type'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.3.0/lib/scoped_search/definition.rb:214:in `block in default_fields_for'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.3.0/lib/scoped_search/definition.rb:214:in `select'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.3.0/lib/scoped_search/definition.rb:214:in `default_fields_for'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.3.0/lib/scoped_search/query_builder.rb:419:in `to_sql'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.3.0/lib/scoped_search/query_builder.rb:54:in `build_find_params'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.3.0/lib/scoped_search/query_builder.rb:22:in `build_query'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.3.0/lib/scoped_search/auto_complete_builder.rb:87:in `is_query_valid'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.3.0/lib/scoped_search/auto_complete_builder.rb:37:in `build_autocomplete_options'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.3.0/lib/scoped_search/auto_complete_builder.rb:21:in `auto_complete'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.3.0/lib/scoped_search/definition.rb:286:in `complete_for'
 | /usr/share/foreman/app/models/host/managed.rb:25:in `complete_for'
 | /usr/share/foreman/app/controllers/concerns/foreman/controller/auto_complete_search.rb:12:in `auto_complete_search'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/base.rb:198:in `process_action'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rendering.rb:10:in `process_action'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:117:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:117:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/rails-observers-0.1.2/lib/rails/observers/action_controller/caching/sweeping.rb:73:in `around'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:455:in `public_send'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:455:in `block in make_lambda'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `block in halting'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `block in around'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
 | /usr/share/foreman/app/controllers/concerns/application_shared.rb:14:in `set_timezone'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in `block in make_lambda'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `block in halting'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `block in around'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in `block in make_lambda'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `block in halting'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `block in around'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:498:in `block (2 levels) in around'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:313:in `block (2 levels) in halting'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/rails-observers-0.1.2/lib/rails/observers/action_controller/caching/sweeping.rb:73:in `around'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:455:in `public_send'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:455:in `block in make_lambda'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:312:in `block in halting'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:497:in `block in around'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:505:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/callbacks.rb:19:in `process_action'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rescue.rb:29:in `process_action'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in `block in instrument'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in `instrument'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/base.rb:137:in `process'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/rendering.rb:30:in `process'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal.rb:196:in `dispatch'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal.rb:237:in `block in action'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:74:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:43:in `serve'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:43:in `block in serve'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:30:in `each'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:30:in `serve'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:815:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.3.7/lib/apipie/static_dispatcher.rb:65:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.3.7/lib/apipie/extractor/recorder.rb:132:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.3.7/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/etag.rb:24:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/conditionalget.rb:25:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/head.rb:13:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
 | /usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:8:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/flash.rb:260:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/session/abstract/id.rb:225:in `context'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/session/abstract/id.rb:220:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/cookies.rb:560:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/query_cache.rb:36:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:38:in `call_app'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:22:in `call'
 | /usr/share/foreman/lib/middleware/tagged_logging.rb:18:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/methodoverride.rb:22:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/runtime.rb:18:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/sendfile.rb:113:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/secure_headers-3.4.1/lib/secure_headers/middleware.rb:12:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:518:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/application.rb:165:in `call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `public_send'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `method_missing'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:66:in `block in call'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:50:in `each'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:50:in `call'
 | /usr/share/passenger/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
 | /usr/share/passenger/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
 | /usr/share/passenger/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
 | /usr/share/passenger/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context'
2017-04-03 17:35:27 b5447e50 [app] [I]   Rendered common/500.html.erb (7.5ms)
2017-04-03 17:35:27 b5447e50 [app] [I] Completed 500 Internal Server Error in 22ms (Views: 8.2ms | ActiveRecord: 2.8ms)

Files


Related issues 1 (0 open1 closed)

Has duplicate Foreman - Bug #19188: Selecting a Smart Proxy in UI - unknown attribute 'status' for Class.Duplicate04/05/2017Actions
Actions #1

Updated by Dominic Cleal about 7 years ago

  • Description updated (diff)
  • Category changed from Web Interface to Search

From the log, the error only seems to be on autocompletion, not the search itself.

I'm unable to reproduce this, and don't see any registered search scope in Foreman that is likely to cause it - it's likely that this is a bug in a plugin, not Foreman.

Actions #2

Updated by Josh Pavel about 7 years ago

I have very few "extra" plugins installed; my "About" lists foreman-tasks, foreman_column_view (just installed yesterday, and this issue predates that), foreman_dhcp_browser, foreman_docker, foreman_openscap, and katello.

Any ideas on how to troubleshoot this will be appreciated; in our use case, this is a very common function that is broken ATM.

Dominic Cleal wrote:

From the log, the error only seems to be on autocompletion, not the search itself.

I'm unable to reproduce this, and don't see any registered search scope in Foreman that is likely to cause it - it's likely that this is a bug in a plugin, not Foreman.

Actions #3

Updated by Dominic Cleal about 7 years ago

  • Has duplicate Bug #19188: Selecting a Smart Proxy in UI - unknown attribute 'status' for Class. added
Actions #4

Updated by Jason Lang about 7 years ago

I had the duplicate issue just linked here. I have several plugins, but the plugin(s) I have in common to what you listed are:
foreman-tasks
foreman_column_view
foreman_dhcp_browser
foreman_openscap

Also of note - I did need to grab foreman_openscap 0.6.7 (released yesterday) to fix another bug, but that one doesn't seem to resolve this issue.

Actions #5

Updated by Jason Lang about 7 years ago

Will simply "uninstalling" the rpm's in question serve as a sufficient test? or are there additional steps to "remove" plugins (database for example).

Other than foreman-tasks - i can temporarily remove all of the others to test resolution, as long as my prposed method (removing RPM's) seems sound. I have 3 foreman servers in a cluster, i plan to only do this to 1 of the 3 and force myself to use that one (after restarting foreman services) - will this work as a test, or are there other steps to perform to uninstall plugis?

Actions #6

Updated by Lars Bjerke about 7 years ago

I just encountered the same issue; Foreman 1.14.2.

I performed a search for "facts.puppetversion ~ 3.8.7, and environment = production" This filter worked.
two minutes later (and every-time there after), the same filter fails with the subject error.
Searching just the environment works.
Searching for just the fact (which the version can be populated with auto populate), the error occurs.

Thanks,
Lars

Actions #7

Updated by Daniel Helgenberger about 7 years ago

This issue does still exist with 1.14.3. In my case, I could resolve it using a different query witch might have been malformed in the fist place and was working up until now:

Query run against Foreman 1.14.1:

2017-04-19 03:50:53 3e99a58b [app] [I] Started GET "/api/v2/hosts?search=environment+%3D+production+and+hostgroup_fullname+%7E+srv+and+%28last_report+%3C+%221+hour+ago%22+or+%28status.failed+%3E+0+or+status.failed_restarts+%3E+0+or+status.skipped+%3E+0%29%29%22&per_page=1000" for [redacted] at 2017-04-19 03:50:53 +0200
2017-04-19 03:50:53 3e99a58b [app] [I] Processing by Api::V2::HostsController#index as JSON
2017-04-19 03:50:53 3e99a58b [app] [I]   Parameters: {"search"=>"environment = production and hostgroup_fullname ~ srv and (last_report < \"1 hour ago\" or (status.failed > 0 or status.failed_restarts > 0 or status.skipped > 0))\"", "per_page"=>"1000", "apiv"=>"v2"}
2017-04-19 03:50:53 3e99a58b [app] [I] Authorized user icinga(Icinga Sysmon)
2017-04-19 03:50:53 3e99a58b [app] [I]   Rendered api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout (2.5ms)
2017-04-19 03:50:53 3e99a58b [app] [I] Completed 200 OK in 226ms (Views: 41.7ms | ActiveRecord: 71.5ms)

Same query run against Foreman 1.14.3:

2017-04-19 11:56:18 25cfa348 [app] [I] Started GET "/api/v2/hosts?search=environment+%3D+production+and+hostgroup_fullname+%7E+srv+and+%28last_report+%3C+%221+hour+ago%22+or+%28status.failed+%3E+0+or+status.failed_restarts+%3E+0+or+status.skipped+%3E+0%29%29%22&per_page=1000" for [redacted] at 2017-04-19 11:56:18 +0200
2017-04-19 11:56:18 25cfa348 [app] [I] Processing by Api::V2::HostsController#index as JSON
2017-04-19 11:56:18 25cfa348 [app] [I]   Parameters: {"search"=>"environment = production and hostgroup_fullname ~ srv and (last_report < \"1 hour ago\" or (status.failed > 0 or status.failed_restarts > 0 or status.skipped > 0))\"", "per_page"=>"1000", "apiv"=>"v2"}
2017-04-19 11:56:18 25cfa348 [app] [I] Authorized user icinga(Icinga Sysmon)
2017-04-19 11:56:18 25cfa348 [app] [W] Action failed
 | ActiveRecord::UnknownAttributeError: unknown attribute 'status' for Class.
 | /opt/theforeman/tfm/root/usr/share/gems/gems/scoped_search-3.3.0/lib/scoped_search/definition.rb:88:in `column'
[...]

Note the end of the query has one extra escaped quote: '\"'

After changing the query slightly it works again:

2017-04-19 14:11:30 a17debad [app] [I] Started GET "/api/v2/hosts?search=environment+%3D+production+and+hostgroup_fullname+%7E+srv+and+%28last_report+%3C+%221+hour+ago%22+or+%28status.failed+%3E+0+or+status.failed_restarts+%3E+0+or+status.skipped+%3E+0%29%29&per_page=1000" for [redacted] at 2017-04-19 14:11:30 +0200
2017-04-19 14:11:30 a17debad [app] [I] Processing by Api::V2::HostsController#index as JSON
2017-04-19 14:11:30 a17debad [app] [I]   Parameters: {"search"=>"environment = production and hostgroup_fullname ~ srv and (last_report < \"1 hour ago\" or (status.failed > 0 or status.failed_restarts > 0 or status.skipped > 0))", "per_page"=>"1000", "apiv"=>"v2"}
2017-04-19 14:11:30 a17debad [app] [I] Authorized user icinga(Icinga Sysmon)
2017-04-19 14:11:30 a17debad [app] [I]   Rendered api/v2/hosts/index.json.rabl within api/v2/layouts/index_layout (1.1ms)
2017-04-19 14:11:30 a17debad [app] [I] Completed 200 OK in 96ms (Views: 10.2ms | ActiveRecord: 51.0ms)

As for plugins, here are mine:

foreman-tasks     0.8.6
foreman_bootdisk  9.0.0
foreman_discovery 8.0.1
foreman_openscap  0.6.7
foreman_setup     5.0.0
foreman_templates 4.0.1
puppetdb_foreman  2.0.0
Actions #8

Updated by Daniel Helgenberger about 7 years ago

I can reproduce the issue simply by entering a plain host name in the search box in 'hosts':

2017-04-19 17:23:05 0ca50385 [app] [I] Started GET "/hosts/auto_complete_search?search=w-p9-01" for [redacted] at 2017-04-19 17:23:05 +0200
2017-04-19 17:23:05 0ca50385 [app] [I] Processing by HostsController#auto_complete_search as JSON
2017-04-19 17:23:05 0ca50385 [app] [I]   Parameters: {"search"=>"w-p9-01"}
2017-04-19 17:23:05 0ca50385 [app] [W] Action failed
 | ActiveRecord::UnknownAttributeError: unknown attribute 'status' for Class.

Prefixing the search with 'name ~' succeeds:

2017-04-19 17:31:14 0ca50385 [app] [I] Processing by HostsController#auto_complete_search as JSON
2017-04-19 17:31:14 0ca50385 [app] [I]   Parameters: {"search"=>"name ~ w-p9-01"}
2017-04-19 17:31:14 0ca50385 [app] [I] Completed 200 OK in 14ms (Views: 0.6ms | ActiveRecord: 2.6ms)
2017-04-19 17:31:15 0ca50385 [app] [I] Started GET "/hosts?utf8=%E2%9C%93&search=name+%7E+w-p9-01" for [redacted] at 2017-04-19 17:31:15 +0200
2017-04-19 17:31:15 0ca50385 [app] [I] Processing by HostsController#index as HTML
2017-04-19 17:31:15 0ca50385 [app] [I]   Parameters: {"utf8"=>"✓", "search"=>"name ~ w-p9-01"}
2017-04-19 17:31:15 0ca50385 [app] [I]   Rendered hosts/_list.html.erb (18.7ms)
2017-04-19 17:31:15 0ca50385 [app] [I]   Rendered hosts/index.html.erb within layouts/application (30.9ms)
2017-04-19 17:31:15 0ca50385 [app] [I]   Rendered common/_searchbar.html.erb (27.2ms)
2017-04-19 17:31:15 0ca50385 [app] [I]   Rendered layouts/_application_content.html.erb (28.3ms)
2017-04-19 17:31:15 0ca50385 [app] [I]   Rendered home/_user_dropdown.html.erb (3.4ms)
2017-04-19 17:31:15 0ca50385 [app] [I] Read fragment views/tabs_and_title_records-7 (0.2ms)
2017-04-19 17:31:15 0ca50385 [app] [I]   Rendered home/_topbar.html.erb (12.5ms)
2017-04-19 17:31:15 0ca50385 [app] [I]   Rendered layouts/base.html.erb (16.2ms)
2017-04-19 17:31:15 0ca50385 [app] [I] Completed 200 OK in 122ms (Views: 75.0ms | ActiveRecord: 10.7ms)

Actions #9

Updated by Jason Lang about 7 years ago

I noticed something interesting today.

I am seeing "duplicate" hosts in foreman - exact duplicates. Ill come back to this in a minute.
I have 7 hosts - atlapdvl[1-7] for which I'm reproducing the below searches:
All searches are "all orgs, all locations"

UI search - "atlapdvl"
Result: Error: unknown attribute 'status' for Class.
Search: Returns entire host page (doesn't work)

UI Search - "name = atlapdvl2.pxlabus.com"
Result: Works - no error - returns a single host

UI Search - "facts.%factname% = factvalue"
Result: Works - but showing several duplicates
Power Name Operating system Environment Model Host group Last report RBAC Hostgroup Actions

atlapdvl1.pxlabus.com     Redhat 2135697c96c95b7a8b4046a8b24c2be4ae425b651727169df1f9a759bea682c7 RHEL Server 7.3     pxlabus     pxlabus_vcenter     Linux7/Atl...Confluence     12 minutes ago     lnx_app_other_atlassian
atlapdvl2.pxlabus.com     Redhat 2135697c96c95b7a8b4046a8b24c2be4ae425b651727169df1f9a759bea682c7 RHEL Server 7.3     pxlabus     pxlabus_vcenter     Linux7/Atl...Confluence     1 minute ago     lnx_app_other_atlassian     
atlapdvl2.pxlabus.com Redhat 2135697c96c95b7a8b4046a8b24c2be4ae425b651727169df1f9a759bea682c7 RHEL Server 7.3 pxlabus pxlabus_vcenter Linux7/Atl...Confluence 1 minute ago lnx_app_other_atlassian
atlapdvl3.pxlabus.com     Redhat 2135697c96c95b7a8b4046a8b24c2be4ae425b651727169df1f9a759bea682c7 RHEL Server 7.3     pxlabus     pxlabus_vcenter     Linux7/Atlassian/Jira     2 days ago     lnx_app_other_atlassian
atlapdvl4.pxlabus.com     Redhat 2135697c96c95b7a8b4046a8b24c2be4ae425b651727169df1f9a759bea682c7 RHEL Server 7.3     pxlabus     pxlabus_vcenter     Linux7/Atlassian/Jira     29 minutes ago     lnx_app_other_atlassian     
atlapdvl4.pxlabus.com Redhat 2135697c96c95b7a8b4046a8b24c2be4ae425b651727169df1f9a759bea682c7 RHEL Server 7.3 pxlabus pxlabus_vcenter Linux7/Atlassian/Jira 29 minutes ago lnx_app_other_atlassian
atlapdvl5.pxlabus.com     Redhat 2135697c96c95b7a8b4046a8b24c2be4ae425b651727169df1f9a759bea682c7 RHEL Server 7.3     pxlabus     pxlabus_vcenter     Linux7/Atlassian/B...UI     17 minutes ago     lnx_app_other_atlassian
atlapdvl6.pxlabus.com     Redhat 2135697c96c95b7a8b4046a8b24c2be4ae425b651727169df1f9a759bea682c7 RHEL Server 7.3     pxlabus     pxlabus_vcenter     Linux7/Atlassian/...API     5 minutes ago     lnx_app_other_atlassian     
atlapdvl6.pxlabus.com Redhat 2135697c96c95b7a8b4046a8b24c2be4ae425b651727169df1f9a759bea682c7 RHEL Server 7.3 pxlabus pxlabus_vcenter Linux7/Atlassian/...API 5 minutes ago lnx_app_other_atlassian
atlapdvl7.pxlabus.com     Redhat 2135697c96c95b7a8b4046a8b24c2be4ae425b651727169df1f9a759bea682c7 RHEL Server 7.2     pxlabus     pxlabus_vcenter     Linux7/Atlas...Crucible     27 minutes ago     lnx_app_other_atlassian
atlapdvl8.pxlabus.com     Redhat 2135697c96c95b7a8b4046a8b24c2be4ae425b651727169df1f9a759bea682c7 RHEL Server 7.3     pxlabus     pxlabus_vcenter     Linux7/At...Perspectium     27 minutes ago     lnx_app_other_atlassian
atlapdvl9.pxlabus.com     Redhat 2135697c96c95b7a8b4046a8b24c2be4ae425b651727169df1f9a759bea682c7 RHEL Server 7.3     pxlabus     pxlabus_vcenter     Linux7/At...Perspectium     15 minutes ago     lnx_app_other_atlassian
atlesdvl1.pxlabus.com     Redhat 2135697c96c95b7a8b4046a8b24c2be4ae425b651727169df1f9a759bea682c7 RHEL Server 7.2     pxlabus     pxlabus_vcenter     Linux7/...ElasticSearch     27 minutes ago     lnx_app_other_atlassian
atlesdvl2.pxlabus.com     Redhat 2135697c96c95b7a8b4046a8b24c2be4ae425b651727169df1f9a759bea682c7 RHEL Server 7.2     pxlabus     pxlabus_vcenter     Linux7/...ElasticSearch     27 minutes ago     lnx_app_other_atlassian
atlesdvl3.pxlabus.com     Redhat 2135697c96c95b7a8b4046a8b24c2be4ae425b651727169df1f9a759bea682c7 RHEL Server 7.2     pxlabus     pxlabus_vcenter     Linux7/...ElasticSearch     27 minutes ago     lnx_app_other_atlassian

Specifically - atlapdvl2,4,6 have two entries?

Similar API Query: api/v2/hosts?search=facts.payx_hostgroup+%3D+lnx_app_other_atlassian&per_page=9999
Shows two identical hosts returned?
I've pared the JSON down to a single duplicate host (atlapdvl2)

"results": [

{
"ip": "172.30.8.95",
"ip6": "",
"environment_id": 4,
"environment_name": "pxlabus",
"last_report": "2017-04-20 08:28:59 -0400",
"mac": "00:50:56:95:7d:d4",
"realm_id": null,
"realm_name": null,
"sp_mac": null,
"sp_ip": null,
"sp_name": null,
"domain_id": 1,
"domain_name": "pxlabus.com",
"architecture_id": 1,
"architecture_name": "x86_64",
"operatingsystem_id": 24,
"operatingsystem_name": "RHEL Server 7.3",
"subnet_id": 1,
"subnet_name": "Webster Lab Linux 1008",
"subnet6_id": null,
"subnet6_name": null,
"sp_subnet_id": null,
"ptable_id": 154,
"ptable_name": "Payx RedHat 7",
"medium_id": 11,
"medium_name": "RedHat 7 Update 2",
"pxe_loader": "PXELinux BIOS",
"build": false,
"comment": "",
"disk": "",
"installed_at": "2017-01-10 17:15:46 -0500",
"model_id": 1,
"hostgroup_id": 25,
"owner_id": 3,
"owner_type": "User",
"enabled": true,
"managed": true,
"use_image": null,
"image_file": "",
"uuid": "5015c796-1936-e1a9-a3f8-2d2e139fcc86",
"compute_resource_id": 1,
"compute_resource_name": "pxlabus_vcenter",
"compute_profile_id": null,
"compute_profile_name": null,
"capabilities": [
"build",
"image",
"bootdisk"
],
"provision_method": "build",
"certname": "atlapdvl2.pxlabus.com",
"image_id": null,
"image_name": null,
"created_at": "2016-03-22 13:39:54 -0400",
"updated_at": "2017-04-20 08:29:29 -0400",
"last_compile": "2017-04-20 08:29:04 -0400",
"global_status": 0,
"global_status_label": "OK",
"organization_id": 2,
"organization_name": "pxlabus",
"location_id": 4,
"location_name": "Lab/core",
"puppet_status": 0,
"model_name": "VMware Virtual Platform",
"configuration_status": 0,
"configuration_status_label": "No changes",
"build_status": 0,
"build_status_label": "Installed",
"name": "atlapdvl2.pxlabus.com",
"id": 986,
"puppet_proxy_id": 2,
"puppet_proxy_name": "Puppet Master 1",
"puppet_ca_proxy_id": 1,
"puppet_ca_proxy_name": "Puppet CA",
"puppet_proxy": {
"name": "Puppet Master 1",
"id": 2,
"url": "https://fmnpmdvl1.pxlabus.com:8443"
},
"puppet_ca_proxy": {
"name": "Puppet CA",
"id": 1,
"url": "https://fmncadvl1.pxlabus.com:8443"
},
"hostgroup_name": "Confluence",
"hostgroup_title": "Linux7/Atlassian/Confluence"
}, {
"ip": "172.30.8.95",
"ip6": "",
"environment_id": 4,
"environment_name": "pxlabus",
"last_report": "2017-04-20 08:28:59 -0400",
"mac": "00:50:56:95:7d:d4",
"realm_id": null,
"realm_name": null,
"sp_mac": null,
"sp_ip": null,
"sp_name": null,
"domain_id": 1,
"domain_name": "pxlabus.com",
"architecture_id": 1,
"architecture_name": "x86_64",
"operatingsystem_id": 24,
"operatingsystem_name": "RHEL Server 7.3",
"subnet_id": 1,
"subnet_name": "Webster Lab Linux 1008",
"subnet6_id": null,
"subnet6_name": null,
"sp_subnet_id": null,
"ptable_id": 154,
"ptable_name": "Payx RedHat 7",
"medium_id": 11,
"medium_name": "RedHat 7 Update 2",
"pxe_loader": "PXELinux BIOS",
"build": false,
"comment": "",
"disk": "",
"installed_at": "2017-01-10 17:15:46 -0500",
"model_id": 1,
"hostgroup_id": 25,
"owner_id": 3,
"owner_type": "User",
"enabled": true,
"managed": true,
"use_image": null,
"image_file": "",
"uuid": "5015c796-1936-e1a9-a3f8-2d2e139fcc86",
"compute_resource_id": 1,
"compute_resource_name": "pxlabus_vcenter",
"compute_profile_id": null,
"compute_profile_name": null,
"capabilities": [
"build",
"image",
"bootdisk"
],
"provision_method": "build",
"certname": "atlapdvl2.pxlabus.com",
"image_id": null,
"image_name": null,
"created_at": "2016-03-22 13:39:54 -0400",
"updated_at": "2017-04-20 08:29:29 -0400",
"last_compile": "2017-04-20 08:29:04 -0400",
"global_status": 0,
"global_status_label": "OK",
"organization_id": 2,
"organization_name": "pxlabus",
"location_id": 4,
"location_name": "Lab/core",
"puppet_status": 0,
"model_name": "VMware Virtual Platform",
"configuration_status": 0,
"configuration_status_label": "No changes",
"build_status": 0,
"build_status_label": "Installed",
"name": "atlapdvl2.pxlabus.com",
"id": 986,
"puppet_proxy_id": 2,
"puppet_proxy_name": "Puppet Master 1",
"puppet_ca_proxy_id": 1,
"puppet_ca_proxy_name": "Puppet CA",
"puppet_proxy": {
"name": "Puppet Master 1",
"id": 2,
"url": "https://fmnpmdvl1.pxlabus.com:8443"
},
"puppet_ca_proxy": {
"name": "Puppet CA",
"id": 1,
"url": "https://fmncadvl1.pxlabus.com:8443"
},
"hostgroup_name": "Confluence",
"hostgroup_title": "Linux7/Atlassian/Confluence"
},

I have no idea if this is related to this problem - or an anomaly on my end - but wanted to share it in case others see it as well? Would duplicate "hosts" in foreman possibly cause search errors?

Actions #10

Updated by Josh Pavel about 7 years ago

Interesting. From my end, I could certainly imagine that we might have some errant duplicates - we pulled in host creation from several sources (puppet runs, scripted API calls since we had host information in a spreadsheet, etc.)

I can't think of a way to query this to see if it's true, though - we have over 4000 servers and I don't want to look at each host individually. I may be able to script something up, unless anybody more familiar with the API can tell me how I could verify this quickly programmatically.

Actions #11

Updated by Jason Lang about 7 years ago

I just stumbled across it on my end. Our Production environment is over 8000 hosts, this lab environment has maybe 200, so "finding" it is much easier.

I still have no idea if its related to the "searching" issue here - but definitely something that just kinda showed up when i was looking into it.

Actions #12

Updated by Josh Pavel almost 7 years ago

FYI, I have made a correlation (I realize it might not be a causation) with my bug reported at http://projects.theforeman.org/issues/19515, that perhaps this is related to bad/unexpected characters (spaces, unescaped quotes, commas, parentheses, etc) in certain hosts/fact values?

Actions #13

Updated by Daniel Helgenberger almost 7 years ago

Further, we all seem to use openscap - plugin.

I have it installed and could give it a try do disable it - but I have no idea how to uninstall the plugin; disabling it with foreman-installer seems to do nothing at all. Disabling smartproxy feature works.

Actions #14

Updated by Jason Lang almost 7 years ago

Based on what Josh Pavel Said - I do think this is an issue with spaces. I also have spaces in my Proxy Server names - which has never been an issue "before". Spaces in facts/params for hosts is also something we do.

Based on what Daniel Said - I think this is indeed the openSCAP plugin.

I went into my lab/test foreman today (1.14.3) and removed the RPM (did nothing else) via a yum remove command on one of my 3 UI servers.

I then restarted the httpd service. On the server without the OpenSCAP plugin (confirmed in the about section) smart proxy options as well as searches are working fine. ON the other two - there is still issues.

Can anyone else confirm/second this and we can probably reassign this as an OpenSCAP bug.

Specifically i was using Foreman 1.14.3 with OpenSCAP tfm-rubygem-foreman_openscap.noarch 0:0.6.7-1.fm1_14.el7

Actions #15

Updated by Anonymous almost 7 years ago

  • Project changed from Foreman to OpenSCAP
  • Category deleted (Search)
  • Triaged set to No
Actions #16

Updated by Ondřej Pražák almost 7 years ago

This seems to be an issue caused by one of scoped search queries in foreman_openscap. Steps to reproduce:

1) go to policy dashboard
2) click on 'Never audited' in 'Hosts breakdown' table
3) observe the "unknown attribute 'status' for Class" error

Actions #17

Updated by Josh Pavel almost 7 years ago

My issues with this seem to be resolved with an upgrade to Foreman 1.15.0 - I'm still checking it out, but my initial checks are all positive.

Actions #18

Updated by Ondřej Pražák almost 7 years ago

  • Status changed from New to Resolved
  • translation missing: en.field_release set to 248

Josh Pavel wrote:

My issues with this seem to be resolved with an upgrade to Foreman 1.15.0 - I'm still checking it out, but my initial checks are all positive.

Thanks for your comment, the issue seems to be gone for me on 1.15 as well. I managed to reproduce what was reported in comment #14, there is some interaction between scoped_search 3.3.0 and foreman_openscap. Both me and Tomer were puzzled about how foreman_openscap would effectively break completely independent searches from core. Since this is probably fixed in 1.15 where scoped_search is bumped to 4.0, I will close this issue. Feel free to reopen if this reappears in 1.15.

Actions #19

Updated by Dominic Cleal almost 7 years ago

  • translation missing: en.field_release deleted (248)
Actions

Also available in: Atom PDF