找回密码
 注册
查看: 3717|回复: 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.
0 v: O* J" ?3 }, b/ f$ }[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()
/ u9 u" i" m2 ?. Y% y7 C% x, R& K. P* ]  W# m7 o  M6 w9 d  E; F
[Mon Jul 26 17:07:40.541536 2021] [wsgi:error] [pid 115360:tid 139772269872896]   argspec = inspect.getargspec(function)2 U; l$ V* n% r. U

2 U- p; m( Z8 l; n7 I0 p+ i
8 I1 z2 [% y: W/ `5 N0 R
$ d% A* `2 v) s, D# }7 |( P
openstack Train 版按照官方文档安装后
- v/ O: C& k) j" B" x, J+ S7 ?1.访问/dashboard后跳转到/auth/login报404(操作下面2步可以解决dashboard访问404问题,请跳过此步骤)
: `) \& j: ?4 `. a! [, V% P, U/ q. l2 R解决方法如下:6 F6 ?, h$ \1 Y' K3 f
cd /usr/share/openstack-dashboard
3 W6 j9 m# f& Opython manage.py make_web_conf --apache > /etc/httpd/conf.d/openstack-dashboard.conf
/ m$ d: w/ U  ]7 ?
4 u5 s' a% E0 d5 P" l/ u0 X2 W7 [2.建立策略文件(policy.json)的软链接,否则登录到dashboard将出现权限错误( Y- a  m: n9 @5 A) Y3 B
解决方法如下:8 Y) B" u& h; W* V* x% ?, \3 Y% u, Q% G

