Project

General

Profile

Actions

Bug #27959

closed

"undefined method `policies' for nil:NilClass" when assigning a policy

Added by Ondřej Pražák about 5 years ago. Updated about 5 years ago.

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

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


Related issues 2 (0 open2 closed)

Related to OpenSCAP - Bug #24609: Unassigning policy from host does not delete AssetResolvedOndřej PražákActions
Has duplicate OpenSCAP - Bug #33023: removing host does not remove openscap policy assets references to itDuplicateActions
Actions

Also available in: Atom PDF