Bug 889320 - puppet repo sync on a fresh installed vm fails with permission error
Summary: puppet repo sync on a fresh installed vm fails with permission error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: puppet-support
Version: 2.0.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 2.0.7
Assignee: Sayli Karmarkar
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-12-20 19:48 UTC by Preethi Thomas
Modified: 2015-03-23 01:11 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-04-08 15:59:36 UTC


Attachments (Terms of Use)

Description Preethi Thomas 2012-12-20 19:48:21 UTC
Description of problem:


[root@pulp-v2-testing ~]#  pulp-admin puppet repo sync run  --repo-id puppet-repo
+----------------------------------------------------------------------+
                 Synchronizing Repository [puppet-repo]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

Downloading metadata...
[==================================================] 100%
Metadata Query: 2/2 items
... completed

Downloading new modules...
[==================================================] 100%
Module: 24/24 items
... completed

Publishing modules...
[==================================================] 100%
Module: 24/24 items
... completed

Generating repository metadata...
[-]
... failed


The following error was encountered during the previous step. More information
can be found in ~/.pulp/admin.log


  None

[root@pulp-v2-testing ~]# 


From pulp.log


2012-12-20 13:21:23,794 pulp_puppet.plugins.distributors.publish:ERROR: Exception during metadata generation step for repository <puppet-repo>
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp_puppet/plugins/distributors/publish.py", line 148, in _metadata_step
    self._copy_to_published()
  File "/usr/lib/python2.7/site-packages/pulp_puppet/plugins/distributors/publish.py", line 291, in _copy_to_published
    shutil.copytree(build_dir, repo_dest_dir, symlinks=True)
  File "/usr/lib64/python2.7/shutil.py", line 175, in copytree
    os.makedirs(dst)
  File "/usr/lib64/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/usr/lib64/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/var/www/pulp_puppet/http/repos'
2012-12-20 13:21:23,861 pulp.server.dispatch.task:INFO: SUCCESS: Task cc3b45ca-0a24-46f6-ad25-ff9a1260253b: CallRequest: RepoPublishManager.publish(u'puppet-repo', u'puppet_distributor', distributor_instance=<pulp_puppet.plugins.distributors.distributor.PuppetModuleDistributor object at 0x7ff18b22d350>, distributor_config={'https_dir': '/var/www/pulp_puppet/https/repos', 'http_dir': '/var/www/pulp_puppet/http/repos'})



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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Michael Hrivnak 2012-12-20 22:58:03 UTC
I am not able to reproduce this on a rhel6 machine upgraded from a previous beta build. selinux is enforcing, and I have installed pulp-selinux. My steps:

- deleted all puppet repos and orphans
- uninstalled pulp-puppet-plugins
- restarted apache
- deleted /var/www/pulp_puppet
- installed pulp-puppet-plugins
- restarted apache
- created and synced a new puppet repo

The auto-publish did not complain.

Comment 2 Sayli Karmarkar 2012-12-21 02:05:51 UTC
Since puppet repos are published from outside /var/www/pub directory, selinux was failing write access to /var/www/pulp_puppet.

I have added selinux rules to change context and restore context. 

# pulp-admin puppet repo sync run --repo-id test-puppet-repo
+----------------------------------------------------------------------+
              Synchronizing Repository [test-puppet-repo]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

Downloading metadata...
[==================================================] 100%
Metadata Query: 2/2 items
... completed

Downloading new modules...
[==================================================] 100%
Module: 0/0 items
... completed

Publishing modules...
[==================================================] 100%
Module: 28/28 items
... completed

Generating repository metadata...
[-]
... completed

Publishing repository over HTTP...
... completed

Publishing repository over HTTPS...
... completed

# ls -laZ /var/www/pulp_puppet/
drwxr-xr-x. apache apache system_u:object_r:httpd_sys_rw_content_t:s0 .
drwxr-xr-x. root   root   system_u:object_r:httpd_sys_content_t:s0 ..
drwxr-xr-x. apache apache system_u:object_r:httpd_sys_rw_content_t:s0 http
drwxr-xr-x. apache apache system_u:object_r:httpd_sys_rw_content_t:s0 https

Comment 3 Jeff Ortel 2013-01-11 19:29:56 UTC
build: 2.0.7-0.1.beta

Comment 4 Preethi Thomas 2013-01-15 15:52:12 UTC
verified

[root@pulp-v2-testing ~]# pulp-admin puppet repo create --repo-id puppet-repo --feed http://forge.puppetlabs.com/ --query mysql --query httpd
Successfully created repository [puppet-repo]

[root@pulp-v2-testing ~]# pulp-admin puppet repo sync run  --repo-id puppet-repo
+----------------------------------------------------------------------+
                 Synchronizing Repository [puppet-repo]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

Downloading metadata...
[==================================================] 100%
Metadata Query: 2/2 items
... completed

Downloading new modules...
[==================================================] 100%
Module: 25/25 items
... completed

Publishing modules...
[==================================================] 100%
Module: 25/25 items
... completed

Generating repository metadata...
[-]
... completed

Publishing repository over HTTP...
... completed

Publishing repository over HTTPS...
... skipped
[root@pulp-v2-testing ~]# ls -laZ /var/www/pulp_puppet/drwxr-xr-x. apache apache system_u:object_r:httpd_sys_rw_content_t:s0 .
drwxr-xr-x. root   root   system_u:object_r:httpd_sys_content_t:s0 ..
drwxr-xr-x. apache apache system_u:object_r:httpd_sys_rw_content_t:s0 http
drwxr-xr-x. apache apache system_u:object_r:httpd_sys_rw_content_t:s0 https
[root@pulp-v2-testing ~]#

Comment 5 Preethi Thomas 2013-04-08 15:59:36 UTC
Pulp 2.1 released 


http://www.pulpproject.org/2013/04/05/pulp-2-1-0-released/


Note You need to log in before you can comment on or make changes to this bug.