Bug 621680 - ISE on running pulp repo list- Permission Error with pulp log files
Summary: ISE on running pulp repo list- Permission Error with pulp log files
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
: ---
Assignee: Mike McCune
QA Contact: Preethi Thomas
URL:
Whiteboard:
: 625483 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-08-05 19:41 UTC by Preethi Thomas
Modified: 2011-07-15 19:33 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-10-20 16:11:40 UTC
Embargoed:


Attachments (Terms of Use)

Description Preethi Thomas 2010-08-05 19:41:33 UTC
Description of problem:


[root@preethi ~]# pulp -u admin -p admin repo list
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
 root@localhost and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.15 (Fedora) Server at localhost Port 8811</address>
</body></html>


[root@preethi pulp]# tail -f /var/log/httpd/pulp_webservices.error 
[Thu Aug 05 15:27:18 2010] [error] [client ::1]   File "/usr/lib64/python2.6/logging/handlers.py", line 107, in __init__
[Thu Aug 05 15:27:18 2010] [error] [client ::1]     BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
[Thu Aug 05 15:27:18 2010] [error] [client ::1]   File "/usr/lib64/python2.6/logging/handlers.py", line 59, in __init__
[Thu Aug 05 15:27:18 2010] [error] [client ::1]     logging.FileHandler.__init__(self, filename, mode, encoding, delay)
[Thu Aug 05 15:27:18 2010] [error] [client ::1]   File "/usr/lib64/python2.6/logging/__init__.py", line 819, in __init__
[Thu Aug 05 15:27:18 2010] [error] [client ::1]     StreamHandler.__init__(self, self._open())
[Thu Aug 05 15:27:18 2010] [error] [client ::1]   File "/usr/lib64/python2.6/logging/__init__.py", line 838, in _open
[Thu Aug 05 15:27:18 2010] [error] [client ::1]     stream = open(self.baseFilename, self.mode)
[Thu Aug 05 15:27:18 2010] [error] [client ::1] IOError: [Errno 13] Permission denied: '/var/log/pulp/pulptools.log'
[Thu Aug 05 15:27:18 2010] [info] [client ::1] Connection closed to child 6 with standard shutdown (server 127.0.0.1:8811)



[root@preethi pulp]# ls -lrt /var/log/pulp/
total 21052
-rw-r--r--. 1 root   root   1048572 Jul  1 23:10 pulptools.log.5
-rw-r--r--. 1 root   root   1048573 Jul  2 01:54 pulptools.log.4
-rw-r--r--. 1 apache apache 1048574 Jul 27 15:30 pulp.log.4
-rw-r--r--. 1 root   root   1048524 Jul 28 04:38 pulptools.log.3
-rw-r--r--. 1 apache apache  577955 Jul 28 10:27 pulp.log.3
-rw-r--r--. 1 apache apache 4469719 Jul 28 10:27 pulp.log.2
-rw-r--r--. 1 root   root   1048479 Jul 31 20:12 pulptools.log.2
-rw-r--r--. 1 apache apache 1048567 Aug  2 12:30 pulp.log.1
-rw-r--r--. 1 apache apache 1048456 Aug  3 16:48 grinder.log.4
-rw-r--r--. 1 apache apache 1048567 Aug  3 17:09 grinder.log.3
-rw-r--r--. 1 apache apache 1048570 Aug  3 17:21 grinder.log.2
-rw-r--r--. 1 apache apache 1048428 Aug  4 11:52 grinder.log.1
-rw-r--r--. 1 apache apache 1047036 Aug  4 12:24 grinder.log
-rw-r--r--. 1 root   apache 1048559 Aug  4 13:27 pulptools.log.1
-rw-r--r--. 1 apache apache 3307308 Aug  4 15:09 events.log
-rw-r--r--. 1 apache apache  586451 Aug  5 09:17 pulp.log
-rw-r--r--. 1 root   apache     955 Aug  5 15:27 pulptools.log

Comment 1 Preethi Thomas 2010-08-05 19:48:50 UTC
[root@preethi ~]# rpm -qa |grep pulp
pulp-0.0.47-1.git.4.a7865df.fc13.noarch
pulp-tools-0.0.47-1.git.4.a7865df.fc13.noarch

Comment 2 Preethi Thomas 2010-08-09 13:16:11 UTC
verified

[root@preethi pulp]# pulp -u admin -p admin repo list
+-------------------------------------------+
    List of Available Repositories 
+-------------------------------------------+

Label              	rhel-x86_64-client-vt-5  
Name               	rhel-x86_64-client-vt-5  
Feed               	{u'url': u'satellite.rhn.redhat.com/rhel-x86_64-client-vt-5', u'type': u'rhn', u'supported_types': [u'yum', u'local', u'rhn']}
Arch               	x86_64                   
Sync Schedule      	None                     
Packages           	47                       


Label              	f12                      
Name               	f12                      
Feed               	{u'url': u'http://download.devel.redhat.com/released/F-12/GOLD/Fedora/i386/os/', u'type': u'yum', u'supported_types': [u'yum', u'local', u'rhn']}
Arch               	i386                     
Sync Schedule      	None                     
Packages           	27                       


Label              	rhel-i386-server-5       
Name               	rhel-i386-server-5       
Feed               	{u'url': u'satellite.rhn.redhat.com/rhel-i386-server-5', u'type': u'rhn', u'supported_types': [u'yum', u'local', u'rhn']}
Arch               	i386                     
Sync Schedule      	None                     
Packages           	42                       


