With multiple backends enabled, adding a location does not default to default store
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
Critical
|
Abhishek Kekane |
Bug Description
I have multiple backends set up in an S-1 devstack and make this call:
data.json:
[
{
"op": "add",
"path": "/locations/-",
"value": {"url": "https:/
}
}
]
demo! curl -X PATCH \
-H "x-auth-token: $TK" \
-H "Content-type: application/
-d @data.json \
"$OS_
What I expect: the default store will be used.
What happens:
<html>
<head>
<title>400 Bad Request</title>
</head>
<body>
<h1>400 Bad Request</h1>
Invalid location<br /><br />
</body>
Here's the error that's occurring. (Line numbers may be off slightly from my hacking.)
Traceback (most recent call last):
File "/opt/stack/
uri, backend, context=context)
File "/opt/stack/
uri, backend, conf=CONF)
File "/opt/stack/
raise exceptions.
UnknownScheme: Unknown scheme 'None' found in URI
The call to store_api.
uri: https:/
backend: None
The call is happening here:
https:/
Maybe before the call is made, if backend == None, set backend to the default backend?
That won't actually set the location metadata, but it will get it past this call.
The workaround is to add the backend to the location metadata as part of the PATCH.
I have an http store with id == 'Wilma'.
This patch works as expected:
[
{
"op": "add",
"path": "/locations/-",
"value": {"url": "https:/
}
}
]
(Note: you have to do this same workaround to get this to work in the glanceclient on Iain's current patch when multiple backends are enabled in Glance.)
Maybe this behavior is fine, that is, don't guess what store to use when multiple backends are enabled, but instead reject the request and make the user state it explicitly. But in that case we need a much better error message -- "Invalid location" is pretty vague.
Changed in glance: | |
status: | New → In Progress |
importance: | Undecided → High |
Changed in glance: | |
importance: | High → Critical |
Upstream Patch: https:/ /review. openstack. org/617229