Horizon Access - Unable to create a new session key. It is likely that the cache is unavailable

2.5k Views Asked by At

I tried to access Horizon as recommended here, through the IP 10.20.20.1 and admin user, and received the following runtime error:

Request Method: | POST
-- | --
http://10.20.20.1/auth/login/
2.0.13
RuntimeError
Unable to create a new session key. It is likely that the cache is unavailable.
/snap/microstack/196/lib/python3.6/site-packages/django/contrib/sessions/backends/cache.py in create, line 51
/snap/microstack/196/bin/uwsgi
3.6.9
['.',  '',  '/snap/microstack/196/usr/lib/python36.zip',  '/snap/microstack/196/usr/lib/python3.6',  
'/snap/microstack/196/usr/lib/python3.6/lib-dynload',  '/snap/microstack/196/usr/lib/python3/dist-packages',  
'/snap/microstack/196/lib/python3.6/site-packages',  '/snap/microstack/196/lib/python3.6/site-packages/openstack_dashboard']
Mon, 17 Aug 2020 12:42:48 +0000

The expected result would be a successful login.

2

There are 2 best solutions below

0
On

I faced the same issue. For me, adding -l 10.20.20.1 (below -l 127.0.0.1) in /etc/memcached.conf and restarting memcached with systemctl restart memcached seemed to do the trick.

1
On

Check on which address Memcached is running. With the command:

systemctl status memcached

And set that IP address in the local_settings.py mine it's located in /etc/openstack-dashboard/local_settings.py

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION': '192.168.122.2:11211',
    },
}