← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1817542] [NEW] nova instance-action fails if project_id=NULL

 

Public bug reported:

nova instance-action fails if project_id=NULL

Starting in api version 2.62 "an obfuscated hashed host id is returned"
To generate the host_id it uses utils.generate_hostid() that uses (in this case) the project_id and the host of the action.

However, we can have actions without a user_id/project_id defined.
For example, when something happens outside nova API (user shutdown the VM inside the guest OS).
In this case we have an action "stop", without a user_id/project_id.

When running 2.62 it fails when performing:
nova instance-action <instance_uuid> <req_uuid>

no issues if using:
--os-compute-api-version 2.60 

===
The trace in nova-api logs:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nova/api/openstack/wsgi.py", line 801, in wrapped
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/nova/api/openstack/compute/instance_actions.py", line 169, in show
    ) for evt in events_raw]
  File "/usr/lib/python2.7/site-packages/nova/api/openstack/compute/instance_actions.py", line 69, in _format_event
    project_id)
  File "/usr/lib/python2.7/site-packages/nova/utils.py", line 1295, in generate_hostid
    data = (project_id + host).encode('utf-8')
TypeError: unsupported operand type(s) for +: 'NoneType' and 'unicode'

** Affects: nova
     Importance: Undecided
         Status: New


** Tags: api

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1817542

Title:
  nova instance-action fails if project_id=NULL

Status in OpenStack Compute (nova):
  New

Bug description:
  nova instance-action fails if project_id=NULL

  Starting in api version 2.62 "an obfuscated hashed host id is returned"
  To generate the host_id it uses utils.generate_hostid() that uses (in this case) the project_id and the host of the action.

  However, we can have actions without a user_id/project_id defined.
  For example, when something happens outside nova API (user shutdown the VM inside the guest OS).
  In this case we have an action "stop", without a user_id/project_id.

  When running 2.62 it fails when performing:
  nova instance-action <instance_uuid> <req_uuid>

  no issues if using:
  --os-compute-api-version 2.60 

  ===
  The trace in nova-api logs:

  Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/nova/api/openstack/wsgi.py", line 801, in wrapped
      return f(*args, **kwargs)
    File "/usr/lib/python2.7/site-packages/nova/api/openstack/compute/instance_actions.py", line 169, in show
      ) for evt in events_raw]
    File "/usr/lib/python2.7/site-packages/nova/api/openstack/compute/instance_actions.py", line 69, in _format_event
      project_id)
    File "/usr/lib/python2.7/site-packages/nova/utils.py", line 1295, in generate_hostid
      data = (project_id + host).encode('utf-8')
  TypeError: unsupported operand type(s) for +: 'NoneType' and 'unicode'

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1817542/+subscriptions


Follow ups