易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 1779|回复: 0
收起左侧

一次基于openstack报错urllib3问题处理过程

[复制链接]
发表于 2021-9-30 09:52:13 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
[root@controller1 src]# source /root/admin-openrc.sh 1 c, F7 C: U( F

0 f2 k# o5 h+ {' J查看实例时:
4 @) _3 }# x8 [[root@controller1 src]# openstack server list
9 O; q6 f+ N8 r: K/ |: @9 C9 bTraceback (most recent call last):
- `- F. B3 u# a1 Z1 N9 O  File "/usr/bin/openstack", line 5, in <module>+ A- K2 C3 c7 ~3 u; r
    from openstackclient.shell import main
. _  ^5 y( i! ]  File "/usr/lib/python2.7/site-packages/openstackclient/shell.py", line 22, in <module>% J5 e: E4 I- ^" ]
    from osc_lib.api import auth9 V; {9 Y/ E4 w
  File "/usr/lib/python2.7/site-packages/osc_lib/api/auth.py", line 18, in <module>9 M1 s3 {# T( e! g$ G
    from keystoneauth1.identity.v3 import k2k
# n2 }( Q) h7 s; ~# h3 p7 Q5 P! c  File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/__init__.py", line 14, in <module>
6 E) Q1 z7 P4 i    from keystoneauth1.identity import generic) J" h1 _# q7 l! s' \9 ]5 w
  File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/generic/__init__.py", line 14, in <module>2 t2 }8 r: L& I, v& Y9 z, w$ b
    from keystoneauth1.identity.generic.password import Password  # noqa- Z5 z2 b+ j4 M: K
  File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/generic/password.py", line 16, in <module># O0 C. Z8 o- a# ^* o! G+ h
    from keystoneauth1.identity import v32 B' o# I; p6 h1 [8 S5 i8 ?/ E
  File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/v3/__init__.py", line 19, in <module>
2 I7 d( e! o/ F% Z. |3 T5 j) M    from keystoneauth1.identity.v3.multi_factor import *  # noqa
6 v: ]% n1 \3 e: ~  File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/v3/multi_factor.py", line 14, in <module>
3 V( C6 [6 G3 B& J; L6 ~1 a. x    from keystoneauth1 import loading
/ t# K( {0 X$ W" N" c+ d  File "/usr/lib/python2.7/site-packages/keystoneauth1/loading/__init__.py", line 15, in <module>
: P4 @) ~: b9 v' C+ \" N    from keystoneauth1.loading import adapter
& D' v/ U1 B9 e$ s+ C8 `  File "/usr/lib/python2.7/site-packages/keystoneauth1/loading/adapter.py", line 13, in <module>
9 C: a- \3 T$ x4 X$ \# g+ o! U    from keystoneauth1 import adapter8 t5 [1 E5 R; e$ n4 Z$ _
  File "/usr/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 17, in <module>2 c& @' u7 F0 v) k
    from keystoneauth1 import session; V8 x( K+ c8 a1 F
  File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 25, in <module>
8 G1 s" O+ Y' L( o5 y- w2 w$ d    import requests
# b9 l8 A3 v" m1 T# @% D, q; O  File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 43, in <module>
, V! A/ J5 X, t; G. o2 g    import urllib3  J8 x( q, X( x' q5 E5 ~: O" m
  File "/usr/lib/python2.7/site-packages/urllib3/__init__.py", line 10, in <module>
& {4 A5 H( m( K* N1 l$ a    from .connectionpool import (. a+ I0 x/ e4 n  Q
  File "/usr/lib/python2.7/site-packages/urllib3/connectionpool.py", line 31, in <module>: X& ~8 B; _( a; l( v+ b3 f
    from .connection import () h$ G* ?4 }7 V) ?& s* q. t
  File "/usr/lib/python2.7/site-packages/urllib3/connection.py", line 45, in <module>
2 m' K1 B/ i4 B% W7 {7 B    from .util.ssl_ import (
6 h$ P% m- w6 W$ I  File "/usr/lib/python2.7/site-packages/urllib3/util/__init__.py", line 5, in <module>
! ^. X6 N* N0 ]9 i( g. v8 K( R    from .request import SKIP_HEADER, SKIPPABLE_HEADERS, make_headers2 k* _+ d' h8 J
  File "/usr/lib/python2.7/site-packages/urllib3/util/request.py", line 5, in <module>
3 h* S! D8 `, @# A% P    from ..exceptions import UnrewindableBodyError
! i* I& ^; M& W- e- I/ Z% bImportError: cannot import name UnrewindableBodyError2 O- F. @7 I- P
2 V9 s, e1 D% r
咦,报错了:( p" M0 D2 O1 C6 |6 n% N+ a" ^3 T

/ \: \6 g2 ^+ U5 s% U: W6 I$ q9 F
) L) a( R# s4 E# S4 N  |! e检查安装包:' t: e* S6 T2 \2 X1 F, d9 Z0 w
[root@controller1 src]# rpm -qa |grep urllib3
5 ^& }* m3 c6 Q6 V2 ?[root@controller1 src]# rpm -qa |grep python-urllib3
) P: o  t+ B# Q# p2 N0 D; s! q6 u
3 z: a3 S( e9 c! c$ K& p- j那就使用pip安装:; ?: v; J1 ]2 l' Y* I
[root@controller1 src]# pip install -y urllib3* Y3 }* U9 B! z3 V! e3 v
Usage:   & |5 O2 E7 V( Q# q) ~
  pip install [options] <requirement specifier> [package-index-options] ...) f# N& E: K. v& Q
  pip install [options] -r <requirements file> [package-index-options] ...
6 b! L8 _7 n1 @  pip install [options] [-e] <vcs project url> ...  z. K5 [7 P$ K6 b5 x' E: `! W
  pip install [options] [-e] <local project path> ...9 l0 r% n9 O  i  C+ M: h( z8 b- W
  pip install [options] <archive url/path> ...
7 _7 g4 m9 p$ v9 Z, m9 hno such option: -y
2 j4 W! ~$ F* }4 x/ p7 H9 F2 s, Z; O3 x: s% P) f: _* o
[root@controller1 src]# pip install -I urllib38 q2 Y% f! O6 h8 x
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.' |: i8 R$ q( L- l9 D  ^, Y# Y' G
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/3 H8 n4 J: |2 b3 x; E
Collecting urllib32 \3 A" `/ z+ q/ c8 `0 Y5 f
  Downloading http://mirrors.aliyun.com/pypi/packages/af/f4/524415c0744552cce7d8bf3669af78e8a069514405ea4fcbd0cc44733744/urllib3-1.26.7-py2.py3-none-any.whl (138 kB)  H+ U  l' x! q' o9 X
     |████████████████████████████████| 138 kB 1.1 MB/s ; q; {( E4 z- B3 Z
Installing collected packages: urllib3
6 J, F% }2 H' g1 hSuccessfully installed urllib3-1.26.7
6 B( f' |4 C$ u0 ^" t
" G- j' ^) \( _! r  p4 S2 R/ N+ ~5 e! B. W& {; E- [$ h
更新下是否有更新包:) f" L0 k& W# \; g) Y& ]  E

! z; ]" e8 @8 I0 s" c[root@controller1 src]# pip install -U urllib3- b1 z1 v$ O* [2 \# M& g
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality./ F4 q" K( |' o2 H6 l. `$ A: Z4 k
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
& U0 B, ]) u4 a9 I- s3 U/ R# bRequirement already up-to-date: urllib3 in /usr/lib/python2.7/site-packages (1.26.7)
* v6 P% M: b6 T) B& n9 ^4 N
) b3 Q0 s1 a! H& W' N! ?1 P7 f* m+ @
执行实例查看:
$ m" d, t( H4 S  r" z. `[root@controller1 src]# openstack server list
. g! `5 b+ w$ T: ?/usr/lib/python2.7/site-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (1.26.7) or chardet (2.2.1) doesn't match a supported version!
/ s& G: z! u1 `0 o4 x  RequestsDependencyWarning)' U$ j3 Z8 m7 X& i
+--------------------------------------+---------+--------+-----------------------+-------+----------------++ ~  J2 T! \& \* O
| ID                                   | Name    | Status | Networks              | Image | Flavor         |
" e; t, T% ~# s8 S; V1 A/ `+--------------------------------------+---------+--------+-----------------------+-------+----------------+
  _( |. @  e% S3 _2 E| b98e0105-d463-412e-beac-c94a18b15207 | testte  | ACTIVE | vlan3079=10.160.79.10 |       | type-4c-8g-30g |
, ^" `8 x. S/ T* I. X+ }* f! C* p. C| 58fc002b-9cc6-4bc8-9f52-28fad1ef4f46 | test-vm | ACTIVE | vlan3079=10.160.79.15 |       | type-4c-8g-30g |1 D( _0 I! v8 G, t) Y. h9 c+ F
+--------------------------------------+---------+--------+-----------------------+-------+----------------+
3 r/ K/ C+ ~4 `  ]
2 I" K6 r- F" s) q/ v
1 V$ O8 W# D+ x! F0 t( U尝试安装chardet:
3 X5 U) y1 `8 n$ W: X; c( X
7 G, V' I; c1 B8 w[root@controller1 src]# pip install -I chardet
3 a6 W0 m* H: A6 g$ IDEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
+ c) ~4 |; a+ y" u1 l# }$ XLooking in indexes: http://mirrors.aliyun.com/pypi/simple/# K3 \+ \9 G7 {# Z+ _5 ~6 ?; Y
Collecting chardet4 s2 b2 C; u2 z4 `) h
  Downloading http://mirrors.aliyun.com/pypi/packages/19/c7/fa589626997dd07bd87d9269342ccb74b1720384a4d739a1872bd84fbe68/chardet-4.0.0-py2.py3-none-any.whl (178 kB): J3 l# O& a) }5 ?5 R" ~% b. P
     |████████████████████████████████| 178 kB 636 kB/s : V( A5 P" z; T& G/ K0 F4 ^) l" i
Installing collected packages: chardet2 B- B: k8 U2 q# r+ z0 ^, |, l
Successfully installed chardet-4.0.05 h3 v8 U/ |% \' X
5 g# J; S' {$ n# z: I" R& C" F) w
' \$ m* ^- S0 w8 M" ^3 S7 R0 H5 W
再次执行:
3 j9 z, T. b1 W$ `9 N6 M+ f8 ~[root@controller1 src]# openstack server list
2 N8 M8 g  h# ?5 b. k- k: s+--------------------------------------+---------+--------+-----------------------+-------+----------------+
4 F$ V2 h& D! i& t) k) [  r* U| ID                                   | Name    | Status | Networks              | Image | Flavor         |
  q: T8 a$ A1 A4 d+--------------------------------------+---------+--------+-----------------------+-------+----------------+; d* U) ?1 i9 l8 @! ]
| b98e0105-d463-412e-beac-c94a18b15207 | testte  | ACTIVE | vlan3079=10.160.79.10 |       | type-4c-8g-30g |
" J8 y; ?9 Z$ Z2 D1 s| 58fc002b-9cc6-4bc8-9f52-28fad1ef4f46 | test-vm | ACTIVE | vlan3079=10.160.79.15 |       | type-4c-8g-30g |2 I: h2 _+ Y9 N3 j) W. z' T
+--------------------------------------+---------+--------+-----------------------+-------+----------------+
5 ?! o1 _* A' ^* w: q[root@controller1 src]#
8 j# Q. C( \6 N  r1 |! |( Y) {8 W/ |* o
视乎问题被解决了。
/ t& T6 Z8 Y+ B/ K, i. T过程感觉有点匪夷所思。
4 V% g9 D* e6 R/ k! g& S; t/ B
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 点击这里给我发消息

GMT+8, 2026-4-8 15:23 , Processed in 0.041561 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

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