API returns UnknownError when executing euca-add-keypair in RHEL6

Bug #737345 reported by guanxiaohua2k6
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Ilya Alekseyev

Bug Description

When I tried to add key with euca-add-keypair in redhat6, I got UnknownError. I paste the error log and related info below.

nova-api.log:

2011-03-18 14:26:07,874 nova.api: ERROR [991LMA1G2AVU9RYJ1-2W anne IRT] Unexpected error raised: Unexpected error while running command.
Command: ssh-keygen -q -b 1024 -N "" -f /tmp/tmpv74M0I/temp
Exit code: 1
Stdout: 'Saving the key failed: /tmp/tmpv74M0I/temp.\n'
Stderr: 'open /tmp/tmpv74M0I/temp failed: Permission denied.\r\n'
(nova.api): TRACE: Traceback (most recent call last):
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova/api/ec2/__init__.py", line 317, in __call__
(nova.api): TRACE: result = api_request.invoke(context)
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova/api/ec2/apirequest.py", line 128, in invoke
(nova.api): TRACE: result = method(context, **args)
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova/api/ec2/cloud.py", line 304, in create_key_pair
(nova.api): TRACE: data = _gen_key(context, context.user.id, key_name)
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova/api/ec2/cloud.py", line 66, in _gen_key
(nova.api): TRACE: private_key, public_key, fingerprint = crypto.generate_key_pair()
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova/crypto.py", line 108, in generate_key_pair
(nova.api): TRACE: utils.execute('ssh-keygen -q -b %d -N "" -f %s' % (bits, keyfile))
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova/utils.py", line 147, in execute
(nova.api): TRACE: cmd=cmd)
(nova.api): TRACE: ProcessExecutionError: Unexpected error while running command.
(nova.api): TRACE: Command: ssh-keygen -q -b 1024 -N "" -f /tmp/tmpv74M0I/temp
(nova.api): TRACE: Exit code: 1
(nova.api): TRACE: Stdout: 'Saving the key failed: /tmp/tmpv74M0I/temp.\n'
(nova.api): TRACE: Stderr: 'open /tmp/tmpv74M0I/temp failed: Permission denied.\r\n'
(nova.api): TRACE:

The version of nova-api is 2011.1.1.

BTW I installed nova according to the instructions from below.
http://wiki.openstack.org/NovaInstall/RHEL6Notes

Revision history for this message
Ilya Alekseyev (ilyaalekseyev) wrote :

Guan, thank you much for your report.
There was incompletness on wiki instructions. Andrey Brindeyev just corrected it. You should disable SELinux in /etc/sysconfig/selinux and reboot your system.
Please let us know if it solve your problem.

Changed in nova:
assignee: nobody → Ilya Alekseyev (ilyaalekseyev)
status: New → Incomplete
summary: - API returns UnknownError when executing euca-add-keypair in redhat6
+ API returns UnknownError when executing euca-add-keypair in RHEL6
Revision history for this message
guanxiaohua2k6 (guanxiaohua2k6) wrote :

After I disabled SELinux in /etc/sysconfig/selinux and rebooted system just as Ilya Alekseyev said, the error disappeared.

Thank you, Ilya Alekseyev.

Changed in nova:
status: Incomplete → Invalid
Revision history for this message
derek wang (dyw) wrote :

Hi there, I got the same error after installing openstack ,
I did follow the instructions form http://wiki.openstack.org/NovaInstall/RHEL6Notes, and the selinux was disabled. The installed nova-api version is

Name : openstack-nova-api
Arch : noarch
Version : 2011.2
Release : 10.el6
Size : 13 k
Repo : installed
From repo : openstack

Again, I could not add a new keypair, the error messages in nova-api.log are:

Unexpected error raised: Unexpected error while running command.Command: ssh-keygen -q -b 1024 -N -f /tmp/tmpMtQ3UI/tempExit code: 1
Stdout: 'Saving the key failed: /tmp/tmpMtQ3UI/temp.\n'Stderr: 'open /tmp/tmpMtQ3UI/temp failed: Permission denied.\r\n'
(nova.api): TRACE: Traceback (most recent call last):(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova/api/ec2/__init__.py", line 321, in __call__
(nova.api): TRACE: result = api_request.invoke(context)(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova/api/ec2/apirequest.py", line 150, in invoke(nova.api): TRACE: result = method(context, **args)(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova/api/ec2/cloud.py", line 315, in create_key_pair
(nova.api): TRACE: data = _gen_key(context, context.user_id, key_name)
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova/api/ec2/cloud.py", line 68, in _gen_key
(nova.api): TRACE: private_key, public_key, fingerprint = crypto.generate_key_pair()
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova/crypto.py", line 110, in generate_key_pair
(nova.api): TRACE: '-f', keyfile)
(nova.api): TRACE: File "/usr/lib/python2.6/site-packages/nova/utils.py", line 173, in execute
(nova.api): TRACE: cmd=' '.join(cmd))
(nova.api): TRACE: ProcessExecutionError: Unexpected error while running command.
(nova.api): TRACE: Command: ssh-keygen -q -b 1024 -N -f /tmp/tmpMtQ3UI/temp
(nova.api): TRACE: Exit code: 1
(nova.api): TRACE: Stdout: 'Saving the key failed: /tmp/tmpMtQ3UI/temp.\n'
(nova.api): TRACE: Stderr: 'open /tmp/tmpMtQ3UI/temp failed: Permission denied.\r\n'

can anyone advise how to solve this issue?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.