易陆发现互联网技术论坛

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

Error while fetching server API version Timeout value connect was Timeout

[复制链接]
发表于 2022-6-16 09:16:49 | 显示全部楼层 |阅读模式

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

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

x
TASK [haproxy : Get container facts] ***********************************************************************************************8 e# v( p4 F" Y# \# W  n% g* J
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: docker.errors.DockerException: Error while fetching server API version: Timeout value connect was Timeout(connect=60, read=60, total=None), but it must be an int or float.
4 F' K3 G) x! K! i" pfatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1655342148.23-10821-113568649487203/AnsiballZ_kolla_container_facts.py\", line 114, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1655342148.23-10821-113568649487203/AnsiballZ_kolla_container_facts.py\", line 106, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1655342148.23-10821-113568649487203/AnsiballZ_kolla_container_facts.py\", line 49, in invoke_module\n    imp.load_module('__main__', mod, module, MOD_DESC)\n  File \"/tmp/ansible_kolla_container_facts_payload__E_L4X/__main__.py\", line 86, in <module>\n  File \"/tmp/ansible_kolla_container_facts_payload__E_L4X/__main__.py\", line 68, in main\n  File \"/usr/lib/python2.7/site-packages/docker/api/client.py\", line 197, in __init__\n    self._version = self._retrieve_server_version()\n  File \"/usr/lib/python2.7/site-packages/docker/api/client.py\", line 222, in _retrieve_server_version\n    'Error while fetching server API version: {0}'.format(e)\ndocker.errors.DockerException: Error while fetching server API version: Timeout value connect was Timeout(connect=60, read=60, total=None), but it must be an int or float.\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}. T9 T9 R& z, B8 N

) V: x2 }* w6 S
4 o/ {; Q! G% `' v( z2 j. Y/ H& F排查过程,怀疑是这个文件导致连接失败了:
9 N% g5 s3 W+ \; b/ Y/ V1 d[root@openstack-gnocchi ~]# cd /etc/systemd/system/docker.service.d/5 b. `. m  u' u" L1 A
[root@openstack-gnocchi docker.service.d]# ls7 q- F" L* s* P1 X+ U
kolla.conf
+ r4 X8 y& i$ w7 a; m[root@openstack-gnocchi docker.service.d]# rm -rf kolla.conf        删除文件,接下来重启服务:( K4 g  e1 E9 _; _
[root@openstack-gnocchi docker.service.d]# systemctl restart docker.service 6 S. Y& t: B  P
Warning: docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.
6 H6 E" V# u0 W[root@openstack-gnocchi docker.service.d]# systemctl daemon-reload2 _2 s  V, l6 @6 G; t/ \; I
[root@openstack-gnocchi docker.service.d]# systemctl restart docker.service
7 e; P- V" I* b/ ~0 T7 _
' r/ ]7 J. e) B- ~8 f' y4 D* r! s, K6 V: i* T2 r
 楼主| 发表于 2022-6-16 09:35:38 | 显示全部楼层
kolla-ansible -i all-in-one prechecks  -vvv
) u! g8 s8 ~3 Q2 gTASK [haproxy : Get container facts] ******************************************************************************************************************************************************************# @3 d2 d$ [9 z8 {
task path: /usr/share/kolla-ansible/ansible/roles/haproxy/tasks/precheck.yml:25 T5 U1 a) ^+ _+ x" ~
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
% A0 h5 [1 Q; O% X<localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'3 F5 |3 ~! o+ a6 p( ^% i6 D! b
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776 && echo ansible-tmp-1655343195.01-13693-147197134416776="` echo /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776 `" ) && sleep 0'
6 x- T; t( w7 [- N% M5 G; p% MUsing module file /usr/share/kolla-ansible/ansible/library/kolla_container_facts.py: O, J- n; [; W7 i. n
<localhost> PUT /root/.ansible/tmp/ansible-local-13399bPCBGY/tmp4_v29T TO /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py
! U8 M" ]) G; u- `; l1 c  E3 @/ D<localhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/ /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py && sleep 0'
) B9 D( b/ i1 T' i<localhost> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py && sleep 0'4 _* S. o7 @( K+ d$ Y
<localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/ > /dev/null 2>&1 && sleep 0'; z! }7 K/ f( y+ f
The full traceback is:, V4 Z4 S; u7 Y$ ]$ Z
Traceback (most recent call last):
& h4 b3 a5 J( ^3 F1 B1 L0 \  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 114, in <module>, _* j1 h" |" i$ s0 @/ ~& T
    _ansiballz_main()# f$ T$ s  u) ^/ X1 Z4 b
  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 106, in _ansiballz_main
! v5 t* k9 W6 A' B5 ^0 }( y/ u    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS). H+ E9 ]; L4 q9 n) d) s" ]3 U
  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 49, in invoke_module5 H. q' ?! a. b( A4 t+ `# N
    imp.load_module('__main__', mod, module, MOD_DESC)  t/ t: l" S, N4 J/ q- ^) ]
  File "/tmp/ansible_kolla_container_facts_payload_gQLkqs/__main__.py", line 86, in <module>
6 J8 h' L/ O6 s8 Y3 D  File "/tmp/ansible_kolla_container_facts_payload_gQLkqs/__main__.py", line 68, in main- J6 |5 v) J6 _# I4 O9 E
  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 197, in __init__' m1 |5 h7 I& V' Q  x) r
    self._version = self._retrieve_server_version()
# J! F: e  L9 a" q0 @  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 222, in _retrieve_server_version* E4 y+ x9 b/ B8 U) y+ p( V3 x. B" c
    'Error while fetching server API version: {0}'.format(e)! u+ _+ {& Y2 R7 `1 K% g
docker.errors.DockerException: Error while fetching server API version: Timeout value connect was Timeout(connect=60, read=60, total=None), but it must be an int or float.
# E" J# h( z/ M( z* g/ H9 d: l/ _0 I, Y# m& H2 P( V. p: A
fatal: [localhost]: FAILED! => {  @% [+ }$ O9 a. U/ x5 G
    "changed": false,
! _! V( l. P& X: I! T* u    "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py\", line 114, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py\", line 106, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py\", line 49, in invoke_module\n    imp.load_module('__main__', mod, module, MOD_DESC)\n  File \"/tmp/ansible_kolla_container_facts_payload_gQLkqs/__main__.py\", line 86, in <module>\n  File \"/tmp/ansible_kolla_container_facts_payload_gQLkqs/__main__.py\", line 68, in main\n  File \"/usr/lib/python2.7/site-packages/docker/api/client.py\", line 197, in __init__\n    self._version = self._retrieve_server_version()\n  File \"/usr/lib/python2.7/site-packages/docker/api/client.py\", line 222, in _retrieve_server_version\n    'Error while fetching server API version: {0}'.format(e)\ndocker.errors.DockerException: Error while fetching server API version: Timeout value connect was Timeout(connect=60, read=60, total=None), but it must be an int or float.\n",
: v  ]& J; V* I) _    "module_stdout": "",
; T  ?) |3 O' T8 U) ]* P    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", 9 z. F2 Z3 x7 n7 W# P; s+ D( V9 k# K
    "rc": 1( i, S( ^& j7 s' ^9 d
}
 楼主| 发表于 2022-6-16 09:48:41 | 显示全部楼层
How To Solve docker.errors.DockerException: Error while fetching server API version Error ?
+ {  t- k, Q6 [$ Y1 bHow To Solve docker.errors.DockerException: Error while fetching server API version Error ?
( V7 @1 B4 Q5 H1 j" `& G1 O6 OTo Solve docker.errors.DockerException: Error while fetching server API version Error This Problem Usually occurs whenever docker is not running OR compose is not able to connect to docker via docker socket. Also You can check docker status with this command systemctl status docker. So that Just restart Or Start docker with this command. sudo service docker start
5 L7 O4 |. s# H2 m" w1 g% d1 r/ c+ S& e9 h
docker.errors.DockerException: Error while fetching server API version; Z2 ]  y  Y' B( \
To Solve docker.errors.DockerException: Error while fetching server API version Error This Problem Usually occurs whenever docker is not running OR compose is not able to connect to docker via docker socket. Also You can check docker status with this command systemctl status docker. So that Just restart Or Start docker with this command. sudo service docker start
: [1 ^% P- D) K  {
  D6 Q# r( Y" L8 ASolution 1: Make Sure Docker running
) d- I; D' H; f# J% U# \: F/ |0 r8 u( B! Z# N3 z! E$ d
* @8 k$ w+ L% j
This Problem Usually occurs whenever docker is not running OR compose is not able to connect to docker via docker socket. Also You can check docker status with this command systemctl status docker. So that Just restart Or Start docker with this command.
! @- `# n6 z* a( E/ x8 K" T( B1 w* ~* k

( U- B% i/ z) v0 J
# U: a4 I6 V( a% Y) ksudo service docker start. U0 }2 z. V$ a: A- _
OR
0 }5 {3 V/ |" m3 ^/ ~( p: b# a& ?0 ]8 M+ w) h6 Q: O5 n
sudo service docker restart6 i) i' J0 B; X- ^2 o! l% H. w
OR
1 G' w/ g9 M1 U
$ u: q7 M% s6 l2 F5 f" R3 lsystemctl start docker
! ~, d2 Y! |. u. iSolution 2: Set Permission
* V1 K' m/ _9 w4 ]/ ^, G- O' q4 \6 h4 g. L* ?/ \* N

& ]; ^9 G/ x* P# X4 O) i3 d
* C$ ]0 M' W* l4 b: _' C# z 5 F. W. ~* h% u3 p
Just Set permission 666 for docker Just using below command.2 W: d, I) ~# j4 W* z
+ G' M% V! |' A
sudo chmod 666 /var/run/docker.sock% R4 s2 m3 }* G: W! t* F( w5 u2 F" r$ z
Solution 3: enable WSL Integration
' {2 p5 m8 u# r/ p& ]. ?
4 U& B: X$ W  U1 K
( J% A% V& _# r7 d: uJust enable WSL Integration. Follow these step.
; _2 w% `3 z1 n
* L3 f0 e+ ^: x2 OFirst of all Open Docker Desktop
5 n) `2 v5 y7 ?' F# fThen Go to Settings8 G8 Q5 e. `# l! T
Then Select Resources
' x; O/ S, c7 n; Y9 g) PAnd Click on WSL Integration0 Z/ `% x" p* F' }( W- k) Z* I/ e
Make sure that your distribution is enabled0 U' i# p$ w! R% \* k: k
Restart Docker$ W5 J# V! W( Z& g: {
Summary
- S$ D$ V2 Y, H" g6 S- S3 }. X5 L! S8 u7 q

( Y/ ]" |/ g9 ?It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?
 楼主| 发表于 2022-6-16 10:53:57 | 显示全部楼层
ceph系统有health_warn警告,通过Pool看出池的副本数是3(replicated size),osd tree故障域只有两台host,有一个副本没有地方放置,所以是降级状态(degraded)。
0 @7 t4 h; u. g+ S2 e6 l4 `& a4 T6 b, [, e' H
解决方法
5 ]! h9 P* h' @* ]! P* |; W
4 M. j9 t. a, i- uNode01
* H4 `4 B7 J3 t; p* v1 P% \
- Q* y, S, e& {6 Q) P  t% ]配置副本数量,8个pool池都需要改
8 D6 \9 V' f0 J
2 X/ s* O+ J/ e2 w5 A& |# docker exec -it ceph_mon ceph osd pool set .rgw.root size 2, ]" K' I: w5 a5 z$ h
1.4 u- L5 l% Q: v; X- ^, h5 P9 X
4 ?/ W. ^! V. @. s* [

# N; \; N) o+ L0 r7 N7 s" u4 H- n
Cannot uninstall 'PyYAML'.
7 U7 K& K. O+ |9 \
2 D, L5 k2 P$ L* G/ l# DIt is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.. t. Z7 {% `- _! M* x6 B
# z9 N3 _5 m4 }
解决方法
6 g3 b$ k% t4 @1 ]1 T
4 n: c0 |! u/ P7 h+ g, L" nKolla$ Y  U  s, O% I* w: C9 l1 c
) m& M- m: }$ T7 `# Y
pip install --ignore-installed PyYAML
" b! y! f7 p, U' m1.3 ]9 X  n( w+ V1 v
2.& M* P4 H' u2 p+ I
3.
) M/ B% Y5 e3 `  [1 P4.
" |4 i* b$ ?8 h1 o- D/ j% d5.( x7 P* @3 q; W. `% O: e$ W
Network timed out while trying to...
# Z4 h2 a; o6 f" S5 S
( R" O- M; [- J8 f) V8 S7 qfatal: [localhost]: FAILED! =>{"changed": false, "msg": "Unknown error message: Network timed out while trying to connect to https://index.docker.io/v1/repos ... rce-fluentd/images. You may want to check your internet connection or if you are behind a proxy."}
! L  E& C) w2 Y! R8 u
0 _( o- D+ e. Q. g8 [- K  a- w解决方法2 T" Q/ v9 i! h  N5 _
1 C9 `" j$ K5 A1 ?5 r' I1 q
Kolla) o. s2 L) Y* _, ?2 M

& L2 T, r  H. O, k( ?! r2 H没有新建:vi /etc/docker/daemon.json
; e& p7 o0 ^2 M, C2 [; P. s& M. k" {4 b" l; d; a/ F9 z6 A% f
{( h& m5 j* W) _  k# D, [& |9 B

3 E5 n4 k, _4 n5 U- h1 k+ ]  "registry-mirrors": ["https://jzngeu7d.mirror.aliyuncs.com"]& O+ r3 P4 g! h. ~7 o
, U- X5 E; M8 V5 _- }5 N
}
* A9 ], A1 O, U$ ]+ `( z' d* P; E/ `7 v, ?% e
#systemctl daemon-reload
/ L3 C% t/ H$ a0 j  F6 _' j  W  U# ?6 F1 t4 d; \% R
#systemctl restart docker' A8 V7 W, V& Q$ @: X% j
1.
1 P, D. z: ~: f7 P7 z$ ^2.
$ m5 B6 f/ k3 s' r. R6 b* P" y, {3.7 j" {6 y: G( e6 \' O' ^& K
4.3 @; I* s0 c/ G. G$ D
5.6 K) T9 m8 X6 L! C! m- `6 h
6.* c- k7 b" g! E4 X
7.
' T- k  R! j8 N3 T( ^7 f$ C. m( P. }8.$ @& G* v$ z7 o$ K$ B3 ^) t
9.
3 j- B7 h4 e. {# x10., s3 e( O2 {) ~$ _/ w( z" H: B" g" r3 w
11.6 T2 M& _9 j9 d+ t, E
 'ReadTimeoutError("HTTPSConnection
& c# V! b% Y8 d7 E$ @  V& g; D7 q6 w% X
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)",)': /simple/ansible/
4 b/ i) W1 }4 @( Q- S
. }! s+ }9 C# r4 [+ s6 Z/ E( ?解决方法
  u( G2 _1 d9 G
' h4 J; V& j, RKolla% _: v4 S. _* t# p
* T! ^# H) A3 x
# pip install -U ansible --default-timeout=100
. \6 x8 d8 p  o; U" \1.2 w& w! Y- A4 D$ G" T5 X

$ Q1 V; @, z8 F6 W4 k' ?! K& b" X0 @0 d+ h+ s( t7 j5 m

: z) D) @4 g4 ?* JImportError: cannot import name decorate
( e- B* j/ \5 Q4 B" @6 s- a8 P* r% i( K6 F
ImportError: cannot import name decorate
( n  V9 m* |4 C& A3 x0 r6 V* Y  ]8 G, {( Y1 K: J; [2 k( }; W$ _
解决方法
% m- X  O* y) z1 I: w4 R; ^" j/ C. l: O/ F
Kolla
  X- U4 H! ?1 g: S9 f
; }0 |$ b% i( ~# pip install -U decorator
: E9 ^  s* p; C- u  [1 v1.
5 }4 X# ^, U+ s: t7 ~
1 T/ k% d! |* n' `1 M1 Y! M( n+ U# I, e2 m1 l2 S, o) D

6 E" ~' p7 O' s, w; zCannot uninstall 'ipaddress'.- z# K& C1 c* W+ B! Z( t

  A9 ^7 C$ O- Z6 H5 m. xCannot uninstall 'ipaddress'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.$ F& l$ _3 e! Z* R5 Y1 V: }

# ]  p- H! S+ Z: T, }此类问题强制升级此安装包即可。(已发现PyYAML,ipaddress)
- q6 M5 N( f7 l% }# C/ v: G, ~, W2 G4 ]: @
解决方法2 W- V$ @* P' b# v  z

' o& w# Q1 Y! `9 y6 T; h/ W4 L1 AKolla
( W/ p  ~7 |: V7 Z
& ?* l8 A2 f( u( D# pip install --ignore-installed ipaddress) r2 q9 A8 X+ Z- u; |& C
1.
! t) F2 O( b7 O  q* [& `
% y9 X+ A, c! c1 t9 s8 n. O/ M& s8 t2 a5 d' |
4 M( }" b1 ]  [$ ]# V4 X
TCP connection reset by peer3 {% H! g3 j- s! P
0 \% Z2 S, y5 U$ G0 r0 V
"https://yum.dockerproject.org/repo/main/centos/7/repodata/repomd.xml: [Errno 14] curl#35 - \"TCP connection reset by peer\"", "/bin/sh: apt-get: command not found"]}6 C1 [9 a* [' G! B# n
' L9 u3 G4 h4 {0 h) f, {* m
解决方法
8 J( p) o- N& Q' F, Y2 z* R
) o  n3 c" o& X' a; `# e0 {Kolla1 j6 G) [' Z! |4 B9 b5 U
, A; i8 B* A; {" n
yum 加速源(centos7 阿里源)
2 l. e5 i) [+ [# u* M+ B/ C$ j& V' S1 p& G/ C+ O% A2 S
# yum install -y wget
  h$ I8 k) k! R3 @1 @- }. h+ o3 Q  w3 H( w
# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
% @' K% S2 m4 q9 x7 R9 K
8 D/ W  `' s" F0 u# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
2 @- I: d& L# L0 D
8 n+ V! b( i- a, A. m# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
2 J) F+ L8 {, r) f9 c7 N
% p& M/ C0 O' m- @# yum clean all& _3 ~7 ]' Y% I3 E+ ?5 g
: x* M4 P2 F. N& Q: i4 E, p
# yum makecache8 c* \( s+ z+ h1 [" W
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

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

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

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

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

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

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