Bug 1239088
| Summary: | [RFE] python-rdomanager-oscplugin failing as root after a long wait | ||
|---|---|---|---|
| Product: | Red Hat OpenStack | Reporter: | Attila Fazekas <afazekas> |
| Component: | python-tripleoclient | Assignee: | RHOS Maint <rhos-maint> |
| Status: | CLOSED ERRATA | QA Contact: | Alexander Chuzhoy <sasha> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | low | ||
| Version: | 5.0 (RHEL 7) | CC: | achernet, gtrellu, hbrock, jslagle, kshileev, maufart, mburns, rhel-osp-director-maint, sasha, shardy, vcojot |
| Target Milestone: | ga | Keywords: | FutureFeature, Triaged, UserExperience, ZStream |
| Target Release: | 8.0 (Liberty) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | python-tripleoclient-0.1.1-1.el7ost | Doc Type: | Enhancement |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-04-07 21:38:10 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: | |||
Do not run this as root. We should RFE to detect which user is running and exit with a warning. *** Bug 1239091 has been marked as a duplicate of this bug. *** *** Bug 1244235 has been marked as a duplicate of this bug. *** sudo openstack undercloud install leads to the same problem Same issue here with RHEL 7.2. I followed the official documentation: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Registering_your_System.html By same I mean, logged as stack user and ran the sudo command. It seems that we have an issue with sudo ENV variables.
A quick dirty workaround to make it works:
--- undercloud.py 2015-12-01 12:22:27.195251645 -0500
+++ /usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py 2015-12-01 12:33:05.413542296 -0500
@@ -476,21 +476,22 @@
def _configure_ssh_keys():
+ username= os.environ["LOGNAME"]
"""Configure default ssh keypair in Nova
Generates a new ssh key for the current user if one does not already
exist, then uploads that to Nova as the 'default' keypair.
"""
- id_path = os.path.expanduser('~/.ssh/id_rsa')
+ id_path = os.path.expanduser('/home/stack/.ssh/id_rsa')
if not os.path.isfile(id_path):
args = ['ssh-keygen', '-t', 'rsa', '-N', '', '-f', id_path]
_run_command(args)
LOG.info('Generated new ssh key in ~/.ssh/id_rsa')
- args = ['sudo', 'cp', '/root/stackrc', os.path.expanduser('~')]
+ args = ['sudo', 'cp', '/root/stackrc', os.path.expanduser('/home/stack/')]
_run_command(args, name='Copy stackrc')
args = ['sudo', 'chown', getpass.getuser() + ':',
- os.path.expanduser('~/stackrc')]
+ os.path.expanduser('/home/stack/stackrc')]
_run_command(args, name='Chown stackrc')
password = _run_command(['sudo', 'hiera', 'admin_password']).rstrip()
user = _extract_from_stackrc('OS_USERNAME')
Verified: Environment: python-tripleoclient-0.1.1-4.el7ost.noarch openstack undercloud install This command cannot run under root user. Switch to a normal user. Hello,
I am seeing that with the latest 7-director puddle (as today 20160323).
I am running 'openstack undercloud install' as the 'stack' user.
I am getting this output at the end of the unercloud install run:
----------------------- PROFILING -----------------------
Target: post-configure.d
Script Seconds
--------------------------------------- ----------
10-tftp-iptables 1.160
100-tuskar-api 0.380
101-plan-add-roles 58.665
68-ironic-conductor 1.152
80-seedstack-masquerade 0.041
98-undercloud-setup 73.938
99-admin-swiftoperator-role 2.647
99-refresh-completed 0.774
99-restart-discovery 0.651
--------------------- END PROFILING ---------------------
[2016-03-24 00:37:02,932] (os-refresh-config) [INFO] Completed phase post-configure
os-refresh-config completed successfully
Generated new ssh key in ~/.ssh/id_rsa
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 527, in install
_configure_ssh_keys()
File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 503, in _configure_ssh_keys
nova.keypairs.get('default')
File "/usr/lib/python2.7/site-packages/novaclient/v2/keypairs.py", line 66, in get
"keypair")
File "/usr/lib/python2.7/site-packages/novaclient/base.py", line 156, in _get
_resp, body = self.api.client.get(url)
File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 444, in get
return self._cs_request(url, 'GET', **kwargs)
File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 398, in _cs_request
self.authenticate()
File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 553, in authenticate
auth_url = self._v2_auth(auth_url)
File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 644, in _v2_auth
return self._authenticate(url, body)
File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 657, in _authenticate
**kwargs)
File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 393, in _time_request
resp, body = self.request(url, method, **kwargs)
File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 387, in request
raise exceptions.from_response(resp, body, url, method)
novaclient.exceptions.ClientException: Unknown Error (HTTP 504)
ERROR: openstack Command 'instack-install-undercloud' returned non-zero exit status 1
[stack@instack ~]$ rpm -q python-rdomanager-oscplugin python-rdomanager-oscplugin-0.0.10-28.el7ost.noarch [stack@instack ~]$ rpm -q python-rdomanager-oscplugin python-rdomanager-oscplugin-0.0.10-28.el7ost.noarch SElinux was in 'permissive' mode. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHEA-2016-0604.html |
Description of problem: python-rdomanager-oscplugin is failing as root after a long wait. The documentation contains a sudo to stack command before this step, but it's behavior when I try to run it as root is harsh. The command does almost all step (very long time) and at the close to the end it just stop working. The usual practice around openstack, is all script which does not meant to be run as root refuses to start at the beginning. Version-Release number of selected component (if applicable): python-rdomanager-oscplugin-0.0.8-18.el7ost.noarch How reproducible: always Steps to Reproduce: 1. Login as root 2. openstack undercloud install Actual results: --------------------- END PROFILING --------------------- [2015-07-03 08:33:18,241] (os-refresh-config) [INFO] Completed phase post-configure os-refresh-config completed successfully Copy stackrc failed: cp: ‘/root/stackrc’ and ‘/root/stackrc’ are the same file Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 510, in install _configure_ssh_keys() File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 476, in _configure_ssh_keys _run_command(args, name='Copy stackrc') File "/usr/lib/python2.7/site-packages/instack_undercloud/undercloud.py", line 259, in _run_command env=env) File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output raise CalledProcessError(retcode, cmd, output=output) subprocess.CalledProcessError: Command '['sudo', 'cp', '/root/stackrc', '/root']' returned non-zero exit status 1 ERROR: openstack Command 'instack-install-undercloud' returned non-zero exit status 1 [root@instack ~]# openstack undercloud install Expected results: The command refuses to even start as root. Additional info: Example behavior of another os command.: # instack-virt-setup This script cannot be run as root.