Bug 1400918

Summary: Error publishing new version of content view when containing a yum repository
Product: Red Hat Satellite Reporter: Djebran Lezzoum <dlezzoum>
Component: WebUIAssignee: satellite6-bugs <satellite6-bugs>
WebUI sub component: Foreman QA Contact: Katello QA List <katello-qa-list>
Status: CLOSED DUPLICATE Docs Contact:
Severity: urgent    
Priority: unspecified CC: sghai
Version: 6.2.5   
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-02 11:57:44 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:

Description Djebran Lezzoum 2016-12-02 10:03:05 UTC
Description of problem:
Error publishing new version of content view when containing a yum repository

Version-Release number of selected component (if applicable):
* candlepin-0.9.54.14-1.el7.noarch
* candlepin-selinux-0.9.54.14-1.el7.noarch
* foreman-1.11.0.59-1.el7sat.noarch
* foreman-compute-1.11.0.59-1.el7sat.noarch
* foreman-debug-1.11.0.59-1.el7sat.noarch
* foreman-discovery-image-3.1.1-18.el7sat.noarch
* foreman-ec2-1.11.0.59-1.el7sat.noarch
* foreman-gce-1.11.0.59-1.el7sat.noarch
* foreman-installer-1.11.0.10-1.el7sat.noarch
* foreman-installer-katello-3.0.0.64-1.el7sat.noarch
* foreman-libvirt-1.11.0.59-1.el7sat.noarch
* foreman-openstack-1.11.0.59-1.el7sat.noarch
* foreman-ovirt-1.11.0.59-1.el7sat.noarch
* foreman-postgresql-1.11.0.59-1.el7sat.noarch
* foreman-proxy-1.11.0.7-1.el7sat.noarch
* foreman-rackspace-1.11.0.59-1.el7sat.noarch
* foreman-selinux-1.11.0.2-1.el7sat.noarch
* foreman-vmware-1.11.0.59-1.el7sat.noarch
* katello-3.0.0-14.el7sat.noarch
* katello-certs-tools-2.4.0-1.el7sat.noarch
* katello-client-bootstrap-1.2.0-4.el7sat.noarch
* katello-common-3.0.0-14.el7sat.noarch
* katello-debug-3.0.0-14.el7sat.noarch
* katello-default-ca-1.0-1.noarch
* katello-installer-base-3.0.0.64-1.el7sat.noarch
* katello-selinux-3.0.1.2-1.el7sat.noarch
* katello-server-ca-1.0-1.noarch
* katello-service-3.0.0-14.el7sat.noarch
* openldap-2.4.40-13.el7.x86_64
* pulp-client-1.0-1.noarch
* pulp-docker-plugins-2.0.3-1.el7sat.noarch
* pulp-katello-1.0.1-1.el7sat.noarch
* pulp-ostree-plugins-1.1.3.1-1.el7sat.noarch
* pulp-puppet-plugins-2.8.7.1-1.el7sat.noarch
* pulp-puppet-tools-2.8.7.1-1.el7sat.noarch
* pulp-rpm-plugins-2.8.7.5-1.el7sat.noarch
* pulp-selinux-2.8.7.3-1.el7sat.noarch
* pulp-server-2.8.7.3-1.el7sat.noarch
* python-ldap-2.4.15-2.el7.x86_64
* tfm-rubygem-ldap_fluff-0.4.3-1.el7sat.noarch
* tfm-rubygem-net-ldap-0.13.0-1.el7sat.noarch


How reproducible:
Always

Steps to Reproduce:
1.Create product1 
2.Create a yum repo1 to product1 and sync the repo1
3.Create a new content view cv1
4.Add to content view cv1 the yum repo1
5.Publish content view cv1
6.Content view cv1 is successfully published with Version 1.0
7.an other time Publish content view cv1 
8. the content view cv1 is not published

Actual results:
the new version of content view is not published with an error message:
"wrong number of arguments (2 for 1)"


Expected results:
The new version of content view is published successfully with a message: 
"Successfully published cv1 version 2.0 and promoted to Library"


Additional info:
1.Tests has been done adding to content view an other product2 yum repo2 before publishing the second version, but the tests lead to the same error.  
2.The new version of content view is successfully published under satellite versions 6.2.4 and 6.3

Comment 2 Sachin Ghai 2016-12-02 10:50:11 UTC
Yes, Its reproducible with sat6.2.5 snap1 when re-publishing a cv.


2016-12-02 05:48:35 [app] [I] Started POST "/katello/api/v2/content_views/3/publish?organization_id=1" for 10.65.223.113 at 2016-12-02 05:48:35 -0500
2016-12-02 05:48:35 [app] [I] Processing by Katello::Api::V2::ContentViewsController#publish as JSON
2016-12-02 05:48:35 [app] [I]   Parameters: {"id"=>"3", "organization_id"=>"1", "api_version"=>"v2", "content_view"=>{"id"=>"3"}}
2016-12-02 05:48:36 [foreman-tasks/action] [E] wrong number of arguments (2 for 1) (ArgumentError)
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.86/app/models/katello/glue/pulp/repo.rb:802:in `distributors_match?'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.86/app/models/katello/glue/pulp/repo.rb:75:in `block in needs_distributor_updates'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.86/app/models/katello/glue/pulp/repo.rb:72:in `select'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.86/app/models/katello/glue/pulp/repo.rb:72:in `needs_distributor_updates'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.86/app/lib/actions/katello/repository/clone_to_environment.rb:18:in `block in plan'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.1/lib/dynflow/execution_plan.rb:281:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.1/lib/dynflow/execution_plan.rb:281:in `switch_flow'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.1/lib/dynflow/action.rb:369:in `sequence'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.86/app/lib/actions/katello/repository/clone_to_environment.rb:10:in `plan'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.1/lib/dynflow/action.rb:461:in `block (3 levels) in execute_plan'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.1/lib/dynflow/middleware/stack.rb:26:in `call'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.1/lib/dynflow/middleware/stack.rb:26:in `pass'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.1/lib/dynflow/middleware.rb:17:in `pass'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.1/lib/dynflow/middleware.rb:34:in `plan'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-0.8.13.1/lib/dynflow/middleware/stack.rb:22:in `call'

Comment 4 Djebran Lezzoum 2016-12-02 11:57:44 UTC

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