Bug 1534215

Summary: Could not able to update Content View
Product: Red Hat Satellite Reporter: Nikhil Kathole <nkathole>
Component: Content ViewsAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, ehelms, oshtaier, paji
Target Milestone: UnspecifiedKeywords: AutomationBlocker, PrioBumpQA, Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:37 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:
Bug Depends On: 1522769    
Bug Blocks:    
Attachments:
Description Flags
screenshot of UI
none
screenshot of UI none

Description Nikhil Kathole 2018-01-14 09:57:53 UTC
Created attachment 1380925 [details]
screenshot of UI

Description of problem: Trying to update content view showed error An error occurred updating the Content View: Cannot add component versions to a non-composite content view.


Version-Release number of selected component (if applicable):Satellite 6.3 snap 32


How reproducible:always


Steps to Reproduce:
1. Create a product with two repos
2. Create a content view
3. Add one repo to content view and publish it
4. Now try to add another repo to same content view

Actual results:

UI showed Error as  An error occurred updating the Content View: is invalid
 An error occurred updating the Content View: Cannot add component versions to a non-composite content view

and production.log showed

 2018-01-14 04:54:07 c3d2be62 [foreman-tasks/action] [E] Validation failed: Content view components is invalid, Cannot add component versions to a n
on-composite content view (ActiveRecord::RecordInvalid)
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/validations.rb:79:in `raise_record_invalid'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/validations.rb:43:in `save!'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:291:in `block in save!'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_statu
s'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `trans
action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:220:in `transaction'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:348:in `with_transaction_returning_status'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:291:in `save!'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/persistence.rb:265:in `block in update!'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:351:in `block in with_transaction_returning_statu
s'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `trans
action'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/transactions.rb:220:in `transaction'



Expected results: 


Additional info: It is Regression

Comment 3 Partha Aji 2018-01-16 20:41:27 UTC
This issue is resolved by the fix for https://bugzilla.redhat.com/show_bug.cgi?id=1522769

Comment 4 Nikhil Kathole 2018-01-22 11:08:57 UTC
VERIFIED

Version tested:
Satellite 6.3 snap 33

Successfully updated the content view.

2018-01-22 06:04:42 a856b740 [app] [I] Started PUT "/katello/api/v2/content_views/5?organization_id=1" for IP at 2018-01-22 06:04:42 -0500
2018-01-22 06:04:42 a856b740 [app] [I] Processing by Katello::Api::V2::ContentViewsController#update as JSON
2018-01-22 06:04:42 a856b740 [app] [I]   Parameters: {"content_host_count"=>0, "composite"=>false, "component_ids"=>[], "default"=>false, "force_puppet_environment"=>false, "version_count"=>2, "latest_version"=>"2.0", "repository_ids"=>[7, 35, 5], "id"=>"5", "name"=>"test_CV", "label"=>"test_CV", "description"=>nil, "organization"=>{"name"=>"Default Organization", "label"=>"Default_Organization", "id"=>1}, "created_at"=>"2018-01-22 07:18:47 UTC", "updated_at"=>"2018-01-22 07:19:54 UTC", "environments"=>[{"id"=>2, "name"=>"DEV", "label"=>"DEV", "permissions"=>{"readable"=>true}}], "repositories"=>[{"id"=>7, "name"=>"capsule7", "label"=>"capsule7", "content_type"=>"yum"}, {"id"=>35, "name"=>"repo1", "label"=>"repo1", "content_type"=>"yum"}], "puppet_modules"=>[], "versions"=>[{"id"=>5, "version"=>"1.0", "published"=>"2018-01-22 07:19:04 UTC", "environment_ids"=>[]}, {"id"=>6, "version"=>"2.0", "published"=>"2018-01-22 07:19:54 UTC", "environment_ids"=>[2]}], "components"=>[], "content_view_components"=>[], "activation_keys"=>[], "next_version"=>"3.0", "last_published"=>"2018-01-22 07:19:54 UTC", "permissions"=>{"view_content_views"=>true, "edit_content_views"=>true, "destroy_content_views"=>true, "publish_content_views"=>true, "promote_or_remove_content_views"=>true}, "organization_id"=>"1", "api_version"=>"v2", "content_view"=>{"id"=>"5", "name"=>"test_CV", "label"=>"test_CV", "description"=>nil, "default"=>false, "created_at"=>"2018-01-22 07:18:47 UTC", "updated_at"=>"2018-01-22 07:19:54 UTC", "composite"=>false, "next_version"=>"3.0", "force_puppet_environment"=>false, "repository_ids"=>[7, 35, 5], "component_ids"=>[]}}
2018-01-22 06:04:42 a856b740 [app] [I] Current user: admin (administrator)
2018-01-22 06:04:42 a856b740 [app] [I] Expire fragment views/tabs_and_title_records-3 (0.2ms)
2018-01-22 06:04:42 a856b740 [app] [I]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.54/app/views/katello/api/v2/common/update.json.rabl within katello/api/v2/layouts/resource (30.4ms)
2018-01-22 06:04:42 a856b740 [app] [I] Completed 200 OK in 225ms (Views: 27.9ms | ActiveRecord: 24.2ms)
2018-01-22 06:04:43 29f7d7ef [app] [I] Started GET "/katello/api/v2/repositories?available_for=content_view&content_type=yum&content_view_id=5&full_result=true&library=true&organization_id=1&page=1&paged=true&per_page=20&search=" for IP at 2018-01-22 06:04:43 -0500
2018-01-22 06:04:43 29f7d7ef [app] [I] Processing by Katello::Api::V2::RepositoriesController#index as JSON
2018-01-22 06:04:43 29f7d7ef [app] [I]   Parameters: {"available_for"=>"content_view", "content_type"=>"yum", "content_view_id"=>"5", "full_result"=>"true", "library"=>"true", "organization_id"=>"1", "page"=>"1", "paged"=>"true", "per_page"=>"20", "search"=>"", "api_version"=>"v2"}
2018-01-22 06:04:43 29f7d7ef [app] [I] Current user: admin (administrator)
2018-01-22 06:04:43 29f7d7ef [app] [I] Expire fragment views/tabs_and_title_records-3 (0.2ms)
2018-01-22 06:04:43 29f7d7ef [app] [I]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.54/app/views/katello/api/v2/repositories/index.json.rabl within katello/api/v2/layouts/collection (318.6ms)
2018-01-22 06:04:43 29f7d7ef [app] [I] Completed 200 OK in 341ms (Views: 204.7ms | ActiveRecord: 118.8ms)

Comment 5 Nikhil Kathole 2018-01-22 11:09:25 UTC
Created attachment 1384348 [details]
screenshot of UI

Comment 6 Satellite Program 2018-02-21 16:54:37 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> > 
> > For information on the advisory, and where to find the updated files, follow the link below.
> > 
> > If the solution does not work for you, open a new bug report.
> > 
> > https://access.redhat.com/errata/RHSA-2018:0336