0

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.

Dalton Cézane
  • 3,672
  • 2
  • 35
  • 60
  • Is memcached up and running? It sounds like that's missing or down. – eblock Aug 19 '20 at 07:11
  • @eblock , I really do not know, as I just followed the documentation and it does not mention something related to memcached... – Dalton Cézane Aug 19 '20 at 12:47
  • I'm not familiar with microstack at all, so I'm just guessing from my manual installation of all openstack services. – eblock Aug 19 '20 at 12:52
  • I stopped and started the memcached service, but the problem continues... – Dalton Cézane Aug 19 '20 at 13:29
  • Does [this](https://ask.openstack.org/en/question/91657/runtimeerror-unable-to-create-a-new-session-key-it-is-likely-that-the-cache-is-unavailable-authorization-failed-the-request-you-have-made-requires/) help? [Here](https://bugs.launchpad.net/openstack-manuals/+bug/1585473) is another similar description. – eblock Aug 19 '20 at 13:40
  • @eblock , the first link I had seen. I did not try the 0.0.0.0, because of the warning message about security, but I changed to the suggested IP (10.20.20.1) and it did not work. Also, I enabled the `CACHES` section as the second link suggests, but without the `SESSION_ENGINE`, and it did work too... – Dalton Cézane Aug 19 '20 at 14:25
  • I just saw now that the file was not saved. Even using `sudo`. The first time this happens: I cannot save a text file with or without `sudo` using the nano editor. – Dalton Cézane Aug 19 '20 at 15:00

2 Answers2

1

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',
    },
}
0

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.