将设为首页浏览此站
开启辅助访问 天气与日历 收藏本站联系我们切换到窄版

易陆发现论坛

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

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

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

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

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

x
[root@controller1 src]# source /root/admin-openrc.sh   ^* d8 n: D; U- O# p

: D! }0 R8 ^- c9 V查看实例时:, N9 y6 m+ F% P
[root@controller1 src]# openstack server list
0 A7 T. c+ M+ e9 I9 w$ r# tTraceback (most recent call last):( ]$ q/ g4 ^# T
  File "/usr/bin/openstack", line 5, in <module>
0 q, }) ?$ O2 ~    from openstackclient.shell import main; c0 Q* Z3 \  S+ p( j
  File "/usr/lib/python2.7/site-packages/openstackclient/shell.py", line 22, in <module>
! R: Z1 I& z- d! y) Q    from osc_lib.api import auth
! N: ~" A0 z0 C4 _; E# i8 E  File "/usr/lib/python2.7/site-packages/osc_lib/api/auth.py", line 18, in <module>; V4 S: D( L0 R8 Y' T% d7 C. N
    from keystoneauth1.identity.v3 import k2k
5 ]6 ~* r; F  h% P& W  File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/__init__.py", line 14, in <module>9 x" g5 M9 \  j  \% x- e+ d3 y
    from keystoneauth1.identity import generic
' f" e+ S3 h# t# V  File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/generic/__init__.py", line 14, in <module>
- V; T- r3 L6 E. v. u    from keystoneauth1.identity.generic.password import Password  # noqa0 p% Q) l* f; Q3 x) s/ @" s% ^
  File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/generic/password.py", line 16, in <module>) p7 ^$ W; \2 D
    from keystoneauth1.identity import v3
* L) C9 S. q$ b, W  File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/v3/__init__.py", line 19, in <module>
1 z  p( l9 _: `; i    from keystoneauth1.identity.v3.multi_factor import *  # noqa
8 ~9 f8 J0 Q. {+ R8 O4 Q  File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/v3/multi_factor.py", line 14, in <module>0 L* \& w  `' v. Z4 g$ `
    from keystoneauth1 import loading: @. b  y5 d0 F5 A1 D# ?
  File "/usr/lib/python2.7/site-packages/keystoneauth1/loading/__init__.py", line 15, in <module>
9 T9 y! ]8 ^4 N+ ]: A! ?8 ^    from keystoneauth1.loading import adapter9 x1 @- Q: z6 e* D
  File "/usr/lib/python2.7/site-packages/keystoneauth1/loading/adapter.py", line 13, in <module>: f& T" T8 _9 W
    from keystoneauth1 import adapter# o' `+ N3 }/ U: S/ i
  File "/usr/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 17, in <module>  l5 J. ^3 }9 @
    from keystoneauth1 import session
' @5 t% Y% O* c0 L0 O4 Y  File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 25, in <module>
* A) F- V5 T0 ~4 T, w, B# }    import requests$ Y9 L# m: Z& G5 v% H
  File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 43, in <module>8 S6 b% `7 R* Y# o& n$ x
    import urllib3
+ G' h  }. U& N$ a  f; f8 v  File "/usr/lib/python2.7/site-packages/urllib3/__init__.py", line 10, in <module>( T7 L# M( _+ {- d
    from .connectionpool import (4 e5 Z# \0 V, s8 v" i
  File "/usr/lib/python2.7/site-packages/urllib3/connectionpool.py", line 31, in <module>4 F: `" W0 o) ]! K
    from .connection import (5 k) j2 ], B. N
  File "/usr/lib/python2.7/site-packages/urllib3/connection.py", line 45, in <module>
, V4 ~; z' U( R    from .util.ssl_ import (, }" M  O5 g" N# ?; H
  File "/usr/lib/python2.7/site-packages/urllib3/util/__init__.py", line 5, in <module>
