找回密码
 注册
查看: 3718|回复: 2

[wsgi:error]WARNING:root:Use of this 'djano.wsgi' file has been deprecated since

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-7-26 17:13:00 | 显示全部楼层 |阅读模式
[Mon Jul 26 17:07:39.149109 2021] [wsgi:error] [pid 115360:tid 139772269872896] WARNING:root:Use of this 'djano.wsgi' file has been deprecated since the Rocky release in favor of 'wsgi.py' in the 'openstack_dashboard' module. This file is a legacy naming from before Django 1.4 and an importable 'wsgi.py' is now the default. This file will be removed in the T release cycle.
% g- u6 D; u7 j7 X/ i[Mon Jul 26 17:07:40.541489 2021] [wsgi:error] [pid 115360:tid 139772269872896] /usr/lib64/python3.6/site-packages/scss/namespace.py:172: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()4 `/ O6 R9 n! E! _) B' a& l3 T
0 o6 Y, d5 ?. v6 Q& _
[Mon Jul 26 17:07:40.541536 2021] [wsgi:error] [pid 115360:tid 139772269872896]   argspec = inspect.getargspec(function)& n$ M& e% _( p0 E+ ]& [
* N4 `2 N* M3 ]" a7 ~, }
& ^6 Y3 n; T2 N5 A9 _
  E* P6 |* G5 H5 n3 S
