找回密码
 注册
查看: 3716|回复: 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.$ P; W1 X4 Q% e) d. N6 b. V1 t
[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()
8 F3 h8 }+ v8 T$ @, i% e. w: ?. P: ]; ~( E
[Mon Jul 26 17:07:40.541536 2021] [wsgi:error] [pid 115360:tid 139772269872896]   argspec = inspect.getargspec(function)
- y9 G0 ]5 m, E! m7 C7 ^2 J: L- S) j. Z( v  R# y  p4 k# Y& O

" Y, i0 ]' o6 H" U9 \$ j0 Y8 \6 `9 d. P( M
openstack Train 版按照官方文档安装后
. h9 Q% H- y7 ^' @: H1.访问/dashboard后跳转到/auth/login报404(操作下面2步可以解决dashboard访问404问题,请跳过此步骤)
) G/ P% |$ e7 M1 `( e5 \/ R! a解决方法如下:
; d8 X" D. C) W! m1 i( {+ jcd /usr/share/openstack-dashboard+ \/ _" K% O8 I6 \' j4 Y% W
python manage.py make_web_conf --apache > /etc/httpd/conf.d/openstack-dashboard.conf8 Y3 }; Q  i0 Z& q3 ]# L, [3 A: R3 y

& j9 B$ G' t! y( W. m2.建立策略文件(policy.json)的软链接,否则登录到dashboard将出现权限错误% Q) `% e  i  e+ X( ^) d6 H
解决方法如下:
6 p2 C, l! `; n; X
  Y) l4 X7 `$ Q6 O$ g% Gln -s/etc/openstack-dashboard /usr/share/openstack-dashboard/openstack_dashboard/conf
