Bug 1285491

Summary: Collection Actions throwing the error "At least one content host needs to be selected in order to perform a bulk action"
Product: Red Hat Satellite Reporter: Leo Thomas <lthomas>
Component: OtherAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WORKSFORME QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1.4CC: bkearney, nshaik, pmutha
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-10 17:52:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Leo Thomas 2015-11-25 18:01:31 UTC
Description of problem:

'Collection Actions' throwing the error  "At least one content host needs to be selected in order to perform a bulk action." even after adding 'Content Hosts' to the 'Host Collections'. This error is seen when 'Host Collection' is created with name "IT". If "Host Collection" is created with different name, this error is not hitting. 

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

Satellite 6.1.4

How reproducible:

100% reproducible

Steps to Reproduce:
1. Create a 'Host Collections' with name "IT".
2. Add 'Content Host' to the 'Host Collections'
3. Hit on 'Collection Actions' tab and select any action. 

Actual results:

It will throw the following error :-

At least one content host needs to be selected in order to perform a bulk action. 

Expected results:

It should allow the actions to perform since the 'Content Hosts' is already added.

Additional info:

Following logs are captured :-

Created Host Collections called 'IT'

==> /var/log/foreman/production.log <==
2015-11-25 12:42:13 [I] Connecting to database specified by database.yml
2015-11-25 12:42:14 [I] Processing by Katello::Api::V2::HostCollectionsController#create as JSON
2015-11-25 12:42:14 [I]   Parameters: {"unlimited_content_hosts"=>true, "name"=>"IT", "organization_id"=>"1", "api_version"=>"v2", "host_collection"=>{"name"=>"IT", "organization_id"=>"1", "unlimited_content_hosts"=>true}}
2015-11-25 12:42:15 [I]   Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.76/app/views/katello/api/v2/host_collections/create.json.rabl within katello/api/v2/layouts/resource (7.1ms)
2015-11-25 12:42:15 [I] Completed 200 OK in 536ms (Views: 305.6ms | ActiveRecord: 16.4ms)

Added content hosts to host collections.

==> /var/log/foreman/production.log <==
2015-11-25 12:43:28 [I] Processing by Katello::Api::V2::HostCollectionsController#add_systems as JSON
2015-11-25 12:43:28 [I]   Parameters: {"id"=>"5", "system_ids"=>["db04ed08-872e-434e-8d42-f487b0441904", "bf5def0b-7549-45ea-b2e1-9705630ce6f6"], "api_version"=>"v2", "host_collection"=>{"id"=>"5", "system_ids"=>["db04ed08-872e-434e-8d42-f487b0441904", "bf5def0b-7549-45ea-b2e1-9705630ce6f6"]}}
2015-11-25 12:43:28 [I]   Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.76/app/views/katello/api/v2/common/bulk_action.json.rabl within katello/api/v2/layouts/resource (1.2ms)
2015-11-25 12:43:28 [I] Completed 200 OK in 189ms (Views: 5.7ms | ActiveRecord: 14.8ms)
2015-11-25 12:43:28 [I] Processing by Katello::Api::V2::SystemsController#index as JSON
2015-11-25 12:43:28 [I]   Parameters: {"organization_id"=>"1", "page"=>"1", "paged"=>"true", "search"=>"NOT ( host_collection_ids:5 )", "sort_by"=>"name", "sort_order"=>"ASC", "api_version"=>"v2"}
2015-11-25 12:43:28 [I] Processing by Katello::Api::V2::HostCollectionsController#show as JSON
2015-11-25 12:43:28 [I]   Parameters: {"fields"=>"full", "api_version"=>"v2", "id"=>"5"}
2015-11-25 12:43:28 [I]   Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.76/app/views/katello/api/v2/host_collections/show.json.rabl within katello/api/v2/layouts/resource (18.8ms)
2015-11-25 12:43:28 [I] Completed 200 OK in 26ms (Views: 19.5ms | ActiveRecord: 1.4ms)
2015-11-25 12:43:29 [I]   Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.76/app/views/katello/api/v2/systems/index.json.rabl within katello/api/v2/layouts/collection (270.4ms)
2015-11-25 12:43:29 [I] Completed 200 OK in 308ms (Views: 258.6ms | ActiveRecord: 17.0ms)