+ D' X; y+ S9 O( l1 c$ b: W    from .request import SKIP_HEADER, SKIPPABLE_HEADERS, make_headers# U: f% O* k9 Q9 b4 @/ m9 ]4 y
  File "/usr/lib/python2.7/site-packages/urllib3/util/request.py", line 5, in <module>, M0 l1 ?+ Q2 u( J
    from ..exceptions import UnrewindableBodyError
4 P, w8 F) d9 v' \+ F( E7 ^- e. t, \ImportError: cannot import name UnrewindableBodyError
  h1 F% Y$ Q/ P6 E2 \6 f9 s
+ S, G) e, f! w咦,报错了:" H+ Q3 z. @2 a6 k
: v9 e8 l+ U4 @4 L5 r
6 \" j' A/ K9 P7 w6 |
检查安装包:
& c6 M/ [9 g/ O/ `[root@controller1 src]# rpm -qa |grep urllib3( L  M, `* S& W) f+ W: N% e7 P
[root@controller1 src]# rpm -qa |grep python-urllib3
& U9 b/ g1 c$ R* K3 l9 W5 y
: V1 ~& _; s8 R  }3 i那就使用pip安装:2 P( ^/ A. B8 n1 I/ K0 z  B& f& h
[root@controller1 src]# pip install -y urllib3# K  @! t* Z1 b
Usage:   
* `& y& }. W; z9 q6 P; _  pip install [options] <requirement specifier> [package-index-options] ...
7 J/ w4 l/ V, R6 H+ W" G8 M  pip install [options] -r <requirements file> [package-index-options] ...
& l* P( f7 P2 N/ I9 q, V  pip install [options] [-e] <vcs project url> ...! X7 g/ j4 X' s. B! [
  pip install [options] [-e] <local project path> ...
: `- |( J, Z* B- ]  pip install [options] <archive url/path> ...
: M0 f) k, }9 @no such option: -y
# ^1 @1 r) ?  C. E- v, k- d" T+ B) S% c9 n: `8 h  c. n1 V! B, G
[root@controller1 src]# pip install -I urllib3
* S4 F" j+ X" k. ]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.4 R7 I& \, Z6 ]# F2 k6 Y
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
4 G  C! j  i) ]3 TCollecting urllib3; c! q( v; C& b- I# r6 ]
  Downloading http://mirrors.aliyun.com/pypi/packages/af/f4/524415c0744552cce7d8bf3669af78e8a069514405ea4fcbd0cc44733744/urllib3-1.26.7-py2.py3-none-any.whl (138 kB)9 N. s7 N9 q- c% Z
     |████████████████████████████████| 138 kB 1.1 MB/s
! h  E2 o  S, E. e- s, s# p: AInstalling collected packages: urllib37 F( S: E* t$ E5 ~% Z; m
Successfully installed urllib3-1.26.7
8 i/ j( Q9 X. m: X4 [2 z/ |" X
9 S, r# D- O1 [  C8 `+ L, L; i  q
更新下是否有更新包:" K# a5 }1 Q! ^& f

  L* a1 h! Z2 c! k% g5 K: Y[root@controller1 src]# pip install -U urllib3
9 J& G0 o; Y5 \- u$ G6 j' }- a$ P/ cDEPRECATION: 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.
8 I2 z8 q8 x, a0 E. n1 \Looking in indexes: http://mirrors.aliyun.com/pypi/simple/. R6 _0 h0 ]6 Q: j
Requirement already up-to-date: urllib3 in /usr/lib/python2.7/site-packages (1.26.7)
4 i( P% F+ ^- c' u! E0 W" L
$ G# t! [# W/ R; ~4 v2 B7 O; q$ I' G6 E
9 `9 V, o; O! `' c; d6 Q执行实例查看:( O3 H) ^. b# W; i  f
[root@controller1 src]# openstack server list
+ {% Q7 F* e  t+ Q) e/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!
# i3 v# J5 k2 [! t/ [( j. s  RequestsDependencyWarning)
+ t! i6 N2 y/ K- E7 j$ Y7 M+--------------------------------------+---------+--------+-----------------------+-------+----------------+% \" P6 ~/ E- u( a  k
| ID                                   | Name    | Status | Networks              | Image | Flavor         |& g; E: `, f* {0 u& ]
+--------------------------------------+---------+--------+-----------------------+-------+----------------+
  L$ A8 k( h; i2 F; G! c4 D# d: R/ e| b98e0105-d463-412e-beac-c94a18b15207 | testte  | ACTIVE | vlan3079=10.160.79.10 |       | type-4c-8g-30g |! a2 n; ?  _- Y  f
| 58fc002b-9cc6-4bc8-9f52-28fad1ef4f46 | test-vm | ACTIVE | vlan3079=10.160.79.15 |       | type-4c-8g-30g |& Z! r* E$ }# F" b1 y
+--------------------------------------+---------+--------+-----------------------+-------+----------------+
7 v: I0 D4 r2 V5 b# y  Z
7 ~/ A# ^5 X! E* L. c8 [3 ]
4 S* N& \* Q: \/ w2 T尝试安装chardet:
8 H' K) O! i: P+ ]+ d+ L/ \7 m) G" K8 V8 z8 K
[root@controller1 src]# pip install -I chardet
+ ?  s2 J- C4 `8 j7 N; F# Z+ rDEPRECATION: 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., h8 b% Y( ^. ~2 E! h
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
, O5 ]' O1 X: N* S7 a$ @  y9 H# _Collecting chardet
6 d" z7 K$ A/ s9 N; `  Downloading http://mirrors.aliyun.com/pypi/packages/19/c7/fa589626997dd07bd87d9269342ccb74b1720384a4d739a1872bd84fbe68/chardet-4.0.0-py2.py3-none-any.whl (178 kB)$ k+ r2 g- r0 R
     |████████████████████████████████| 178 kB 636 kB/s - r5 K; O/ [- c. ^
Installing collected packages: chardet: s2 v+ ^# ^, M5 F0 c5 q6 @# Z  @
Successfully installed chardet-4.0.04 C- M  b" C7 h

' _+ V3 L' n. @2 [5 d9 \1 C; ]" b2 c- o! g7 }& N, j% G
再次执行:
5 d  T7 K3 N: ~  e9 u" y" X[root@controller1 src]# openstack server list
/ P8 m, @- u5 P, V# H* r+--------------------------------------+---------+--------+-----------------------+-------+----------------+
9 D! I/ `) b) w1 ~9 @7 [6 C; K6 d2 V| ID                                   | Name    | Status | Networks              | Image | Flavor         |
4 y: i% x1 p" O  k( a+--------------------------------------+---------+--------+-----------------------+-------+----------------+
: z9 }3 H" Q- t) Z* c) C| b98e0105-d463-412e-beac-c94a18b15207 | testte  | ACTIVE | vlan3079=10.160.79.10 |       | type-4c-8g-30g |
7 p, x0 |7 o; `0 H( B| 58fc002b-9cc6-4bc8-9f52-28fad1ef4f46 | test-vm | ACTIVE | vlan3079=10.160.79.15 |       | type-4c-8g-30g |& I+ O! o( k8 U! W( W; _
+--------------------------------------+---------+--------+-----------------------+-------+----------------+
& S: i, L4 T, }! G[root@controller1 src]#
' p4 ]' m1 M2 m4 b# V* @, i/ M7 `  A9 Q
视乎问题被解决了。
+ l& i. q, f7 V0 L过程感觉有点匪夷所思。
! z! d! B9 x; ]8 k) r& ~1 h' H2 x* |
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

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

如有购买积分卡请联系497906712

QQ|返回首页|Archiver|手机版|小黑屋|易陆发现 点击这里给我发消息

GMT+8, 2021-12-2 09:06 , Processed in 0.043162 second(s), 23 queries .

Powered by LR.LINUX.cloud bbs168x X3.2 Licensed

© 2012-2022 Comsenz Inc.

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