safe_header raises AttributeError if X-Auth-Token is None
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance Client |
Fix Released
|
High
|
Matt Riedemann | ||
OpenStack Compute (nova) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
When trying to live migrate a VM by calling the compute RPC API directly (i.e., not via the novaclient) coupled with the elevated admin context [1], the destination compute service tries to call glance to retrieve the image [2]. However, the destination compute service erroneously raises an exception [4].
This problem was introduced via the following patch:
https:/
It also appears that a similar problem exists within nova too [3].
#######
[1]
from nova import compute
ctxt = context.
self.compute_api = compute.API()
self.compute_
#######
[2]
def _create_
"""Instantiate a new glanceclient.Client object."""
params = {}
if use_ssl:
scheme = 'https'
# https specific params
if CONF.ssl.cert_file:
if CONF.ssl.key_file:
if CONF.ssl.ca_file:
else:
scheme = 'http'
if CONF.auth_strategy == 'keystone':
# NOTE(isethi): Glanceclient <= 0.9.0.49 accepts only
# keyword 'token', but later versions accept both the
# header 'X-Auth-Token' and 'token'
if utils.is_
# if so, it is ipv6 address, need to wrap it with '[]'
host = '[%s]' % host
endpoint = '%s://%s:%s' % (scheme, host, port)
return glanceclient.
#######
[3]
novaclient.
def http_log_req(self, method, url, kwargs):
if not self.http_
return
if not kwargs.
headers = copy.deepcopy(
# because dict ordering changes from 2 to 3
keys = sorted(
for name in keys:
value = headers[name]
header = ' -H "%s: %s"' % (name, value)
if 'data' in kwargs:
data = json.loads(
#######
[4]
2014-10-14 00:42:10.699 31346 INFO nova.compute.
2014-10-14 00:42:10.913 31346 INFO nova.compute.
2014-10-14 00:42:11.148 31346 ERROR oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.148 31346 TRACE oslo.messaging.
2014-10-14 00:42:11.152 31346 ERROR oslo.messaging.
description: | updated |
Changed in nova: | |
status: | Incomplete → New |
summary: |
- live-migration with context by get_admin_context would fail + live-migration fails when called via RPC API with admin context |
summary: |
- live-migration fails when called via RPC API with admin context + Live migration fails when called via RPC API with admin context |
summary: |
- Live migration fails when called via RPC API with admin context + safe_header raises AttributeError if X-Auth-Token is None |
Changed in python-glanceclient: | |
milestone: | none → v0.15.0 |
status: | Fix Committed → Fix Released |
The nature of this bug report is unclear to me. Are you adding out of tree code to the nova codebase (snippet 1) that is failing? How can I reproduce this bug?