Logs captured when selecting any of the 'Collection Actions'


172.17.13.1 - - [25/Nov/2015:12:45:12 -0500] "GET /content-hosts/views/content-hosts-table-collapsed.html HTTP/1.1" 304 - "https://satellite6.example.com/content_hosts/bulk-actions/packages?select_all=true&search=host_collection:%22IT%22" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0"
172.17.13.1 - - [25/Nov/2015:12:45:12 -0500] "GET /content-hosts/views/content-hosts.html HTTP/1.1" 304 - "https://satellite6.example.com/content_hosts/bulk-actions/packages?select_all=true&search=host_collection:%22IT%22" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0"
172.17.13.1 - - [25/Nov/2015:12:45:12 -0500] "GET /content-hosts/bulk/views/bulk-actions.html HTTP/1.1" 304 - "https://satellite6.example.com/content_hosts/bulk-actions/packages?select_all=true&search=host_collection:%22IT%22" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0"
172.17.13.1 - - [25/Nov/2015:12:45:12 -0500] "GET /content-hosts/bulk/views/bulk-actions-packages.html HTTP/1.1" 304 - "https://satellite6.example.com/content_hosts/bulk-actions/packages?select_all=true&search=host_collection:%22IT%22" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0"
172.17.13.1 - - [25/Nov/2015:12:45:12 -0500] "GET /layouts/select-all-results.html HTTP/1.1" 304 - "https://satellite6.example.com/content_hosts/bulk-actions/packages?select_all=true&search=host_collection:%22IT%22" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0"
172.17.13.1 - - [25/Nov/2015:12:45:12 -0500] "GET /katello/api/v2/systems?organization_id=1&page=1&search=host_collection:%22IT%22&sort_by=name&sort_order=ASC HTTP/1.1" 304 - "https://satellite6.example.com/content_hosts/bulk-actions/packages?select_all=true&search=host_collection:%22IT%22" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0"
172.17.13.1 - - [25/Nov/2015:12:45:12 -0500] "GET /katello/api/v2/systems?organization_id=1&page=1&search=host_collection:%22IT%22&sort_by=name&sort_order=ASC HTTP/1.1" 304 - "https://satellite6.example.com/content_hosts/bulk-actions/packages?select_all=true&search=host_collection:%22IT%22" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0"

==> /var/log/foreman/production.log <==
2015-11-25 12:45:12 [I] Connected to server.
2015-11-25 12:45:12 [I] Processing by Katello::Api::V2::SystemsController#index as JSON
2015-11-25 12:45:12 [I]   Parameters: {"organization_id"=>"1", "page"=>"1", "search"=>"host_collection:\"IT\"", "sort_by"=>"name", "sort_order"=>"ASC", "api_version"=>"v2"}
2015-11-25 12:45:12 [I]   Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.76/app/views/katello/api/v2/systems/index.json.rabl within katello/api/v2/layouts/collection (1.3ms)
2015-11-25 12:45:12 [I] Completed 200 OK in 26ms (Views: 2.1ms | ActiveRecord: 2.4ms)
2015-11-25 12:45:12 [I] Processing by Katello::Api::V2::SystemsController#index as JSON
2015-11-25 12:45:12 [I]   Parameters: {"organization_id"=>"1", "page"=>"1", "search"=>"host_collection:\"IT\"", "sort_by"=>"name", "sort_order"=>"ASC", "api_version"=>"v2"}
2015-11-25 12:45:12 [I]   Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0.76/app/views/katello/api/v2/systems/index.json.rabl within katello/api/v2/layouts/collection (1.2ms)
2015-11-25 12:45:12 [I] Completed 200 OK in 21ms (Views: 2.1ms | ActiveRecord: 1.8ms)
2015-11-25 12:45:13 [I] Client connected.

Comment 2 Bryan Kearney 2015-12-10 21:59:41 UTC
Clearing flags to make sure it gets triaged.

Comment 4 Bryan Kearney 2016-07-26 19:09:36 UTC
Moving 6.2 bugs out to sat-backlog.

Comment 6 Nagoor Shaik 2018-07-10 15:57:27 UTC
Hi Bryan,

Not able to reproduce in the current release. I think we can close this BZ out.

Comment 7 Bryan Kearney 2018-07-10 17:52:30 UTC
Closing per Comment 6.