Label              	f13                      
Name               	f13                      
Feed               	{u'url': u'http://download.devel.redhat.com/released/F-13/GOLD/Fedora/x86_64/os/', u'type': u'yum', u'supported_types': [u'yum', u'local', u'rhn']}
Arch               	x86_64                   
Sync Schedule      	None                     
Packages           	27                       


Label              	f13-1                    
Name               	f13-1                    
Feed               	{u'url': u'http://download.devel.redhat.com/released/F-13/GOLD/Fedora/x86_64/os/', u'type': u'yum', u'supported_types': [u'yum', u'local', u'rhn']}
Arch               	x86_64                   
Sync Schedule      	None                     
Packages           	29                       


Label              	f13-2                    
Name               	f13-2                    
Feed               	{u'url': u'http://download.devel.redhat.com/released/F-13/GOLD/Fedora/x86_64/os/', u'type': u'yum', u'supported_types': [u'yum', u'local', u'rhn']}
Arch               	x86_64                   
Sync Schedule      	None                     
Packages           	29                       

[root@preethi pulp]# rpm -qa |grep pulp
pulp-tools-0.0.47-1.git.24.80a77dd.fc13.noarch
pulp-0.0.47-1.git.24.80a77dd.fc13.noarch

Comment 3 Preethi Thomas 2010-08-19 18:43:31 UTC
*** Bug 625483 has been marked as a duplicate of this bug. ***

Comment 4 Preethi Thomas 2010-08-19 18:45:34 UTC
Reopening as David ran into the issue with a fresh install.

Copying from the above bug

dgao      2010-08-19 11:13:25 EDT

Description of problem:
There's a permission issue with /var/log/pulp if pulp-admin is immediately
executed after a fresh rpm install. The folder, and subsequently all the pulp
log files are owned by root with permission of 644. As a result, pulp-admin
fails. 

[dgao@pulp ~]$ pulp-admin -u admin -p admin repo list
ERROR: must be root to execute
[dgao@pulp ~]$ su - 
Password: 
[root@pulp ~]# pulp-admin -u admin -p admin repo list
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
 root@pulp and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.16 (Fedora) Server at localhost Port 8811</address>
</body></html>

[root@pulp ~]# 
[root@pulp ~]# ls -larth /var/log/pulp
total 12K
drwxr-xr-x. 16 root root 4.0K Aug 19 11:04 ..
drwxr-xr-x.  2 root root 4.0K Aug 19 11:04 .
-rw-r--r--.  1 root root 1.9K Aug 19 11:10 pulptools.log

[root@pulp ~]# tail /var/log/httpd/pulp_webservices.error 
[Thu Aug 19 11:10:00 2010] [error] [client ::1]   File
"/usr/lib/python2.6/site-packages/pulp/webservices/application.py", line 51, in
wsgi_application
[Thu Aug 19 11:10:00 2010] [error] [client ::1]     start_logging()
[Thu Aug 19 11:10:00 2010] [error] [client ::1]   File
"/usr/lib/python2.6/site-packages/pulp/logs.py", line 98, in start_logging
[Thu Aug 19 11:10:00 2010] [error] [client ::1]    
configure_pulp_grinder_logging()
[Thu Aug 19 11:10:00 2010] [error] [client ::1]   File
"/usr/lib/python2.6/site-packages/pulp/logs.py", line 50, in
configure_pulp_grinder_logging
[Thu Aug 19 11:10:00 2010] [error] [client ::1]     check_log_file(pulp_file)
[Thu Aug 19 11:10:00 2010] [error] [client ::1]   File
"/usr/lib/python2.6/site-packages/pulp/logs.py", line 33, in check_log_file
[Thu Aug 19 11:10:00 2010] [error] [client ::1]     raise RuntimeError('Cannot
write to log directory: %s' % dir_path)
[Thu Aug 19 11:10:00 2010] [error] [client ::1] RuntimeError: Cannot write to
log directory: /var/log/pulp
[Thu Aug 19 11:10:00 2010] [info] [client ::1] Connection closed to child 6
with standard shutdown (server 127.0.0.1:8811)
[root@pulp ~]#

Comment 5 Mike McCune 2010-09-08 15:53:36 UTC
I will verify if this is occurring on a fresh install or not.

Comment 6 Mike McCune 2010-09-24 17:27:34 UTC
I checked this on a fresh install on a newly created Fedora 13 x86_64 virtual machine with pulp-0.0.67-1.fc13.noarch and it did not occur.

sending back to QA

Comment 7 Preethi Thomas 2010-09-28 15:34:54 UTC
verified

installed a new vm f12 x86_64 with pulp.noarch 0:0.0.68-1.fc12 

[root@localhost yum.repos.d]# pulp-admin repo -u admin -p admin create --id=f13 --name=f13 --arch=x86_64 --feed=yum:http://download.devel.redhat.com/released/F-13/GOLD/Fedora/x86_64/os/
 Successfully created Repo [ f13 ]
[root@localhost yum.repos.d]# pulp-admin -u admin -p admin repo list
+------------------------------------------+
       List of Available Repositories
+------------------------------------------+

Label                   f13                      
Name                    f13                      
Feed                    {u'url': u'http://download.devel.redhat.com/released/F-13/GOLD/Fedora/x86_64/os/', u'type': u'yum', u'supported_types': [u'yum', u'local', u'rhn']}
Arch                    x86_64                   
Sync Schedule           None                     
Packages                0                        
Files                   0

Comment 8 Preethi Thomas 2010-10-20 16:11:40 UTC
Closed after review.


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