Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1575382 - "hammer content-view create --composite --component-ids ..." not working in some component-ids combinations
Summary: "hammer content-view create --composite --component-ids ..." not working in s...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer - Content
Version: 6.3.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Roman Plevka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-06 13:03 UTC by dearfriend
Modified: 2019-07-02 17:53 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-02 17:53:39 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description dearfriend 2018-05-06 13:03:01 UTC
Description of problem:

"hammer content-view create --composite --component-ids ..." not working in some component-ids combinations

Version-Release number of selected component (if applicable):
6.3.1

How reproducible:
 
Steps to Reproduce:
1. create 20 or more content-views
2. try to create new composite content-views with component-ids, where one id is combination of other ids.

Examples:
hammer content-view create --organization test --composite --name test --component-ids 24,19,4,3,5,2,7
Could not create the content view:
  Validation failed: Content view components is invalid, Content view components is invalid

But it works with "--component-ids 19,4,3,5,2,7" or "--component-ids 24,19,4,3,5"

When I recreate 24 content-view with id=32, it didn't work too.
It works with new id=33.

Looks like 24,2,4 or 32,3,2 combinations cannot be used together.


Verbose log:
hammer -v content-view create --organization test --composite --name test --component-ids 2,3,4,5,7,19,24
[ERROR 2018-05-06 15:10:22 API] 422 Unprocessable Entity
[ERROR 2018-05-06 15:10:22 Exception] Validation failed: Content view components is invalid, Content view components is invalid
Could not create the content view:
  Validation failed: Content view components is invalid, Content view components is invalid
[ERROR 2018-05-06 15:10:22 Exception] 

RestClient::UnprocessableEntity (422 Unprocessable Entity):
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/abstract_response.rb:74:in `return!'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:352:in `block in rest_client_call_block'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:493:in `process_result'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:421:in `block in transmit'
    /opt/rh/rh-ruby23/root/usr/share/ruby/net/http.rb:853:in `start'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:413:in `transmit'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:176:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/resource.rb:67:in `post'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:324:in `call_client'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:240:in `http_call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:190:in `call_action'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:185:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/resource.rb:21:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/lib/hammer_cli/apipie/command.rb:43:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.11.0.5/lib/hammer_cli_foreman/commands.rb:166:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/lib/hammer_cli/apipie/command.rb:34:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/bin/hammer:147:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'

Comment 1 Brad Buckingham 2018-05-15 16:48:32 UTC
Hi,

Thanks for creating the bugzilla.  Unfortunately, it is difficult to fully understand the scenario, based upon content view ids alone.

Would it be be possible to elaborate on the scenario a bit more?

For example, what are the contents of each of those content views?

Also, are there any errors in the /var/log/foreman/production.log of the Satellite 6 server?

Comment 2 May 2018-05-23 08:34:10 UTC
Hi Bard,

I am facing the exact same issue. Please see description below:
#  hammer -v content-view create --name ccv_Tools  --organization DNB --composite --component-ids 3,7
[ERROR 2018-05-23 10:06:28 API] 422 Unprocessable Entity
[ERROR 2018-05-23 10:06:28 Exception] Validation failed: Content view components is invalid, Content view components is invalid
Could not create the content view:
 Validation failed: Content view components is invalid, Content view components is invalid
