[ocata] horizon first login error on a fresh install and after apache restart
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard Charm |
Fix Released
|
Undecided
|
Dmitrii Shcherbakov |
Bug Description
memcached and haproxy config:
http://
balance source # <-- seems right
memcached instances are listening locally which is ok given that horizon is a django app which will use this cache via a localhost connection - it doesn't need to have a socket bound to a different address. It would have been a problem if 'balance source' was not used on haproxy.
The issue is trivially reproducible after apache2 restart.
/var/log/
"[Wed Aug 23 06:50:13.790605 2017] [wsgi:error] [pid 510168:tid 140037591574272] File "/usr/share/
[Wed Aug 23 06:50:13.790608 2017] [wsgi:error] [pid 510168:tid 140037591574272] return policy_
[Wed Aug 23 06:50:13.790611 2017] [wsgi:error] [pid 510168:tid 140037591574272] File "/usr/lib/
[Wed Aug 23 06:50:13.790614 2017] [wsgi:error] [pid 510168:tid 140037591574272] enforcer = _get_enforcer()
[Wed Aug 23 06:50:13.790617 2017] [wsgi:error] [pid 510168:tid 140037591574272] File "/usr/lib/
[Wed Aug 23 06:50:13.790620 2017] [wsgi:error] [pid 510168:tid 140037591574272] if os.path.
[Wed Aug 23 06:50:13.790623 2017] [wsgi:error] [pid 510168:tid 140037591574272] File "/usr/lib/
[Wed Aug 23 06:50:13.790627 2017] [wsgi:error] [pid 510168:tid 140037591574272] st = os.stat(path)
[Wed Aug 23 06:50:13.790630 2017] [wsgi:error] [pid 510168:tid 140037591574272] TypeError: coercing to Unicode: need string or buffer, NoneType found"
Related info:
https:/
Configuration in local_settings.py is for django:
https:/
---
I have not found what causes this behavior yet.
Changed in charm-openstack-dashboard: | |
status: | New → Confirmed |
Changed in charm-openstack-dashboard: | |
milestone: | none → 17.08 |
Changed in charm-openstack-dashboard: | |
status: | Fix Committed → Fix Released |
Changed in charm-openstack-dashboard: | |
assignee: | nobody → Dmitrii Shcherbakov (dmitriis) |
Because of this (when using keystone v3 api):
CACHES = { core.cache. backends. memcached. MemcachedCache' , contrib. sessions. backends. cache'
'default': {
'BACKEND': 'django.
'LOCATION': '127.0.0.1:11211',
},
}
...
SESSION_ENGINE = 'django.
...
...and memcache is not replicated between three horizons. All three IPs of dashboard units should be configured here.
Or we should use cookies for sessions:
SESSION_ENGINE = 'django. contrib. sessions. backends. signed_ cookies'
There's also an option to relate horizon to mysql and then it should store session data in the database, but this template looks weird:
{% if database_host -%} contrib. sessions. backends. cached_ db' db.backends. mysql',
'default- character- set': 'utf8' contrib. sessions. backends. cache'
SESSION_ENGINE = 'django.
DATABASES = {
'default': {
# Database configuration here
'ENGINE': 'django.
'NAME': '{{ database }}',
'USER': '{{ database_user }}',
'PASSWORD': '{{ database_password }}',
'HOST': '{{ database_host }}',
}
}
{% else -%}
{% if api_version == "3" -%}
# Warning: Please add DB relation for Keystone v3 + HA deployments
SESSION_ENGINE = 'django.
{% endif -%}
It implies that that in any case, SESSION_ENGINE will be set to cache, regardless of mysql relation.