metadata service throws error 500 when compute_driver is not set

Bug #1184641 reported by Simon Pasquier
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Simon Pasquier
Grizzly
Fix Released
Low
Yaguang Tang

Bug Description

How to reproduce:
- 1 (controller) node running all required services except nova-compute, compute_driver parameter not defined in nova.conf
- 1 (compute) node running nova-compte with compute_driver = libvirt.LibvirtDriver and libvirt_type = lxc
- Boot an instance

On the instance:
checking http://169.254.169.254/20090404/instanceid
failed 1/20: up 10299.50. iid had '<html>
 <head>
  <title>500 Internal Server Error</title>
 </head>
 <body>
  <h1>500 Internal Server Error</h1>
  Remote metadata server experienced an internal server error.<br /><br />

 </body>
</html>'
failed 2/20: up 10301.92. iid had '<html>
 <head>
  <title>500 Internal Server Error</title>
 </head>
 <body>
  <h1>500 Internal Server Error</h1>
  Remote metadata server experienced an internal server error.<br /><br />

 </body>
</html>'

In the nova-api logs:

2013-05-27 15:02:10.760 ERROR nova.api.metadata.handler [req-b6588700-4d5a-4ee3-84ad-c4be03cf0e62 None None] Failed to get metadata for instance id: 8d64ef04-8161-4e93-a387-93f519cadd65
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler Traceback (most recent call last):
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler File "/opt/stack/nova/nova/api/metadata/handler.py", line 183, in _handle_instance_id_request
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler remote_address)
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler File "/opt/stack/nova/nova/api/metadata/handler.py", line 90, in get_metadata_by_instance_id
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler instance_id, address)
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler File "/opt/stack/nova/nova/api/metadata/base.py", line 417, in get_metadata_by_instance_id
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler return InstanceMetadata(instance, address)
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler File "/opt/stack/nova/nova/api/metadata/base.py", line 118, in __init__
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler self.mappings = _format_instance_mapping(capi, ctxt, instance)
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler File "/opt/stack/nova/nova/api/metadata/base.py", line 423, in _format_instance_mapping
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler return block_device.instance_block_mapping(instance, bdms)
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler File "/opt/stack/nova/nova/block_device.py", line 98, in instance_block_mapping
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler if driver.compute_driver_matches('xenapi.XenAPIDriver'):
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler File "/opt/stack/nova/nova/virt/driver.py", line 967, in compute_driver_matches
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler return CONF.compute_driver.endswith(match)
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler AttributeError: 'NoneType' object has no attribute 'endswith'
2013-05-27 15:02:10.760 TRACE nova.api.metadata.handler

Changed in nova:
assignee: nobody → Simon Pasquier (simon-pasquier)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/30630

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/30843

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/30843
Committed: http://github.com/openstack/nova/commit/fa5079c257c00b8b56138233aca5755c54db9143
Submitter: Jenkins
Branch: master

commit fa5079c257c00b8b56138233aca5755c54db9143
Author: Simon Pasquier <email address hidden>
Date: Mon May 27 17:17:11 2013 +0200

    Verify that CONF.compute_driver is defined

    The compute_driver parameter is a mandatory parameter only for nodes
    running the Nova compute service. However Other Nova services like
    Nova API actually call the compute_driver_matches() function.

    Change-Id: Iac7cd46c6bdb4268cfbc650dcde0c95e69545f04
    Fixes: bug #1184641

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/grizzly)

Fix proposed to branch: stable/grizzly
Review: https://review.openstack.org/39045

tags: added: grizzly-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/grizzly)

Reviewed: https://review.openstack.org/39045
Committed: http://github.com/openstack/nova/commit/5f12da37dd229f7afe596d4b0e9741834bf8ddaa
Submitter: Jenkins
Branch: stable/grizzly

commit 5f12da37dd229f7afe596d4b0e9741834bf8ddaa
Author: Simon Pasquier <email address hidden>
Date: Mon May 27 17:17:11 2013 +0200

    Verify that CONF.compute_driver is defined

    The compute_driver parameter is a mandatory parameter only for nodes
    running the Nova compute service. However Other Nova services like
    Nova API actually call the compute_driver_matches() function.

    Change-Id: Iac7cd46c6bdb4268cfbc650dcde0c95e69545f04
    Fixes: bug #1184641
    (cherry picked from commit fa5079c257c00b8b56138233aca5755c54db9143)

tags: added: in-stable-grizzly
Alan Pevec (apevec)
tags: removed: grizzly-backport-potential
tags: removed: in-stable-grizzly
Changed in nova:
importance: Undecided → Low
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-1 → 2013.2
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.