Project

General

Profile

Actions

Bug #20656

closed

Internal server error for GET /api/compliance/policies/:id/tailoring when tailoring file is not associated

Added by Ondřej Pražák over 6 years ago. Updated almost 6 years ago.

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

Description

Description of problem: API GET /api/compliance/policies/:id/tailoring results in

"undefined method `scap_file' for nil:NilClass"

when tailoring file is not associated with compliance policy and log file shows 500 Internal server error.

How reproducible: always

Steps to Reproduce:
1. Create compliance policy with scap content (do not associate tailoring file)
2.  curl -s -X GET -k -u admin:<password> 'https://$HOST/api/v2/compliance/policies/1/tailoring'

Actual results:
Results in

{
"error": {"message":"undefined method `scap_file' for nil:NilClass"}
}

and tail -f /var/log/foreman/production.log shows Internal server error 500.

Expected results:

Error should get handled and proper message should be displayed.

Actions #1

Updated by The Foreman Bot over 6 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/277 added
Actions #2

Updated by Marek Hulán over 6 years ago

  • Subject changed from Internal server error for GET /api/compliance/policies/:id/tailoring when tailoring file is not associated to Internal server error for GET /api/compliance/policies/:id/tailoring when tailoring file is not associated
  • Target version set to 1.18.0-RC2
  • translation missing: en.field_release set to 274
Actions #3

Updated by Ondřej Pražák over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF