前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >openstack中dashboard页面RuntimeError: Unable to create a new session key. It is likely that the cache i

openstack中dashboard页面RuntimeError: Unable to create a new session key. It is likely that the cache i

作者头像
yaohong
发布2019-09-11 16:09:30
1.1K0
发布2019-09-11 16:09:30
举报
文章被收录于专栏:姚红专栏姚红专栏

环境是centos7,直接跑在服务器上。

按照官网一步步安装openstack,到验证dashborad时出错。

登录http://192.168.1.73/dashboard ,输入域名,用户名,密码,出现错误,无法进入界面

tail -40 /etc/httpd/logs/error_log 查看打印

发现

代码语言:javascript
复制
[Sat Aug 12 19:42:16.701521 2017] [:error] [pid 10885] Could not process panel theme_preview: Dashboard with slug "developer" is not registered.
[Sat Aug 12 19:44:41.533207 2017] [:error] [pid 10885] Login successful for user "admin".
[Sat Aug 12 19:45:52.537140 2017] [:error] [pid 10885] Internal Server Error: /dashboard/auth/login/
[Sat Aug 12 19:45:52.556116 2017] [:error] [pid 10885] Traceback (most recent call last):
[Sat Aug 12 19:45:52.556129 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 223, in get_response
[Sat Aug 12 19:45:52.556135 2017] [:error] [pid 10885]     response = middleware_method(request, response)
[Sat Aug 12 19:45:52.556140 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/django/contrib/sessions/middleware.py", line 50, in process_response
[Sat Aug 12 19:45:52.556145 2017] [:error] [pid 10885]     request.session.save()
[Sat Aug 12 19:45:52.556148 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/django/contrib/sessions/backends/cache.py", line 53, in save
[Sat Aug 12 19:45:52.556153 2017] [:error] [pid 10885]     return self.create()
[Sat Aug 12 19:45:52.556157 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/django/contrib/sessions/backends/cache.py", line 48, in create
[Sat Aug 12 19:45:52.556180 2017] [:error] [pid 10885]     "Unable to create a new session key. "
[Sat Aug 12 19:45:52.556185 2017] [:error] [pid 10885] RuntimeError: Unable to create a new session key. It is likely that the cache is unavailable.
[Sat Aug 12 20:15:27.128247 2017] [:error] [pid 10885] Login successful for user "admin".
[Sat Aug 12 20:15:33.377599 2017] [:error] [pid 10885] Internal Server Error: /dashboard/auth/login/
[Sat Aug 12 20:15:33.377660 2017] [:error] [pid 10885] Traceback (most recent call last):
[Sat Aug 12 20:15:33.377665 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
[Sat Aug 12 20:15:33.377668 2017] [:error] [pid 10885]     response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Sat Aug 12 20:15:33.377671 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
[Sat Aug 12 20:15:33.377674 2017] [:error] [pid 10885]     return view(request, *args, **kwargs)
[Sat Aug 12 20:15:33.377677 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
[Sat Aug 12 20:15:33.377680 2017] [:error] [pid 10885]     response = view_func(request, *args, **kwargs)
[Sat Aug 12 20:15:33.377682 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
[Sat Aug 12 20:15:33.377685 2017] [:error] [pid 10885]     response = view_func(request, *args, **kwargs)
[Sat Aug 12 20:15:33.377688 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/openstack_auth/views.py", line 103, in login
[Sat Aug 12 20:15:33.377691 2017] [:error] [pid 10885]     **kwargs)
[Sat Aug 12 20:15:33.377694 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/django/views/decorators/debug.py", line 76, in sensitive_post_parameters_wrapper
[Sat Aug 12 20:15:33.377697 2017] [:error] [pid 10885]     return view(request, *args, **kwargs)
[Sat Aug 12 20:15:33.377699 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
[Sat Aug 12 20:15:33.377702 2017] [:error] [pid 10885]     response = view_func(request, *args, **kwargs)
[Sat Aug 12 20:15:33.377704 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
[Sat Aug 12 20:15:33.377707 2017] [:error] [pid 10885]     response = view_func(request, *args, **kwargs)
[Sat Aug 12 20:15:33.377709 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/django/contrib/auth/views.py", line 51, in login
[Sat Aug 12 20:15:33.377712 2017] [:error] [pid 10885]     auth_login(request, form.get_user())
[Sat Aug 12 20:15:33.377714 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 110, in login
[Sat Aug 12 20:15:33.377717 2017] [:error] [pid 10885]     request.session.cycle_key()
[Sat Aug 12 20:15:33.377720 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py", line 285, in cycle_key
[Sat Aug 12 20:15:33.377723 2017] [:error] [pid 10885]     self.create()
[Sat Aug 12 20:15:33.377725 2017] [:error] [pid 10885]   File "/usr/lib/python2.7/site-packages/django/contrib/sessions/backends/cache.py", line 48, in create
[Sat Aug 12 20:15:33.377728 2017] [:error] [pid 10885]     "Unable to create a new session key. "
[Sat Aug 12 20:15:33.377730 2017] [:error] [pid 10885] RuntimeError: Unable to create a new session key. It is likely that the cache is unavailable.

意思大概是:

因为它周期性连接到非本地缓存有问题。官网写的有bug。

把/etc/openstack-dashboard/local_settings 中 SESSION_ENGINE = 'django.contrib.sessions.backends.cache' 应改为 SESSION_ENGINE = 'django.contrib.sessions.backends.file'

重启服务,然后重新登录成功。

代码语言:javascript
复制
systemctl restart httpd.service memcached.service
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017-08-12 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档