Bug 1186445

Summary: puppet repo publish with install_path set, installs to wrong directory
Product: Red Hat Satellite Reporter: Justin Sherrill <jsherril>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: Tazim Kolhar <tkolhar>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: bbuckingham, bcourt, bmbouter, cwelton, daviddavis, dkliban, ggainey, ipanova, mhrivnak, mmccune, pcreech, pthomas, rchan, tkolhar, ttereshc
Target Milestone: UnspecifiedKeywords: Reopened, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-12 13:59:17 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:    
Bug Blocks: 1145795, 1190693    
Attachments:
Description Flags
In yaml format none

Description Justin Sherrill 2015-01-27 16:48:05 UTC
Description of problem:

Publishing a puppet repo with an install path causes repo to be 'installed' to the wrong directory.  

For example, given this distributor config:

{"repo_id"=>"Default_Organization-Library-puppet1comp", "_ns"=>"repo_distributors", "last_publish"=>"2015-01-27T14:08:31Z", "auto_publish"=>true, "scheduled_publishes"=>[], "distributor_type_id"=>"puppet_install_distributor", "_id"=>{"$oid"=>"54c79bdd5ca01357c0612249"}, "config"=>{"install_path"=>"/etc/puppet/environments/KT_Default_Organization_Library_puppet1comp_12/modules", "auto_publish"=>true}, "id"=>"Default_Organization-Library-puppet1comp"}

it gets published to:

/etc/puppet/environments/KT_Default_Organization_Library_puppet1comp_12/pulp1bKXUS/


Version-Release number of selected component (if applicable):
pulp-puppet-plugins-2.5.1-1.el6.noarch
pulp-server-2.5.1-1.el6.noarch

How reproducible:
Always

Steps to Reproduce:
1.  Create a puppet repo with an install_path set to some path: /etc/puppet/environments/foo/modules
2.  Upload one or more puppet modules 
3.  Examine the install path to verify that the modules made it there

Actual results:
modules are not there, but are in one directory up in a randomly named directory.

Expected results:
puppet modules are deployed to /etc/puppet/environments/foo/module

Comment 1 Justin Sherrill 2015-01-27 16:51:07 UTC
In my Steps to reproduce, i forgot a  step:

2.5. Publish the puppet distributor for this puppet repo.

Comment 2 Justin Sherrill 2015-01-27 18:14:37 UTC
Its odd because in my case the task shows a failure (see the attached text file), but the task in pulp shows as success:

Operations:  publish
Resources:   Default_Organization-Library-mycontentview (repository)
State:       Successful
Start Time:  2015-01-27T18:07:03Z
Finish Time: 2015-01-27T18:07:03Z
Task Id:     f8088fd2-139c-4092-9c2b-66168b45455a

Comment 3 Justin Sherrill 2015-01-27 18:14:55 UTC
Created attachment 984810 [details]
In yaml format

