Bug 1135589 - pulp-admin node repo enable says "Cannot read configuration file: /etc/pulp/server.conf"
Summary: pulp-admin node repo enable says "Cannot read configuration file: /etc/pulp/s...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: nodes
Version: Master
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: 2.6.0
Assignee: Chris Duryee
QA Contact: Irina Gulina
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-29 17:52 UTC by Brian Bouterse
Modified: 2015-02-28 22:17 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-28 22:17:31 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Pulp Redmine 506 None None None Never

Description Brian Bouterse 2014-08-29 17:52:54 UTC
Recently I was doing some testing with EL6, and when I ran the following command:

pulp-admin node repo enable --repo-id zoo

I received this exception:  RuntimeError: Cannot read configuration file: /etc/pulp/server.conf

I am running as user 'cloud-user' when I run the command, that user does not have permissions to read that file. See the permissions below:

-rw-r-----. 1 root apache 10466 Aug 26 17:32 /etc/pulp/server.conf

I shouldn't need super user privileges to run pulp-admin. This is a fresh install on a new VM, and I followed the install docs to the letter.

Comment 1 Randy Barlow 2014-08-29 17:57:40 UTC
pulp-admin should never read server.conf. It is not guaranteed to even exist, since it is part of the pulp-server package. pulp-admin is supposed to be able to run on a different host than the Pulp server.

This bug should be about stopping pulp-admin from trying/needing to read that file.

Comment 2 Brian Bouterse 2014-09-03 17:45:02 UTC
I had to resolve find a workaround on my system, so I uninstalled these packages and pulp-admin started behaving correctly. These came as part of the @pulp-nodes-parent install group.

pulp-nodes-admin-extensions
pulp-nodes-parent

Comment 3 Chris Duryee 2014-10-31 19:04:17 UTC
https://github.com/pulp/pulp/pull/1279

Comment 4 Jeff Ortel 2014-11-04 14:43:11 UTC
This is a duplicate of: 1135589

Comment 5 Jeff Ortel 2014-11-04 15:38:19 UTC
Correction: This is related to: https://bugzilla.redhat.com/show_bug.cgi?id=1116040

Comment 6 Chris Duryee 2014-11-04 18:05:25 UTC
https://bugzilla.redhat.com/show_bug.cgi?id=1160410 is the bug to do the API change in 3.0

Comment 7 Chris Duryee 2014-11-04 18:10:26 UTC
merged to 2.5-dev and master

Comment 8 Chris Duryee 2014-12-23 20:53:01 UTC
fixed in pulp 2.6.0-0.2.beta

Comment 9 Irina Gulina 2015-01-07 11:40:02 UTC
>> rpm -qa pulp-server
pulp-server-2.6.0-0.2.beta.el6.noarch

>> rpm -qa | grep nodes
pulp-nodes-admin-extensions-2.6.0-0.2.beta.el6.noarch
pulp-nodes-child-2.6.0-0.2.beta.el6.noarch
pulp-nodes-common-2.6.0-0.2.beta.el6.noarch
pulp-nodes-consumer-extensions-2.6.0-0.2.beta.el6.noarch
pulp-nodes-parent-2.6.0-0.2.beta.el6.noarch

>> ls -l /etc/pulp | grep server
drwxr-xr-x. 3 root root   4096 Dec 24 08:52 server

[root@host~]# exit
logout

[ec2-user@host ~]$ pulp-admin rpm repo create --repo-id zaika
Successfully created repository [zaika]

[ec2-user@host ~]$ pulp-admin node repo enable --repo-id zaika
Repository enabled.

Note: Repository [ zaika ] will not be available for node synchronization until
published.  See: the 'node repo publish' command.

Warning: enabling with auto-publish may degrade repository synchronization
performance.

[ec2-user@host ~]$ pulp-admin node repo publish --repo-id zaika
This command may be exited via ctrl+c without affecting the request.


[\]
Running...

Publish succeeded.


[ec2-user@host ~]$ pulp-admin node repo list
+----------------------------------------------------------------------+
                          Enabled Repositories
+----------------------------------------------------------------------+

Id:                  zaika
Display Name:        zaika
Description:         None
Content Unit Counts: 


and I checked that on rh6 for pulp 2.5 There is exception, right
>> pulp-admin node repo list
Traceback (most recent call last):
  File "/usr/bin/pulp-admin", line 9, in <module>
    load_entry_point('pulp-client-admin==2.5.0', 'console_scripts', 'pulp-admin')()
....
    raise RuntimeError('Cannot read configuration file: %s' % config_file)
RuntimeError: Cannot read configuration file: /etc/pulp/server.conf

and also checked on f20 with pulp 2.6 for a case, evrth is ok there.

Comment 10 Brian Bouterse 2015-02-28 22:17:31 UTC
Moved to https://pulp.plan.io/issues/506


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