Bug 1702465

Summary: Unable to change Mirror-on-Sync for redhat repos
Product: Red Hat Satellite Reporter: Sean O'Keeffe <sokeeffe>
Component: RepositoriesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: vijsingh
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.5.0   
Target Milestone: Unspecified   
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: 2019-05-01 17:51:05 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 Sean O'Keeffe 2019-04-23 20:38:19 UTC
Description of problem:
Setting "Mirror-on-Sync" from the UI on a Red Hat repo to false results in an error "An error occurred saving the Repository: Upstream username and password may only be set on custom repositories."

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

How reproducible:
100%

Steps to Reproduce:
1. enable a RH repo
2. try to change mirror on sync setting from the UI

Actual results:
"An error occurred saving the Repository: Upstream username and password may only be set on custom repositories."

Expected results:
To change the setting


Additional info:
2019-04-23T11:07:40 [I|app|] Started PUT "/katello/api/v2/repositories/5?organization_id=1" for 66.187.232.65 at 2019-04-23 11:07:40 -0400
2019-04-23T11:07:40 [I|app|51e1687b] Processing by Katello::Api::V2::RepositoriesController#update as JSON
2019-04-23T11:07:40 [I|app|51e1687b]   Parameters: {"ostree_branches"=>[], "relative_path"=>"Example_com/Library/content/dist/rhel/server/7/7Server/x86_64/sat-tools/6.4/os", "promoted"=>true, "content_view_versi
on_id"=>1, "library_instance_id"=>nil, "organization"=>{"name"=>"Example.com", "label"=>"Example_com", "id"=>1}, "created_at"=>"2018-11-15 09:56:24 -0500", "updated_at"=>"2019-02-19 09:12:26 -0500", "backend_ide
ntifier"=>"ca201330-b13a-495f-a58f-6636a873f31c", "container_repository_name"=>nil, "full_path"=>"https://sat.example.com/pulp/repos/Example_com/Library/content/dist/rhel/server/7/7Server/x86_64/sat-tools/6.4/os
/", "id"=>"5", "name"=>"Red Hat Satellite Tools 6.4 for RHEL 7 Server RPMs x86_64", "label"=>"Red_Hat_Satellite_Tools_6_4_for_RHEL_7_Server_RPMs_x86_64", "description"=>nil, "last_sync"=>{"id"=>"ededa1b4-dfeb-42
a9-9cf2-be98ff28f817", "username"=>"foreman_admin", "started_at"=>"2019-04-22 20:00:11 -0400", "ended_at"=>"2019-04-22 20:00:30 -0400", "state"=>"stopped", "result"=>"success", "progress"=>1}, "content_view"=>{"
id"=>1, "name"=>"Default Organization View"}, "content_type"=>"yum", "url"=>"https://cdn.redhat.com/content/dist/rhel/server/7/7Server/x86_64/sat-tools/6.4/os", "arch"=>"x86_64", "content_id"=>"7751", "major"=>n
il, "minor"=>nil, "product"=>{"id"=>1, "cp_id"=>"69", "name"=>"Red Hat Enterprise Linux Server", "orphaned"=>false, "redhat"=>true, "sync_plan"=>["name", "description", "sync_date", "interval", "next_sync"]}, "c
ontent_label"=>"rhel-7-server-satellite-tools-6.4-rpms", "content_counts"=>{"ostree_branch"=>0, "docker_manifest"=>0, "docker_manifest_list"=>0, "docker_tag"=>0, "rpm"=>73, "srpm"=>0, "package"=>73, "package_gro
up"=>1, "erratum"=>3, "puppet_module"=>0, "file"=>0, "deb"=>0, "module_stream"=>0}, "last_sync_words"=>"about 15 hours", "environment"=>{"id"=>1, "registry_unauthenticated_pull"=>false}, "docker_upstream_name"=>
nil, "docker_tags_whitelist"=>[], "mirror_on_sync"=>false, "verify_ssl_on_sync"=>true, "unprotected"=>false, "checksum_type"=>"sha256", "download_policy"=>"immediate", "gpg_key_id"=>nil, "ssl_ca_cert_id"=>nil, "
ssl_client_cert_id"=>nil, "ssl_client_key_id"=>nil, "upstream_username"=>nil, "ostree_upstream_sync_policy"=>nil, "ostree_upstream_sync_depth"=>nil, "computed_ostree_upstream_sync_depth"=>0, "deb_releases"=>nil,
 "deb_components"=>nil, "deb_architectures"=>nil, "ignore_global_proxy"=>false, "ignorable_content"=>nil, "gpg_key"=>nil, "ssl_ca_cert"=>{"id"=>nil, "name"=>nil}, "ssl_client_cert"=>{"id"=>nil, "name"=>nil}, "ss
l_client_key"=>{"id"=>nil, "name"=>nil}, "permissions"=>{"deletable"=>false}, "upstream_password_exists"=>"[FILTERED]", "upstream_auth_exists"=>false, "commaTagsWhitelist"=>"", "upstream_password"=>"[FILTERED]",
 "organization_id"=>"1", "api_version"=>"v2", "repository"=>{"id"=>"5", "name"=>"Red Hat Satellite Tools 6.4 for RHEL 7 Server RPMs x86_64", "created_at"=>"2018-11-15 09:56:24 -0500", "updated_at"=>"2019-02-19 0
9:12:26 -0500", "major"=>nil, "minor"=>nil, "gpg_key_id"=>nil, "content_id"=>"7751", "arch"=>"x86_64", "label"=>"Red_Hat_Satellite_Tools_6_4_for_RHEL_7_Server_RPMs_x86_64", "url"=>"https://cdn.redhat.com/content
/dist/rhel/server/7/7Server/x86_64/sat-tools/6.4/os", "unprotected"=>false, "content_type"=>"yum", "checksum_type"=>"sha256", "docker_upstream_name"=>nil, "mirror_on_sync"=>false, "download_policy"=>"immediate",
 "verify_ssl_on_sync"=>true, "upstream_username"=>nil, "upstream_password"=>"[FILTERED]", "ostree_upstream_sync_policy"=>nil, "ostree_upstream_sync_depth"=>nil, "deb_releases"=>nil, "deb_components"=>nil, "deb_a
rchitectures"=>nil, "ignore_global_proxy"=>false, "ssl_ca_cert_id"=>nil, "ssl_client_cert_id"=>nil, "ssl_client_key_id"=>nil, "ignorable_content"=>nil, "docker_tags_whitelist"=>[], "description"=>nil}}
2019-04-23T11:07:40 [I|app|51e1687b] Current user set to admin (admin)
2019-04-23T11:07:40 [E|bac|51e1687b] Validation failed: Upstream username and password may only be set on custom repositories. (ActiveRecord::RecordInvalid)
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/validations.rb:80:in `raise_validation_error'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/validations.rb:52:in `save!'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:315:in `block in save!'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:387:in `block in with_transaction_returning_status'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:252:in `transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:212:in `transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:385:in `with_transaction_returning_status'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:315:in `save!'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/suppressor.rb:48:in `save!'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/persistence.rb:441:in `block in update!'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:387:in `block in with_transaction_returning_status'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:252:in `transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:212:in `transaction'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/transactions.rb:385:in `with_transaction_returning_status'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activerecord-5.2.1/lib/active_record/persistence.rb:439:in `update!'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.10.0.23/app/lib/actions/katello/repository/update.rb:10:in `plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/action.rb:493:in `block (3 levels) in execute_plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:26:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware.rb:18:in `pass'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware.rb:35:in `plan'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:22:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.1.6/lib/dynflow/middleware/stack.rb:26:in `pass'
<SNIP>

Comment 3 Brad Buckingham 2019-05-01 17:51:05 UTC

*** This bug has been marked as a duplicate of bug 1674463 ***