openstack Train 版按照官方文档安装后
8 w: F& M$ H5 R9 Q1.访问/dashboard后跳转到/auth/login报404(操作下面2步可以解决dashboard访问404问题,请跳过此步骤)5 T% z( |5 n5 `" O4 w* d) P* F) E! E
解决方法如下:4 R2 z% e% x8 m" G5 P' P& C  E" g
cd /usr/share/openstack-dashboard
6 [8 q) `$ Y* `& I) v$ Wpython manage.py make_web_conf --apache > /etc/httpd/conf.d/openstack-dashboard.conf
5 X* X$ `  j6 Z* E# q " c5 D2 c5 B; i5 e- q& E
2.建立策略文件(policy.json)的软链接,否则登录到dashboard将出现权限错误
' x! A' n7 H7 I: [- @  E解决方法如下:# Y9 C# u7 y8 A9 o6 }9 s8 @, [

. ~0 w6 x7 u4 X/ x5 j; s* T1 X" Oln -s/etc/openstack-dashboard /usr/share/openstack-dashboard/openstack_dashboard/conf
% b7 |$ k0 J' j+ |' v " ~' m! ?+ b6 Z$ G" q
3.身份管理里面的项目、用户、组和角色都无法打开,日志提示:
+ `  C/ w2 ]8 J5 tDaemon process called 'keystone-public' cannot be accessed by this WSGI application: /usr/bin/keystone-wsgi-public
7 G' V0 t. g6 `9 t8 ~1 s3 z- _解决方法如下:' y; V( P% w4 J# @

7 D- _) T2 v5 t: t" T) f编辑以下文件,找到WEBROOT ='/' 修改为WEBROOT ='/dashboard' (官方未提及坑点之一)- F& A# [" w  k6 R+ _4 Z5 K
vim/usr/share/openstack-dashboard/openstack_dashboard/defaults.py
* F/ {9 k& B9 x- T6 Fvim/usr/share/openstack-dashboard/openstack_dashboard/test/settings.py) [5 o3 S8 c/ N; ?: U
vim/usr/share/openstack-dashboard/static/dashboard/js/9937cc9f2cae.js/ F8 Y$ I; ]; A5 Z: a& `1 ^% k
- P7 b, y- s0 i) g- d
7 z) Y+ ~- r: c
=====================================================================================================================  V1 S1 M/ b/ N6 p3 }& n
20210708更新: [! k1 N$ n# X
安装victoria版本dashboard项目
& v, t  }8 r8 Y  N/ p, h5 r1.' B4 D9 A* Y$ b6 {2 }7 }2 H% ^! P; ~
登陆Openstack dashboard ,页面出错,信息如下:
; X/ k, _* B+ ^+ Z/ Q0 y$ eSomething went wrong!
) _) E% R, q  ^- CAn unexpected error has occurred. Try refreshing the page. If that doesn't help, contact your local administrator.
, u# l* T8 b2 C* e  o3 s  x* G8 P: x( h6 p" e' Z& e3 r$ A
查看httpd日志报如下错误信息:
, ~2 u. n$ i5 o( P9 [9 x% L" wtail /var/log/httpd/error_log -f
1 O) B/ u5 Q. v5 Y% I/ L' K* x[Thu Jul 08 10:34:43.602238 2021] [wsgi:error] [pid 43360:tid 140630500005632] [remote 10.199.102.125:52676] "Unable to create a new session key. "
( N$ `/ }4 K: v$ @3 ~7 @+ i6 L[Thu Jul 08 10:34:43.602242 2021] [wsgi:error] [pid 43360:tid 140630500005632] [remote 10.199.102.125:52676] RuntimeError: Unable to create a new session key. It is likely that the cache is unavailable.
3 K5 r+ a" y9 D# W解决方法:: q9 E7 \5 F5 {% L, Y( C
复制代码5 n5 S9 K, X% l6 {# C$ Z! t
将 /etc/openstack-dashboard/local_settings 里的. ~# x( t$ L4 B. A8 ~
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
: h& P  O+ k6 T! h( y/ H* i1 F% b改成3 e9 x7 r; D" G# d
SESSION_ENGINE = 'django.contrib.sessions.backends.file'; s+ b# j; I7 L* M( _, G
或者7 P, }2 w2 I7 }% ?8 l
SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies'0 W+ ^" B. T! J/ b2 p8 k' i
#SESSION_ENGINE = 'django.contrib.sessions.backends.file'; P* j/ u* }8 w1 K! |! o( D% ^6 ^
6 N% U* A. C) e- R# @+ n
重启httpd和memcached
1 Q3 {1 W5 ~6 q2 |成功进入Dashboard) x1 g  k0 p0 ^2 u: ^& F
复制代码
; a$ ^1 d0 E& K; @1 D" [! a
% u( H5 U- q# u5 f% F' M2.- F+ @0 ^& t( [, ~& z" U& B
查看httpd日志报如下错误信息:1 X+ S; a4 Y) j$ `
tail /var/log/httpd/error_log -f
' m& T+ z3 D* Y2 G8 s[Thu Jul 08 10:44:55.289974 2021] [authz_core:error] [pid 44700:tid 140425917486848] [client 10.199.102.126:44924] AH01630: client denied by server configuration: /usr/bin/keystone-wsgi-public
" \' U) ^2 u0 f: I5 Q4 F0 j8 i[Thu Jul 08 10:44:55.290668 2021] [wsgi:error] [pid 44693:tid 140426236409600] [remote 10.199.102.125:59035] INFO openstack_auth.forms Login failed for user "admin" using domain "default", remote address 10.199.102.125.* T3 P# g/ J+ [2 P2 w
解决方法:3 w7 `1 m0 G9 i
复制代码: u- W7 `8 o. Y8 Z1 h( Z; o, }
UPDATE with SOLUTION from neal_utas:
+ x+ v2 l" V' kThe docs for horizon at docs.openstack.org (at least for ubuntu) are incorrect. When editing /etc/openstack-dashboard/local_settings.py, the online docs are missing port 5000. The correct entry for OPENSTACK_KEYSTONE_URL is:4 @) v+ [/ I+ y- x' n0 I7 V
OPENSTACK_KEYSTONE_URL = "http://%s:5000/identity/v3" % OPENSTACK_HOST
' q5 i) Y- O  s$ M' G" ~After making that change and then restarting (systemctl reload apache2.service) it works.! A) j, u; n- y

( A8 q  _: j' v$ d$ e

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-7-26 17:33:28 | 显示全部楼层
原因
3 ]3 Y7 Z, n' z0 t' I7 P2 T#dashboard 路径指向问题
+ X3 M2 |$ u  H9 e9 g+ v9 X2 ~解决方案; d' r* f! N# p, M
#重建dashboard配置,官网没有指明部署时配置过就不需要再配置) r9 R% a* }" Y' P& F
cd /usr/share/openstack-dashboard) ~, ^& ~. b5 E% _
python manage.py make_web_conf --apache > /etc/httpd/conf.d/openstack-dashboard.conf
* M* j2 `( p1 L3 X
( F: q8 \  _+ J; t/ O7 V0 M#登录到dashboard将出现权限错误和显示混乱,需要建立策略的软链接部署时配置过就不需要再配置* q, L9 U, G& ~+ _4 q+ v5 q- o
ln -s /etc/openstack-dashboard /usr/share/openstack-dashboard/openstack_dashboard/conf
( G/ R% Z! k6 l+ v0 T
) I* Z, Z3 ]5 m5 R#在local_settings底下新增根目录指向+ G' Q0 |  Z* u5 R
#vim /etc/openstack-dashboard/local_settings, K) O+ R  g; A5 p
WEBROOT = '/dashboard/', d. f7 ]# q- {" q
/ H+ w9 D( i/ y) a' |  k
#vim /etc/httpd/conf.d/openstack-dashboard.conf
! C3 `  d1 r: Z6 e; m2 e#将原有的配置注释掉,添加以下配置
. A0 S3 ^2 d" W#WSGIScriptAlias / /usr/share/openstack-dashboard/openstack_dashboard/wsgi.py
6 b+ \$ @: f+ x$ p#Alias /static /usr/share/openstack-dashboard/static
7 z, {* V5 `+ ]& IWSGIScriptAlias /dashboard /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
6 I8 T) V3 ~% P1 c# BAlias /dashboard/static /usr/share/openstack-dashboard/static( \8 s5 O4 i6 `) {7 O3 D6 l

1 G3 s4 ?8 B9 Y#重启httpd及memcached, J7 p9 d  I- ^4 B" S1 X
systemctl restart httpd.service
  V3 \* a4 c% J* w0 w# i# v3 isystemctl restart memcached.service+ [2 L2 ]6 @3 b& h/ P, D

$ G+ f0 i0 N& @
' R& S* d/ C3 |! l% Z

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-7-26 17:34:04 | 显示全部楼层
#在这里快速回复#修改horizon的配置文件/etc/openstack-dashboard/local_settings.py
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 02:06 , Processed in 0.022042 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表