Openstack Queens - Nova: Error creating new key pair
In a fresh install of Openstack Queens I was having an issue generating new key pairs after a reboot f the Nova node.
The following error was logged in nova-api.log
A simple restart of the nova-api service resolved this issue for me
12018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi [req-78070ded-b2cd-4e1a-8a51-8c082b50e0a4 f2800cf724264988aab44aa21bf1dae4 0d280551fd45414eace8211d6ac154c0 - default 252047b9b8504489a11d9230a8f9bf55] Unexpected exception in API method: InternalError: Unknown OpenSSL error. This error is commonly encountered when another library is not cleaning up the OpenSSL error stack. If you are using cryptography with another library that uses OpenSSL try disabling it before reporting a bug. Otherwise please file an issue at https://github.com/pyca/cryptography/issues with information on how to reproduce this. ([_OpenSSLErrorWithText(code=2147897744L, lib=128, func=101, reason=400, reason_text='error:80065190:lib(128):osrandom_rand_bytes:getrandom() initialization failed.'), _OpenSSLErrorWithText(code=67637251L, lib=4, func=129, reason=3, reason_text='error:04081003:rsa routines:RSA_BUILTIN_KEYGEN:BN lib')])
2 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi Traceback (most recent call last):
3 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/openstack/wsgi.py", line 788, in wrapped
4 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi return f(*args, **kwargs)
5 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/validation/__init__.py", line 108, in wrapper
6 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
7 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/validation/__init__.py", line 108, in wrapper
8 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
9 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/keypairs.py", line 112, in create
10 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi return self._create(req, body)
11 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/api/openstack/compute/keypairs.py", line 133, in _create
12 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi context, user_id, name, key_type)
13 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/exception_wrapper.py", line 76, in wrapped
14 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi function_name, call_dict, binary)
15 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
16 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi self.force_reraise()
17 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
18 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi six.reraise(self.type_, self.value, self.tb)
19 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/exception_wrapper.py", line 67, in wrapped
20 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi return f(self, context, *args, **kw)
21 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/compute/api.py", line 5287, in create_key_pair
22 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi user_id, key_type)
23 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/compute/api.py", line 5322, in _generate_key_pair
24 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi return crypto.generate_key_pair()
25 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/nova/crypto.py", line 132, in generate_key_pair
26 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi key = paramiko.RSAKey.generate(bits)
27 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/paramiko/rsakey.py", line 156, in generate
28 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi public_exponent=65537, key_size=bits, backend=default_backend()
29 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/primitives/asymmetric/rsa.py", line 119, in generate_private_key
30 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi return backend.generate_rsa_private_key(public_exponent, key_size)
31 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 362, in generate_rsa_private_key
32 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi self.openssl_assert(res == 1)
33 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 106, in openssl_assert
34 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi return binding._openssl_assert(self._lib, ok)
35 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 75, in _openssl_assert
36 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi errors_with_text
37 2018-05-02 13:25:41.101 1351 ERROR nova.api.openstack.wsgi InternalError: Unknown OpenSSL error. This error is commonly encountered when another library is not cleaning up the OpenSSL error stack. If you are using cryptography with another library that uses OpenSSL try disabling it before reporting a bug. Otherwise please file an issue at https://github.com/pyca/cryptography/issues with information on how to reproduce this. ([_OpenSSLErrorWithText(code=2147897744L, lib=128, func=101, reason=400, reason_text='error:80065190:lib(128):osrandom_rand_bytes:getrandom() initialization failed.'), _OpenSSLErrorWithText(code=67637251L, lib=4, func=129, reason=3, reason_text='error:04081003:rsa routines:RSA_BUILTIN_KEYGEN:BN lib')])