; q  {8 H# r$ _# vln -s/etc/openstack-dashboard /usr/share/openstack-dashboard/openstack_dashboard/conf
$ C! A: b- g& j# p" z7 {2 x
& c( U+ N6 b4 Z8 T) H9 d2 i2 A3.身份管理里面的项目、用户、组和角色都无法打开,日志提示:
  g$ h/ }, ]7 \$ yDaemon process called 'keystone-public' cannot be accessed by this WSGI application: /usr/bin/keystone-wsgi-public( m. E3 c; f8 ^
解决方法如下:
. J* Y" s2 S* s' E! f9 X9 k' m0 Z0 n. Y! ?
编辑以下文件,找到WEBROOT ='/' 修改为WEBROOT ='/dashboard' (官方未提及坑点之一)
7 f7 q; z8 z. M$ Yvim/usr/share/openstack-dashboard/openstack_dashboard/defaults.py: i6 Q- m9 n) d0 d0 ~; F1 x. ^- L. W: ]
vim/usr/share/openstack-dashboard/openstack_dashboard/test/settings.py( [+ \; H0 K- N7 \% L" e
vim/usr/share/openstack-dashboard/static/dashboard/js/9937cc9f2cae.js$ C9 @/ D8 \; s! h; m

5 D6 P& k' W  ^5 R3 \* U
; h7 c3 ?! G6 t=====================================================================================================================+ e4 P3 {% G3 X" i8 m
20210708更新
; N( r% c( Z2 Y# b安装victoria版本dashboard项目
' h: ?; R9 A/ `5 {1.7 e( f1 W8 A! Y" e; z) f8 w! ^
登陆Openstack dashboard ,页面出错,信息如下:
: a: L" `7 H- Q% K: c( ?Something went wrong!
6 H! i+ X  E+ j; s) |An unexpected error has occurred. Try refreshing the page. If that doesn't help, contact your local administrator.+ G# l. D+ y( X

' T. ^2 ]  H# W查看httpd日志报如下错误信息:/ R9 ?& K4 U7 A# y" e
tail /var/log/httpd/error_log -f- ~* O( Q- _1 D7 x' M
[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. "0 n# ]( E1 a9 j2 R6 |3 O
[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./ A" L! b9 c% |
解决方法:, I6 f8 X; Y5 F; S
复制代码
  c9 J1 X+ \, a$ J9 {4 x$ ]将 /etc/openstack-dashboard/local_settings 里的
7 x! r# g$ s( d+ Z* \2 M% D! |SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
7 I" d$ G0 U& _# m* _9 Z! G改成
& G6 D; K* d% l$ u6 [+ r. gSESSION_ENGINE = 'django.contrib.sessions.backends.file'
( b% E8 B$ z7 B- C0 g8 v9 d或者7 B  `2 N3 J: n: X1 o
SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies'
6 p+ v: k) U7 ~! O. \7 M- s) W; b#SESSION_ENGINE = 'django.contrib.sessions.backends.file'$ w' {% r% x3 K$ T

) \+ `. s5 U6 l: K' B+ ]: m: W重启httpd和memcached. l& ?! `4 z9 f6 H8 ^# {/ v
成功进入Dashboard7 f, ~8 }, \3 v* @* `5 }
复制代码3 b7 I" r; f0 A' X6 x
- l3 [6 f( w# m8 |
2.9 V& y6 T; J  y" h- @  `: Y; s7 K4 `
查看httpd日志报如下错误信息:/ w* C/ o1 I' r
tail /var/log/httpd/error_log -f
0 H5 P# h, E8 b: J) k2 |; w5 h[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-public8 Y7 ~8 J* H$ S" C$ C
[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.
: m; v# v+ v5 [* y2 o解决方法:
- ~( Y/ g* F, y, m' t9 ^+ L复制代码" X; j& m3 H8 [( K( b2 L1 t- d) Y
UPDATE with SOLUTION from neal_utas:  I& |5 D, M- Z  E7 D
The 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:2 H: }9 Y/ I! p9 M
OPENSTACK_KEYSTONE_URL = "http://%s:5000/identity/v3" % OPENSTACK_HOST
+ ~% }% d) ]# v( p4 ]After making that change and then restarting (systemctl reload apache2.service) it works.
1 G3 ^) x! l; x2 k
& a8 u/ N  V7 E

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-7-26 17:33:28 | 显示全部楼层
原因8 Y; d4 }2 L4 n/ h; x: Z6 O
#dashboard 路径指向问题% F, g/ N5 v! e8 ^7 w( R- Z
解决方案
/ k) X) N+ X/ E8 u, ?% }- x8 u* o#重建dashboard配置,官网没有指明部署时配置过就不需要再配置
9 M) X$ U7 L3 y) m$ gcd /usr/share/openstack-dashboard
/ y9 u% a$ R. O' K9 C& f4 |# p; }: npython manage.py make_web_conf --apache > /etc/httpd/conf.d/openstack-dashboard.conf8 B% f: X1 }5 x
5 c0 H( Z7 T3 ^0 Y4 H3 w
#登录到dashboard将出现权限错误和显示混乱,需要建立策略的软链接部署时配置过就不需要再配置
4 i/ i5 S; M+ Pln -s /etc/openstack-dashboard /usr/share/openstack-dashboard/openstack_dashboard/conf
# T; a. _; D5 e& Y( k
/ y- h+ X  A8 F8 k8 K, \2 F+ c) c#在local_settings底下新增根目录指向' }( a7 f) l% A, Y4 B
#vim /etc/openstack-dashboard/local_settings' [' P5 [+ P- v' b0 E- t
WEBROOT = '/dashboard/'
) H6 O9 J5 U6 {' ?+ x) H7 t( Y4 m2 U" O+ @
#vim /etc/httpd/conf.d/openstack-dashboard.conf
6 ~- N: o8 M3 i#将原有的配置注释掉,添加以下配置
* h: O0 S% ^# ]# M) N0 K#WSGIScriptAlias / /usr/share/openstack-dashboard/openstack_dashboard/wsgi.py1 f, Q( W1 X8 ^0 m# p  ^
#Alias /static /usr/share/openstack-dashboard/static8 T: P( J' n+ n- k  M$ k- k
WSGIScriptAlias /dashboard /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
6 k# V# a. i9 p5 y9 _7 F# n4 ?* [5 }2 lAlias /dashboard/static /usr/share/openstack-dashboard/static  Z9 W0 A! A, k/ x( m
$ U) c! O3 D5 E! c% x, z
#重启httpd及memcached
3 m1 H' q6 q4 W# q5 Z! Y  a+ G/ U! fsystemctl restart httpd.service
1 a7 O4 @- O' n8 R4 ?systemctl restart memcached.service
* m, G# e0 t. h2 E3 |' E$ k
9 {9 X/ u: M2 z2 W# e) ~0 H( Q; y" D+ D

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:04 , Processed in 0.012706 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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