Comment 4 Justin Sherrill 2015-01-27 18:19:24 UTC
the relevant part of the task: 

    summary: ! 'failed to clear destination directory: [Errno 2] No such file or directory:
      ''/etc/puppet/environments/KT_Default_Organization_Library_mycontentview_2/modules'''

but i see no errors in /var/log/messages during the publish, just:

Jan 27 13:07:03 localhost pulp: pulp.server.managers.repo.publish:INFO: publish failed for repo [Default_Organization-Library-mycontentview] with distributor ID [Default_Organization-Library-mycontentview]

Comment 5 Barnaby Court 2015-01-28 21:14:33 UTC
https://github.com/pulp/pulp_puppet/pull/161

Comment 6 Barnaby Court 2015-01-28 21:18:38 UTC
A second bug has been opened for the failure to mark the task as failed: https://bugzilla.redhat.com/show_bug.cgi?id=1186920

Comment 7 Chris Duryee 2015-02-10 22:32:58 UTC
2.6.0-0.7.beta

Comment 8 Preethi Thomas 2015-02-20 19:55:50 UTC
[root@rhsm-jenkins ~]# rpm -qa pulp-server
pulp-server-2.6.0-0.7.beta.el6.noarch
[root@rhsm-jenkins ~]# 


verified

>>> pic.POST('/v2/repositories/forge/distributors/', {'distributor_type_id':'puppet_install_distributor', 'distributor_id':'puppet_install_distributor', 'auto_publish': False, 'distributor_config': {'install_path':'/etc/puppet/modules/'}})


[root@rhsm-jenkins ~]# ls -l /etc/puppet/
total 12
-rwxrwxrwx. 1 root root 2569 Jan 19 08:32 auth.conf
drwxrwxrwx. 3 root root 4096 Feb 20 14:52 modules
-rwxrwxrwx. 1 root root  853 Jun 10  2014 puppet.conf
[root@rhsm-jenkins ~]# ls -l /etc/puppet/modules/
total 4
drwxr-xr-x. 7 apache apache 4096 Feb 10 14:09 mysql
[root@rhsm-jenkins ~]# 


[root@rhsm-jenkins ~]# puppet module list
Warning: Missing dependency 'nanliu-staging':
  'puppetlabs-mysql' (v3.2.0) requires 'nanliu-staging' (v1.x)
Warning: Missing dependency 'puppetlabs-stdlib':
  'puppetlabs-mysql' (v3.2.0) requires 'puppetlabs-stdlib' (>= 3.2.0 < 5.0.0)
/etc/puppet/modules
└── puppetlabs-mysql (v3.2.0)

Comment 9 Brian Bouterse 2015-02-28 23:22:02 UTC
Moved to https://pulp.plan.io/issues/680

Comment 10 RHEL Program Management 2015-03-03 20:19:32 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 12 Mike McCune 2015-03-12 23:09:29 UTC
we are running with pulp-server-2.6.0-0.7.beta.1.el6_6sat.noarch which includes this fix

Comment 13 Tazim Kolhar 2015-03-26 14:35:02 UTC
VERIFIED:

# rpm -qa | grep foreman
foreman-debug-1.7.2.13-1.el7sat.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el7sat.noarch
rubygem-hammer_cli_foreman-0.1.4.6-1.el7sat.noarch
foreman-ovirt-1.7.2.13-1.el7sat.noarch
foreman-proxy-1.7.2.4-1.el7sat.noarch
dhcp201-150.englab.pnq.redhat.com-foreman-client-1.0-1.noarch
dhcp201-150.englab.pnq.redhat.com-foreman-proxy-1.0-2.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.3-1.el7sat.noarch
foreman-compute-1.7.2.13-1.el7sat.noarch
foreman-libvirt-1.7.2.13-1.el7sat.noarch
ruby193-rubygem-foreman_docker-1.2.0.6-1.el7sat.noarch
ruby193-rubygem-foreman-redhat_access-0.0.9-1.el7sat.noarch
foreman-selinux-1.7.2.8-1.el7sat.noarch
dhcp201-150.englab.pnq.redhat.com-foreman-proxy-client-1.0-1.noarch
foreman-discovery-image-2.1.0-9.el7sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.1.2.5-1.el7sat.noarch
foreman-vmware-1.7.2.13-1.el7sat.noarch
ruby193-rubygem-foreman-tasks-0.6.12.3-1.el7sat.noarch
ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el7sat.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2.9-1.el7sat.noarch
foreman-gce-1.7.2.13-1.el7sat.noarch
foreman-1.7.2.13-1.el7sat.noarch
ruby193-rubygem-foreman_discovery-2.0.0.8-1.el7sat.noarch
foreman-postgresql-1.7.2.13-1.el7sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.3-1.el7sat.noarch

[ puppetdb]# ls
CHANGELOG       lib      manifests      NOTICE     templates
checksums.json  LICENSE  metadata.json  README.md

Comment 14 pulp-infra@redhat.com 2015-04-23 16:39:52 UTC
The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug.

Comment 15 Bryan Kearney 2015-08-11 13:34:15 UTC
This bug is slated to be released with Satellite 6.1.

Comment 16 Bryan Kearney 2015-08-12 13:59:17 UTC
This bug was fixed in version 6.1.1 of Satellite which was released on 12 August, 2015.