[ERROR 2018-05-23 10:06:28 Exception]

 RestClient::UnprocessableEntity (422 Unprocessable Entity):
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/abstract_response.rb:74:in `return!'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:352:in `block in rest_client_call_block'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:493:in `process_result'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:421:in `block in transmit'
    /opt/rh/rh-ruby23/root/usr/share/ruby/net/http.rb:853:in `start'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:413:in `transmit'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:176:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/resource.rb:67:in `post'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:324:in `call_client'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:240:in `http_call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:190:in `call_action'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:185:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/resource.rb:21:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/lib/hammer_cli/apipie/command.rb:43:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.11.0.5/lib/hammer_cli_foreman/commands.rb:166:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/lib/hammer_cli/apipie/command.rb:34:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/lib/hammer_cli/abstract.rb:29:in `run'
   /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
   /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/bin/hammer:147:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'
 
               

From production.log:
2018-05-23 10:13:25 af0f9fd6 [app] [I] Processing by Katello::Api::V2::ContentViewsController#create as JSON
2018-05-23 10:13:25 af0f9fd6 [app] [I]   Parameters: {"name"=>"ccv_DNB_Tools", "composite"=>true, "component_ids"=>["7", "3"], "api_version"=>"v2", "organization_id"=>"1", "content_view"=>{"name"=>"ccv_DNB_Tools", "composite"=>true, "component_ids"=>["7", "3"]}}
2018-05-23 10:13:25 af0f9fd6 [app] [I] Current user: foreman_admin (administrator)
2018-05-23 10:13:25 af0f9fd6 [app] [I] Authorized user admin(Admin User)
2018-05-23 10:13:25 af0f9fd6 [app] [I] Current user: admin (administrator)
2018-05-23 10:13:25 af0f9fd6 [app] [I] Expire fragment views/tabs_and_title_records-3 (0.1ms)
2018-05-23 10:13:25 af0f9fd6 [app] [I] Expire fragment views/tabs_and_title_records-3 (0.1ms)
2018-05-23 10:13:25 af0ffd6 [app] [E] <Class> ActiveRecord::RecordInvalid
2018-05-23 10:13:25 af0f9fd6 [app] [E] content_view_components: ["is invalid", "is invalid"]
2018-05-23 10:13:25 af0f9fd6 [app] [I] Completed 422 Unprocessable Entity in 28ms (Views: 0.3ms | ActiveRecord: 3.5ms)

 
However - creation of CCV works with EITHER of the values:
#  hammer -v content-view create --name ccv_Tools --organization DNB --composite --component-ids 3
Content view created

# hammer content-view delete  --name ccv_Tools --organization DNB
[.............................................................................................................................] [100%]

#  hammer -v content-view create --name ccv_Tools --organization DNB --composite --component-ids 7
Content view created

# More info:
- One CV contains base RHEL (3) and one contains internal RPMs (7)
- Other combinations work just fine.

Comment 3 Brad Buckingham 2018-06-14 20:42:46 UTC
Hi May,

Thank you for the additional example.  Would it be possible for us to log in to your machine (ui and ssh) to debug?

Comment 4 May 2018-06-15 07:55:11 UTC
Hi Brad,

This happened at a customer (not on my lab) which I will return to work with for 4 more days next week, for the final production soe deployment. We might be able to do some remote work but the customer must agree to it. Let me check!

Thanks,
May

Comment 5 Brad Buckingham 2018-06-15 13:52:38 UTC
Hi May,

Thanks for the quick reply.  An internal reproducer would be better, if possible.

Comment 7 May 2018-08-07 11:51:17 UTC
Hi Brad,

I am now at another customer and now facing this issue (with a different error message? -- 404 Resource Not Found) while trying to create a ccv:
[root@ab-satellite scripts]# hammer -v  content-view create --name ccv_Tower --organization Airbus --composite --component-ids 3
[ERROR 2018-08-07 11:20:13 API] 404 Resource Not Found
[ERROR 2018-08-07 11:20:13 Exception] Couldn't find Katello::ContentViewVersion with 'id'=3
Could not create the content view:
  Couldn't find Katello::ContentViewVersion with 'id'=3
[ERROR 2018-08-07 11:20:13 Exception]
 
RestClient::ResourceNotFound (404 Resource Not Found):
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/abstract_response.rb:74:in `return!'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:352:in `block in rest_client_call_block'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:493:in `process_result'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:421:in `block in transmit'
    /opt/rh/rh-ruby23/root/usr/share/ruby/net/http.rb:853:in `start'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:413:in `transmit'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:176:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/resource.rb:67:in `post'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:324:in `call_client'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:240:in `http_call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:190:in `call_action'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/api.rb:185:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.0/lib/apipie_bindings/resource.rb:21:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/lib/hammer_cli/apipie/command.rb:43:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.11.0.6/lib/hammer_cli_foreman/commands.rb:166:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/lib/hammer_cli/apipie/command.rb:34:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.11.0.1/bin/hammer:147:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'

As I am here at the customer I can reproduce it, this time with any number combination. Could you please guide me through a resolution? 
And - since this gives a different error message - would you like me to open a new bug?

Thanks,
May

Comment 8 Bryan Kearney 2019-07-02 17:53:39 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you.


Note You need to log in before you can comment on or make changes to this bug.