Paramiko doesn't work with Nova

Bug #1585515 reported by Bartek Żurawski
This bug report is a duplicate of:  Bug #1621536: Remove paramiko dependency. Edit Remove
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Unassigned

Bug Description

It looks like Paramiko 2.0.0 again breaks nova which currently has a requirement for 'paramiko>=1.16.0 # LGPL'.

nova.tests.unit.api.openstack.compute.test_keypairs.KeypairsTestV210.test_keypair_create_duplicate
--------------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "nova/tests/unit/api/openstack/compute/test_keypairs.py", line 237, in test_keypair_create_duplicate
        self.controller.create, self.req, body=body)
      File "/root/upstream/nova/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 485, in assertRaises
        self.assertThat(our_callable, matcher)
      File "/root/upstream/nova/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 496, in assertThat
        mismatch_error = self._matchHelper(matchee, matcher, message, verbose)
      File "/root/upstream/nova/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 547, in _matchHelper
        mismatch = matcher.match(matchee)
      File "/root/upstream/nova/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 108, in match
        mismatch = self.exception_matcher.match(exc_info)
      File "/root/upstream/nova/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_higherorder.py", line 62, in match
        mismatch = matcher.match(matchee)
      File "/root/upstream/nova/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 475, in match
        reraise(*matchee)
      File "/root/upstream/nova/.tox/py27/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 101, in match
        result = matchee()
      File "/root/upstream/nova/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 1049, in __call__
        return self._callable_object(*self._args, **self._kwargs)
      File "nova/api/openstack/wsgi.py", line 961, in version_select
        return func.func(self, *args, **kwargs)
      File "nova/api/openstack/extensions.py", line 504, in wrapped
        raise webob.exc.HTTPInternalServerError(explanation=msg)
    webob.exc.HTTPInternalServerError: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
    <type 'exceptions.TypeError'>

Captured pythonlogging:
~~~~~~~~~~~~~~~~~~~~~~~
    2016-05-25 09:55:14,571 INFO [nova.api.openstack] Loaded extensions: ['os-keypairs', 'servers']
    2016-05-25 09:55:16,314 ERROR [nova.api.openstack.extensions] Unexpected exception in API method
    Traceback (most recent call last):
      File "nova/api/openstack/extensions.py", line 478, in wrapped
        return f(*args, **kwargs)
      File "nova/api/validation/__init__.py", line 73, in wrapper
        return func(*args, **kwargs)
      File "nova/api/openstack/compute/keypairs.py", line 72, in create
        return self._create(req, body, type=True, user_id=user_id)
      File "nova/api/openstack/compute/keypairs.py", line 132, in _create
        context, user_id, name, key_type)
      File "nova/exception.py", line 110, in wrapped
        payload)
      File "/root/upstream/nova/.tox/py27/local/lib/python2.7/site-packages/oslo_utils/excutils.py", line 221, in __exit__
        self.force_reraise()
      File "/root/upstream/nova/.tox/py27/local/lib/python2.7/site-packages/oslo_utils/excutils.py", line 197, in force_reraise
        six.reraise(self.type_, self.value, self.tb)
      File "nova/exception.py", line 89, in wrapped
        return f(self, context, *args, **kw)
      File "nova/compute/api.py", line 4040, in create_key_pair
        user_id, key_type)
      File "nova/compute/api.py", line 4062, in _generate_key_pair
        return crypto.generate_key_pair()
      File "nova/crypto.py", line 152, in generate_key_pair
        key = generate_key(bits)
      File "nova/crypto.py", line 144, in generate_key
        key = paramiko.RSAKey(vals=(rsa.e, rsa.n))
    TypeError: __init__() got an unexpected keyword argument 'vals'

Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

Paramiko 2.0 got released 26 days ago with [1]. Nova put a workaround in place to work with paramiko 2.x 21 days ago [2]. After that, we bumped the version in the global requirements to 2.0 [3]. I tested it locally with commit 9d99081 (Newton master) and it works for me. I also didn't find the error message in logstash. I could reproduce this issue when I used stable/Mitaka and upgraded from the pinned version paramiko 1.16 to paramiko 2.0 manually.
All of this makes me believe that your setup could be in a weird state. I'm closing this for now. If you can reproduce it, feel free to reopen.

References:
[1] https://github.com/paramiko/paramiko/commit/258cc64ab36b58c681aa974151288fc7ddc1bb31
[2] https://github.com/openstack/nova/commit/c05b338f163e0bafbe564c6c7c593b819f2f2eac
[3] https://github.com/openstack/requirements/commit/e379813e9ccd41138af969f4c8e57abd062af527

Changed in nova:
status: New → Invalid
Revision history for this message
Sam Morrison (sorrison) wrote :

This affects mitaka, not sure how to make it say that in launchpad

Changed in nova:
status: Invalid → New
Revision history for this message
Sam Morrison (sorrison) wrote :

I'm using stable/mitaka and the requirements have:

paramiko>=1.16.0

This currently pulls in

paramiko==2.0.2

Which breaks nova when trying to create a keypair with the following stacktrace:

Traceback (most recent call last):
  File "/opt/nova/nova/api/openstack/extensions.py", line 478, in wrapped
    return f(*args, **kwargs)
  File "/opt/nova/nova/api/validation/__init__.py", line 73, in wrapper
    return func(*args, **kwargs)
  File "/opt/nova/nova/api/validation/__init__.py", line 73, in wrapper
    return func(*args, **kwargs)
  File "/opt/nova/nova/api/openstack/compute/keypairs.py", line 111, in create
    return self._create(req, body)
  File "/opt/nova/nova/api/openstack/compute/keypairs.py", line 132, in _create
    context, user_id, name, key_type)
  File "/opt/nova/nova/exception.py", line 110, in wrapped
    payload)
  File "/opt/mitaka/local/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
    self.force_reraise()
  File "/opt/mitaka/local/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
    six.reraise(self.type_, self.value, self.tb)
  File "/opt/nova/nova/exception.py", line 89, in wrapped
    return f(self, context, *args, **kw)
  File "/opt/nova/nova/compute/api.py", line 4073, in create_key_pair
    user_id, key_type)
  File "/opt/nova/nova/compute/api.py", line 4095, in _generate_key_pair
    return crypto.generate_key_pair()
  File "/opt/nova/nova/crypto.py", line 185, in generate_key_pair
    key = generate_key(bits)
  File "/opt/nova/nova/crypto.py", line 177, in generate_key
    key = paramiko.RSAKey(vals=(rsa.e, rsa.n))
TypeError: __init__() got an unexpected keyword argument 'vals'

Revision history for this message
Sam Morrison (sorrison) wrote :

I should mention that downgrading to paramiko 1.16.0 fixes the issue

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/396996

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (stable/mitaka)

Change abandoned by Lee Yarwood (<email address hidden>) on branch: stable/mitaka
Review: https://review.openstack.org/396996
Reason: Hello Sam, I'm closing this out given the response from Matt and stable/mitaka's move to phase II support.

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.