Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-25250

OpenScap related hammer commands fail with 'No Capsule with OpenSCAP feature is running'.

XMLWordPrintable

    • Critical
    • No

      Description of problem:

      Hammer commands like scap-content create and others fail as follows (hammer -d output)

      hammer -v -u admin -p changeme --output=csv scap-content create --title="rhel-content-NWPDIcTmor" --scap-file="/usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml"

      ...

      [DEBUG 2024-05-20T03:39:53 API] Headers: {}
      [DEBUG 2024-05-20T03:39:53 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
      [ERROR 2024-05-20T03:39:53 API] 422 Unprocessable Entity
      [DEBUG 2024-05-20T03:39:53 API] {
          "error" =>

      Unknown macro: {                    "id" => nil,                "errors" => Unknown macro}

      ,
              "full_messages" => [
                  [0] "No Capsule with OpenSCAP feature is running."
              ]
          }
      }
      [DEBUG 2024-05-20T03:39:53 Exception] Using exception handler HammerCLIForemanOpenscap::ExceptionHandler#handle_unprocessable_entity
      [ERROR 2024-05-20T03:39:53 Exception] No Capsule with OpenSCAP feature is running.
      Failed to create SCAP content:
        No Capsule with OpenSCAP feature is running.
      [ERROR 2024-05-20T03:39:53 Exception] 

      RestClient::UnprocessableEntity (422 Unprocessable Entity):
          /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/abstract_response.rb:249:in `exception_with_response'
          /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/abstract_response.rb:129:in `return!'
          /usr/share/gems/gems/apipie-bindings-0.6.0/lib/apipie_bindings/api.rb:353:in `block in rest_client_call_block'
          /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/request.rb:834:in `process_result'
          /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/request.rb:743:in `block in transmit'
          /usr/share/ruby/net/http.rb:960:in `start'
          /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/request.rb:727:in `transmit'
          /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/request.rb:163:in `execute'
          /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/request.rb:63:in `execute'
          /usr/share/gems/gems/rest-client-2.1.0/lib/restclient/resource.rb:69:in `post'
          /usr/share/gems/gems/apipie-bindings-0.6.0/lib/apipie_bindings/api.rb:327:in `call_client'
          /usr/share/gems/gems/apipie-bindings-0.6.0/lib/apipie_bindings/api.rb:240:in `http_call'
          /usr/share/gems/gems/apipie-bindings-0.6.0/lib/apipie_bindings/api.rb:190:in `call_action'
          /usr/share/gems/gems/apipie-bindings-0.6.0/lib/apipie_bindings/api.rb:185:in `call'
          /usr/share/gems/gems/apipie-bindings-0.6.0/lib/apipie_bindings/resource.rb:21:in `call'
          /usr/share/gems/gems/hammer_cli-3.11.0.pre.develop/lib/hammer_cli/apipie/command.rb:53:in `send_request'
          /usr/share/gems/gems/hammer_cli_foreman-3.11.0.pre.develop/lib/hammer_cli_foreman/commands.rb:180:in `send_request'
          /usr/share/gems/gems/hammer_cli-3.11.0.pre.develop/lib/hammer_cli/apipie/command.rb:34:in `execute'
          /usr/share/gems/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run'
          /usr/share/gems/gems/hammer_cli-3.11.0.pre.develop/lib/hammer_cli/abstract.rb:103:in `run'
          /usr/share/gems/gems/clamp-1.3.2/lib/clamp/subcommand/execution.rb:18:in `execute'
          /usr/share/gems/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run'
          /usr/share/gems/gems/hammer_cli-3.11.0.pre.develop/lib/hammer_cli/abstract.rb:103:in `run'
          /usr/share/gems/gems/clamp-1.3.2/lib/clamp/subcommand/execution.rb:18:in `execute'
          /usr/share/gems/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run'
          /usr/share/gems/gems/hammer_cli-3.11.0.pre.develop/lib/hammer_cli/abstract.rb:103:in `run'
          /usr/share/gems/gems/clamp-1.3.2/lib/clamp/command.rb:140:in `run'
          /usr/share/gems/gems/hammer_cli-3.11.0.pre.develop/bin/hammer:142:in `<top (required)>'
          /usr/bin/hammer:25:in `load'
          /usr/bin/hammer:25:in `<main>'

      Openscap enabled capsule is present:

      ~]# hammer capsule list
      -{}|{}---------------------------------------------{}|{}----------------------------------------------------------{}|{}------------------------------------------------------------------
      ID | NAME                                            | URL                                                          | FEATURES                                                           
      -{}|{}---------------------------------------------{}|{}----------------------------------------------------------{}|{}------------------------------------------------------------------
      1  | capsule-hostname | https://capsule-hostname:9090 | Dynflow, Ansible, Discovery, Openscap, Script, TFTP, Logs, Pulpcore
      -{}|{}---------------------------------------------{}|{}----------------------------------------------------------{}|{}------------------------------------------------------------------

      Not much interesting going on in production log

      How reproducible:

      Always

      Is this issue a regression from an earlier version:

      Yes, starting with snap 60

      Steps to Reproduce:

      1. run a scap related command, like the one described above.

      Actual behavior:
      exception

      Expected behavior:
      successful exectuion

      Business Impact / Additional info:

      Found by QE automation

              aruzicka@redhat.com Adam Ruzicka
              pondrejk@redhat.com Peter Ondrejka
              Peter Ondrejka Peter Ondrejka
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: