Actions
Bug #27959
closed"undefined method `policies' for nil:NilClass" when assigning a policy
Difficulty:
Triaged:
No
Bugzilla link:
Description
Description of problem:
2019-09-30T04:22:38 [F|app|be04892c] NoMethodError (undefined method `policies' for nil:NilClass): 2019-09-30T04:22:38 [F|app|be04892c] 2019-09-30T04:22:38 [F|app|be04892c] foreman_openscap (1.0.7) app/models/foreman_openscap/policy.rb:315:in `block in no_mixed_deployments' foreman_openscap (1.0.7) app/models/foreman_openscap/policy.rb:313:in `no_mixed_deployments' foreman_openscap (1.0.7) app/controllers/policies_controller.rb:83:in `update_multiple_hosts' app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone' app/models/concerns/foreman/thread_session.rb:32:in `clear_thread' app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller' lib/foreman/middleware/telemetry.rb:10:in `call' lib/foreman/middleware/catch_json_parse_errors.rb:9:in `call' lib/foreman/middleware/logging_context_session.rb:22:in `call' lib/foreman/middleware/logging_context_request.rb:11:in `call' katello (3.12.0.25) lib/katello/prevent_json_parsing.rb:12:in `call'
Steps to Reproduce:
1. Logs suggest this is happening for a policy where assigned host was deleted - cause is probably that its asset is still present
2. Hosts -> All Hosts
3. Select host
4. Select Action -> Assign Compliance Policy
Actual results:
undefined method `policies' for nil:NilClass
Expected results:
Compliance policy assigned
Updated by The Foreman Bot about 5 years ago
- Status changed from New to Ready For Testing
- Assignee set to Ondřej Pražák
- Pull request https://github.com/theforeman/foreman_openscap/pull/418 added
Updated by Ondřej Pražák about 5 years ago
- Related to Bug #24609: Unassigning policy from host does not delete Asset added
Updated by The Foreman Bot about 5 years ago
- Fixed in Releases foreman_openscap 2.0.0 added
Updated by Ondřej Pražák about 5 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman_openscap|f5eb3bbff340b07a9eccab9e02b36cc2faa4a338.
Updated by Oleh Fedorenko over 1 year ago
- Has duplicate Bug #33023: removing host does not remove openscap policy assets references to it added
Actions