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

小编 2026-07-04 阅读:810 评论:0
环境是centos7,直接跑在服务器上。按照官网一步步安装openstack,到验证dashbo...

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

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

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

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

 

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

发现

[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'

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

systemctl restart httpd.service memcached.service

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

 

                                                            															
版权声明

本文仅代表作者观点,不代表百度立场。
本文系作者授权百度百家发表,未经许可,不得转载。

热门文章
  • Sequential Monte Carlo Methods (SMC) 序列蒙特卡洛/粒子滤波/Bootstrap Filtering

    Sequential Monte Carlo Methods (SMC) 序列蒙特卡洛/粒子滤波/Bootstrap Filtering
    Problem Statement 我们考虑一个具有马尔可夫性质、非线性、非高斯的状态空间模型(State Space Model):对于一个时间序列上的观测结果{yt,t∈N}\\{ y_t , t \\in N \\}{yt​,t∈N},我们认为每个观测结果yty_tyt​的生成依赖于一个无法直接观察的隐变量xt∈{xt,t∈N}x_t \\in \\{x_t , t \\in N \\}xt​∈{xt​,t∈N},即:p(...
  • 机房智能化温湿度解决方式之POE供电以太网温湿度传感器

    机房智能化温湿度解决方式之POE供电以太网温湿度传感器
    机房智能化温湿度解决方式之POE供电以太网温湿度传感器 北京盈创力和电子科技有限公司 智能型TCP网口温湿度记录仪 北京IP网络温湿度记录仪厂家,北京盈创力和 北京智能型TCP网口温湿度记录仪IP网络温湿度记录仪是一种新型的基于TCP/IP协议双绞线以太网标准温湿度采集模块,利用它可以实现现场温度值、相对湿度值的采集,同时利用其自身的RJ45通信接口可以方便地和机房监控主机或交换机集线器进行联网。 工作于-40℃~85℃工业级带...
  • Hive 系统函数及示例

    Hive 系统函数及示例
    查看所有系统函数 show functions; 函数分类 内置函数【系统函数】 数学函数: floor、round、ceil、cos、log2等 字符串函数: length、reverse、trim、lower、get_json_object、repeat等 收集函数: size 转换函数: cast 日期函数: year、month、datediff、date、date_add等 条件函数: coalesce、case…w...
  • HTTP状态保持的原理

    HTTP状态保持的原理
    a)在用户登录之后,浏览器返回响应的时候会在响应中添加上cookieb)浏览器接收到cookie之后会自动保存c)当用户再次请求同一服务器中的其他网页的时候,浏览器会自动带上之前保存的cookied)服务接收到请求之后可以请 request 对象中取到cookie 判断当前用户是否登录  Http是无状态的,就是连接时数据互通,关闭后...
  • CSRF的原理和防范措施

    CSRF的原理和防范措施
    a)攻击原理:i.用户C访问正常网站A时进行登录,浏览器保存A的cookieii.用户C再访问攻击网站B,网站B上有某个隐藏的链接或者图片标签会自动请求网站A的URL地址,例如表单提交,传指定的参数iii.而攻击网站B在访问网站A的时候,浏览器会自动带上网站A的cookieiv.所以网站A在接收到请求之后可判断当前用户是登录状态,所以...
标签列表