! {' H% f/ v( x: R
# G! r5 G/ K/ E9 h( n, W3.身份管理里面的项目、用户、组和角色都无法打开,日志提示:8 p) y+ I4 i% `& t7 b$ M! R. G
Daemon process called 'keystone-public' cannot be accessed by this WSGI application: /usr/bin/keystone-wsgi-public
7 d' M5 p: w' g- K2 }$ l9 U解决方法如下:  d! v* ]6 |" |# ^
; O( |7 `! v  r- C. x8 H; U
编辑以下文件,找到WEBROOT ='/' 修改为WEBROOT ='/dashboard' (官方未提及坑点之一)
* ?( r% T1 W% v( s/ `/ C( _  ~vim/usr/share/openstack-dashboard/openstack_dashboard/defaults.py
2 I  v8 S' R8 @0 i0 wvim/usr/share/openstack-dashboard/openstack_dashboard/test/settings.py
+ \7 v9 }! a5 Q- ~* L# `/ \vim/usr/share/openstack-dashboard/static/dashboard/js/9937cc9f2cae.js
& N: j6 z7 Z) v. @$ O! a% C3 k
' j# L* q, `3 F& M3 W- I0 J0 M5 W
1 L* ~" N0 i* p: ?=====================================================================================================================
# r" x3 _  j2 |7 J! b20210708更新! d) t& G/ M1 q; w0 e% a1 A
安装victoria版本dashboard项目
" O$ w7 d# }- k) e1.2 b8 G+ A9 z# l) x) W
登陆Openstack dashboard ,页面出错,信息如下:5 B8 l* O0 B" U9 h: }, y
Something went wrong!
/ o9 B  ^& H( f! e0 j5 ^- s! _An unexpected error has occurred. Try refreshing the page. If that doesn't help, contact your local administrator.) D) f8 K3 Z) N7 H3 v" i& z
3 E- F% E! `. ^; i* V& R9 T; u7 u
查看httpd日志报如下错误信息:3 B# d) y9 H/ L0 [
tail /var/log/httpd/error_log -f
7 b4 }* k& ]; c* w+ ~0 B# t* g[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. "
, U7 |) q. E; P: V& `2 l1 ?[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.
0 p3 ~3 `0 B2 o3 h: i" B9 n解决方法:
( {( ^' C+ O" _- }! K! p7 E8 x复制代码
. Y9 `5 x3 x$ ?# S+ k1 H$ P+ Q. x将 /etc/openstack-dashboard/local_settings 里的
  r) A3 G6 ?5 d  a* zSESSION_ENGINE = 'django.contrib.sessions.backends.cache', c1 r$ y" R% H/ F$ t! q. `
改成
5 I, ~/ q# r# k# [- tSESSION_ENGINE = 'django.contrib.sessions.backends.file'
, z( S; m  O; ?, o或者
  E- @! D  _3 _" }: q: h! c: j+ vSESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies'! y3 S2 u. I/ y+ w* c0 c
#SESSION_ENGINE = 'django.contrib.sessions.backends.file'
8 `8 k4 u& O$ O! ~; e5 ?/ v% s, r6 C
重启httpd和memcached' w; e- X) ]7 F" B2 V4 Q. D
成功进入Dashboard, ^. u$ c! |  b& j
复制代码
/ y7 ~" K; f" K. S6 r, I
1 O4 S& E# M9 y7 A3 ~2.
( X; ~; N1 U3 U2 k; i8 Y0 d9 O查看httpd日志报如下错误信息:3 A5 `% a  \0 U) }. n1 F/ `
tail /var/log/httpd/error_log -f5 z' J( A* c9 L0 r- v& r6 h* b
[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
/ _2 L; s: t6 q4 z2 H' M; P[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.7 n7 i" u: a# H0 s
解决方法:7 s+ ^: C0 v" }. }& n6 X
复制代码
8 o# j, h; k# c$ l% J1 r  _UPDATE with SOLUTION from neal_utas:6 V' N* A3 h! H( o$ H
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:/ U$ |# `+ J7 a+ s6 ]6 l; K/ `/ {
OPENSTACK_KEYSTONE_URL = "http://%s:5000/identity/v3" % OPENSTACK_HOST
( s, R9 J! A8 \+ `After making that change and then restarting (systemctl reload apache2.service) it works.0 o; b* f" W1 d6 p3 t9 O0 K
9 q7 A, L5 _/ \2 F# p

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-7-26 17:33:28 | 显示全部楼层
原因* y/ m* W+ o9 t5 F
#dashboard 路径指向问题4 j0 ~) w' ?; G1 s
解决方案0 Q8 E3 ~7 }5 I0 w4 j
#重建dashboard配置,官网没有指明部署时配置过就不需要再配置
; N9 ?; f- F" X' E/ ucd /usr/share/openstack-dashboard: _) f, G3 e1 E4 p# R
python manage.py make_web_conf --apache > /etc/httpd/conf.d/openstack-dashboard.conf
6 L& m3 b7 Q- r* ?! k1 j2 ?5 y1 u$ ~3 d+ H8 t. ~. K- [
#登录到dashboard将出现权限错误和显示混乱,需要建立策略的软链接部署时配置过就不需要再配置
2 u4 o7 Q, i4 ]; B( s. |ln -s /etc/openstack-dashboard /usr/share/openstack-dashboard/openstack_dashboard/conf
/ N" f* ?8 T' f- Q3 x8 g- F9 v$ K: o1 T  S% V- k2 V. D
#在local_settings底下新增根目录指向
# \, `* C7 @0 X" [8 W#vim /etc/openstack-dashboard/local_settings
; f0 K0 m" r/ C5 bWEBROOT = '/dashboard/'2 U( G& ]# {, F: z9 K
0 H3 y! O8 Z' [$ Q3 `
#vim /etc/httpd/conf.d/openstack-dashboard.conf
  s, s: \7 X8 G6 ?8 ^# t#将原有的配置注释掉,添加以下配置
  h, r/ k, L  y# c( ]1 y#WSGIScriptAlias / /usr/share/openstack-dashboard/openstack_dashboard/wsgi.py
4 ~9 r1 S) i7 U; c+ ^#Alias /static /usr/share/openstack-dashboard/static
$ s" `3 k5 j9 q/ q% Y" f8 r: U' lWSGIScriptAlias /dashboard /usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
( ~- i  q9 V3 u7 IAlias /dashboard/static /usr/share/openstack-dashboard/static1 c7 k* B7 ]1 d2 p: S6 G5 j7 x

% A! p5 N4 G& ~/ }2 q) e4 u2 D# l#重启httpd及memcached* v- j$ j% i6 K0 |
systemctl restart httpd.service# f2 h* u/ x5 k/ T% n0 E1 I9 u
systemctl restart memcached.service
9 y9 R  c' \- |$ w9 V; M8 `
4 j' [* M8 ]0 u7 S1 K+ b' T+ i$ {$ }8 W0 k9 ^

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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