Comment 1 for bug 2051701

Revision history for this message
Bence Romsics (bence-romsics) wrote (last edit ):

I had some time to look into this and I found the root cause:

First of all here's traceback printed at debug level:

Traceback (most recent call last):
  File "/opt/stack/data/venv/lib/python3.10/site-packages/cliff/app.py", line 410, in run_subcommand
    result = cmd.run(parsed_args)
  File "/opt/stack/data/venv/lib/python3.10/site-packages/osc_lib/command/command.py", line 38, in run
    return super(Command, self).run(parsed_args)
  File "/opt/stack/data/venv/lib/python3.10/site-packages/cliff/display.py", line 117, in run
    column_names, data = self.take_action(parsed_args)
  File "/opt/stack/python-openstackclient/openstackclient/compute/v2/server_migration.py", line 316, in take_action
    server_migration = _get_migration_by_uuid(
  File "/opt/stack/python-openstackclient/openstackclient/compute/v2/server_migration.py", line 252, in _get_migration_by_uuid
    for migration in compute_client.server_migrations(server_id):
  File "/opt/stack/openstacksdk/openstack/resource.py", line 2060, in list
    uri = base_path % params
KeyError: 'server_uuid'

Please note that the traceback above is incomplete between _get_migration_by_uuid() and list().

However it's quite clear that here we pass 'server_id':
https://opendev.org/openstack/openstacksdk/src/commit/c2baf1db41cce65ce1aa8ac8908c4e0d98f7a94c/openstack/compute/v2/_proxy.py#L2196

But when we fill in the base_path template here:
https://opendev.org/openstack/openstacksdk/src/commit/c2baf1db41cce65ce1aa8ac8908c4e0d98f7a94c/openstack/resource.py#L2060

We expect 'server_uuid' instead of 'server_id':
https://opendev.org/openstack/openstacksdk/src/commit/c2baf1db41cce65ce1aa8ac8908c4e0d98f7a94c/openstack/compute/v2/server_migration.py#L21

Both sides of the conflicting code were merged in:
https://review.opendev.org/c/openstack/openstacksdk/+/815099

I suspect the source of the confusion may have been this:
https://review.opendev.org/c/openstack/openstacksdk/+/815099/3/openstack/compute/v2/server_migration.py#56

Since the root cause is in openstacksdk, I'm moving the ticket accordingly.