keystone.cache.redis config arguments url conflict host and port
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Invalid
|
Low
|
Unassigned |
Bug Description
version: 8.1.3.dev1
branch: stable/liberty
in my keystone.conf
```
[cache]
config_prefix = cache.keystone
expiration_time = 600
backend = dogpile.cache.redis
backend_argument = host:127.0.0.1
backend_argument = port:6380
backend_argument = db:0
```
Using this keystone.conf is not working.
```
2016-08-31 13:46:56.552 10387 CRITICAL keystone [-] AttributeError: 'list' object has no attribute 'decode'
2016-08-31 13:46:56.552 10387 ERROR keystone Traceback (most recent call last):
2016-08-31 13:46:56.552 10387 ERROR keystone File "/home/
2016-08-31 13:46:56.552 10387 ERROR keystone server = wss.make_server('', args.port, initialize_
2016-08-31 13:46:56.552 10387 ERROR keystone File "/home/
2016-08-31 13:46:56.552 10387 ERROR keystone return initialize_
2016-08-31 13:46:56.552 10387 ERROR keystone File "/home/
2016-08-31 13:46:56.552 10387 ERROR keystone startup_
2016-08-31 13:46:56.552 10387 ERROR keystone File "/home/
2016-08-31 13:46:56.552 10387 ERROR keystone drivers = backends.
2016-08-31 13:46:56.552 10387 ERROR keystone File "/home/
2016-08-31 13:46:56.552 10387 ERROR keystone cache.configure
2016-08-31 13:46:56.552 10387 ERROR keystone File "/home/
2016-08-31 13:46:56.552 10387 ERROR keystone '%s.' % CONF.cache.
2016-08-31 13:46:56.552 10387 ERROR keystone File "/home/
2016-08-31 13:46:56.552 10387 ERROR keystone "%swrap" % prefix, None),
2016-08-31 13:46:56.552 10387 ERROR keystone File "/home/
2016-08-31 13:46:56.552 10387 ERROR keystone _config_prefix
2016-08-31 13:46:56.552 10387 ERROR keystone File "/home/
2016-08-31 13:46:56.552 10387 ERROR keystone for key in config_dict
2016-08-31 13:46:56.552 10387 ERROR keystone File "/home/
2016-08-31 13:46:56.552 10387 ERROR keystone self.client = self._create_
2016-08-31 13:46:56.552 10387 ERROR keystone File "/home/
2016-08-31 13:46:56.552 10387 ERROR keystone return redis.StrictRed
2016-08-31 13:46:56.552 10387 ERROR keystone File "/home/
2016-08-31 13:46:56.552 10387 ERROR keystone connection_pool = ConnectionPool.
2016-08-31 13:46:56.552 10387 ERROR keystone File "/home/
2016-08-31 13:46:56.552 10387 ERROR keystone url = urlparse(url)
2016-08-31 13:46:56.552 10387 ERROR keystone File "/usr/lib64/
2016-08-31 13:46:56.552 10387 ERROR keystone url, scheme, _coerce_result = _coerce_args(url, scheme)
2016-08-31 13:46:56.552 10387 ERROR keystone File "/usr/lib64/
2016-08-31 13:46:56.552 10387 ERROR keystone return _decode_args(args) + (_encode_result,)
2016-08-31 13:46:56.552 10387 ERROR keystone File "/usr/lib64/
2016-08-31 13:46:56.552 10387 ERROR keystone return tuple(x.
2016-08-31 13:46:56.552 10387 ERROR keystone File "/usr/lib64/
2016-08-31 13:46:56.552 10387 ERROR keystone return tuple(x.
2016-08-31 13:46:56.552 10387 ERROR keystone AttributeError: 'list' object has no attribute 'decode'
2016-08-31 13:46:56.552 10387 ERROR keystone
```
Therefore, I view the code, find the reason.
Although I have not configured the `url` of `backend_argument`, the code sets the default `url` values `CONF.cache.
Therefore, the variable of `CONF.cache.
So, when the code runs after `build_cache_conf` (file `keystone/
```
url = ["localhost:11211"]
host = "127.0.0.1"
port = 6380
db = 0
```
I use the cache backend `dogpile.
If I will use the cache backend `dogpile.
```
[cache]
config_prefix = cache.keystone
expiration_time = 600
backend = dogpile.cache.redis
backend_argument = url:redis:
```
description: | updated |
Changed in keystone: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in keystone: | |
status: | Confirmed → New |
importance: | Medium → Undecided |
tags: | added: caching |
tags: | added: configuration office-hours |
Changed in keystone: | |
status: | New → Triaged |
importance: | Undecided → Low |
milestone: | none → pike-3 |
Keystone doesn't use these options directly. Instead, they are registered as options of the oslo.cache library [0]. Marking this as invalid since I think the fix, if any, would have to come from oslo.cache.
[0] https:/ /github. com/openstack/ oslo.cache/ blob/cfe395f980 603040ec40f9e6c f0a98a952f981ad /oslo_cache/ _opts.py# L51-L55