找回密码
 注册
查看: 992|回复: 3

Error while fetching server API version Timeout value connect was Timeout

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2022-6-16 09:16:49 | 显示全部楼层 |阅读模式
TASK [haproxy : Get container facts] ***********************************************************************************************! m- A8 {5 z+ c- ?
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.
3 z5 l% o4 K4 b0 l9 i+ o" hfatal: [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}) ~! s- G* @. U' P* R
- Y8 P7 b8 \, q- n
& m$ o, t3 v) \. J; d) a
排查过程,怀疑是这个文件导致连接失败了:* M+ L  C8 Y# Y8 z
[root@openstack-gnocchi ~]# cd /etc/systemd/system/docker.service.d/7 l3 `. k+ v- q
[root@openstack-gnocchi docker.service.d]# ls* ~, Z# d) P8 e' q9 ], }' ]! p/ Y# J
kolla.conf
" h5 j8 i, V) q* N[root@openstack-gnocchi docker.service.d]# rm -rf kolla.conf        删除文件,接下来重启服务:4 p& y* c5 y, q- W% V6 P
[root@openstack-gnocchi docker.service.d]# systemctl restart docker.service
& S; x! b6 ]7 @0 fWarning: docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.
2 J( U: J% Y* @6 I' I8 c[root@openstack-gnocchi docker.service.d]# systemctl daemon-reload
' ?- `- s( ~; S: T. E: @[root@openstack-gnocchi docker.service.d]# systemctl restart docker.service
: @* W- s$ s0 U6 F3 z3 \( `7 T( h. F$ ~$ M- W; Y4 ^
1 g  j* [% h2 d$ K

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2022-6-16 09:35:38 | 显示全部楼层
kolla-ansible -i all-in-one prechecks  -vvv
  Q) ?9 c  _6 C& S. e/ FTASK [haproxy : Get container facts] ******************************************************************************************************************************************************************- c; H$ n$ G$ e/ S; i
task path: /usr/share/kolla-ansible/ansible/roles/haproxy/tasks/precheck.yml:2* W+ d3 [+ n- g. W* \5 p) S& k
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root* @; q7 _0 A$ O0 b
<localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'7 q# U) h6 J" _3 W; g! b5 g
<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'
' ?7 L; X5 A' j' ?Using module file /usr/share/kolla-ansible/ansible/library/kolla_container_facts.py$ N! o/ C- _0 t/ m" q. u' d+ e/ {
<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  o2 X% }) W: G( E
<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'
6 B/ l& D% N- O5 a" R<localhost> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py && sleep 0'
- w, x* j; g& y* V4 R<localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/ > /dev/null 2>&1 && sleep 0'
: g" C8 b- o% ?( C- qThe full traceback is:. c1 E$ D$ `7 {# O
Traceback (most recent call last):
* u& M1 h7 D+ E6 P8 i  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 114, in <module>6 b! Y( I& K% D/ X; [
    _ansiballz_main()1 R, m( }( b. g( {  \1 E' o4 I
  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 106, in _ansiballz_main7 Z& X) ?( Q  R% e
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
# i) @9 i* J2 S0 Z- D. S$ C' r  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 49, in invoke_module
6 Y! J: m  y1 u) O% b! l2 a: w8 Y    imp.load_module('__main__', mod, module, MOD_DESC)
- y. C4 R# r9 t" U4 Q! M, |" u8 w  File "/tmp/ansible_kolla_container_facts_payload_gQLkqs/__main__.py", line 86, in <module>6 C4 M7 {" P( N( p3 A6 f
  File "/tmp/ansible_kolla_container_facts_payload_gQLkqs/__main__.py", line 68, in main
$ X$ v" N: @( y) V" X, m0 @" |* _  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 197, in __init__  `8 I9 j+ U% ~/ t0 d' w/ c" \
    self._version = self._retrieve_server_version()  \# ^7 r8 \: K1 ^' l' c  f9 d
  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 222, in _retrieve_server_version
  L1 L6 h; Q! h- V+ c% `' U    'Error while fetching server API version: {0}'.format(e)
$ e+ Q, Y! l% H2 b1 W6 r% J/ adocker.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.
' L0 A, Q% S" Q' }+ H$ c4 j
' m  Y/ P: I& N, ?8 ofatal: [localhost]: FAILED! => {
/ G7 i: [( t9 n+ k    "changed": false, 7 \* U* B1 e& Z3 Q) r7 m$ ~
    "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",
% |5 y" u9 j4 R" K* Q) h) l    "module_stdout": "", * X  P- I$ b% j& S0 S
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
. U4 E$ j- n4 Q3 i% h# y    "rc": 1/ t) M! C7 W: a
}

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2022-6-16 09:48:41 | 显示全部楼层
How To Solve docker.errors.DockerException: Error while fetching server API version Error ?: i( L' p% h( t" _
How To Solve docker.errors.DockerException: Error while fetching server API version Error ?; I$ |* v7 W) j2 l& V. r
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
8 ^' [4 @8 e9 }1 M4 p" v( _# G" _0 g1 r: H
docker.errors.DockerException: Error while fetching server API version
3 @+ j5 p* L- l5 @3 J8 j  PTo 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
( g, X3 V, v4 C: y  t& x
$ W1 ~4 j8 W' c5 E" iSolution 1: Make Sure Docker running
2 F+ s; C4 B1 S# w, B  g) w3 Y2 ~- O3 Y* H# e
$ ?$ K) |7 z/ t( z' `& G! K0 U
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.* r  T4 K2 K4 b( v+ g, q: ]
8 Q1 v: F' V( t5 R3 P

8 ]& E: q; D; m. V $ Z$ f+ n; Y. M
sudo service docker start
  D& |# M7 L1 v7 GOR
$ P! s3 V- k( u2 r9 G' }
- L: W! s+ Y* ?: ?sudo service docker restart9 N# u; k. W- m2 {7 `2 X
OR
; j5 p3 C7 P/ s5 r4 C0 L
9 ^8 F  F: S+ N/ xsystemctl start docker
9 h: B& @# `  ~# s! h* r1 rSolution 2: Set Permission5 ?0 m$ t2 F6 }3 @6 W

+ y' g7 ~# ?9 d; W2 C  [
. x, G" ~9 D! v  p+ `; z$ c! l6 i9 u! k8 X, B

; g8 L7 a$ t+ o, w1 |3 G( pJust Set permission 666 for docker Just using below command.
6 {1 w/ X8 y& A3 y+ o/ G0 c, U, [- T  y
sudo chmod 666 /var/run/docker.sock/ k# x3 |3 D2 C6 H1 o6 d
Solution 3: enable WSL Integration& n" g6 S! J- d
# o5 u/ r# u* t
8 L! l0 _7 X+ ^4 ?
Just enable WSL Integration. Follow these step.1 r: g4 p' f, I

1 L( W+ a/ n$ B5 E3 f8 {First of all Open Docker Desktop* G5 Y  E) R. d( d
Then Go to Settings
0 L3 I0 i3 V- k% _7 W+ [" @Then Select Resources+ \2 D+ W0 t  Y/ t  J
And Click on WSL Integration4 i. k/ |) D) f2 `& F8 o
Make sure that your distribution is enabled: _! E% I8 F5 p3 B  N
Restart Docker. z( P- A& M$ d; ?: u
Summary+ [$ M7 ]* o; A. y! P

& l/ N7 y# O2 K! f5 F. J
2 G7 X; X3 d: q- V8 l4 e, mIt’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?

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2022-6-16 10:53:57 | 显示全部楼层
ceph系统有health_warn警告,通过Pool看出池的副本数是3(replicated size),osd tree故障域只有两台host,有一个副本没有地方放置,所以是降级状态(degraded)。, O7 z3 g' i, l; f6 a
; J2 x' z7 l: B! P
解决方法
9 n8 x4 {; B3 T3 C, K; _# P' A; K% A# V' u& L
Node01
8 r/ n3 l: g& B% @4 c  k" A" N! C# A+ C0 Z
配置副本数量,8个pool池都需要改
( a* g) q& f8 C
& {  L9 D. x! G1 V/ i( i" ]! z8 d& L# docker exec -it ceph_mon ceph osd pool set .rgw.root size 23 e6 ]3 \' d$ z1 K" {/ j3 Z
1.
# G# X9 W# Z) d8 w* u: g- o+ A( H( a. I+ T8 F
8 n# P6 W7 D' U( q) g# ]6 g/ o# h- Q+ ~
5 j0 ]* U. ^! \- B% A$ i9 K
Cannot uninstall 'PyYAML'.
. G, j3 K% Z' Q1 e
0 A* Z* X4 n, Z% y4 E4 s; v! l7 SIt is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall./ J4 X+ }; D  e3 k: P, U: ]

' a8 ]; c# B+ a解决方法+ C) V! v4 I5 X" }* U" y. {+ W/ b

- z5 k0 r2 h: }. i5 W. uKolla
" ?* `' h4 _% n% }, x: t1 m5 R8 @9 `8 g8 C
pip install --ignore-installed PyYAML
0 t, v% {+ E% P. m% Q. [6 h) c1.1 ]9 n1 U4 X8 W3 H0 T
2.
$ w5 p1 G3 m8 @2 T) j! [! v1 E3.9 U; N' J+ f( A0 f6 {  J+ h
4.' a* ]/ Y# l' ]# a3 c& G" f
5.$ i/ X3 t" }# n& |' Z
Network timed out while trying to...( X" H; z! B# c2 ~) {$ w2 L
  |) Z9 ?; H# @, Y
fatal: [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."}/ G. Z* b8 a3 I- y4 v

( n7 @8 b4 Z4 o) y, \: q解决方法9 D5 D; Q2 V+ V* h' t

3 A) X, Z5 |8 z, P  m( G/ `Kolla) U0 A( y/ ]* E* ^
8 |: f! `. O5 m& r
没有新建:vi /etc/docker/daemon.json8 B4 s& d1 ^8 ^- q! F- G

$ v$ x4 {7 U& J4 ~" b{. ^5 i. A* h0 d5 M

) g* u+ T; f8 H8 G4 N. B  "registry-mirrors": ["https://jzngeu7d.mirror.aliyuncs.com"]1 G$ k( H$ }8 @- P- a

' }+ R; d+ u# N# ?7 i( U3 t}
* B% I4 o) Z/ Q
. O& [+ Q6 i2 u0 X8 G/ V& w" o#systemctl daemon-reload
; @" d4 p: N  U- h1 d8 \- `
# h/ T$ w+ V) W, U: u#systemctl restart docker) W9 l7 q  u2 E5 @+ M
1.0 B0 x- q( J6 a0 |! S- O- m
2.
. p! p2 `6 N7 i% ]2 v% X3.
# a# a7 Y5 u' ^, C4.
' d0 W9 X9 M" c. n; O5.
, ^  E1 K% F1 x& A' I! Z- A3 P4 z8 h6.- p7 |' N* b$ X! O" x  ]7 A
7.) a. J( g. d2 ~4 a/ @7 Y
8.
8 D7 z* j0 N9 y" c9.& S2 H0 {) W; ]0 ?* v4 r9 V
10.
; L' v* }1 a" y: ~' a" T11.
5 w( @, ~8 l' X7 k+ e' a6 G 'ReadTimeoutError("HTTPSConnection
- A4 z& i) S3 ^% ~, I& s3 e( V( g8 H, d/ t# c, o
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/
2 t. W6 u& @1 f. l- U5 M) a" N, H6 y' Y  M. c2 [# r% o4 S9 T
解决方法# B, m* h0 L9 r3 F9 N" t

9 E/ ]& e# m& SKolla' Q* r4 g* P; W; a' |) ]  Z

. j/ F" R6 ^( Z. _5 l( d2 x9 A" H# pip install -U ansible --default-timeout=100
1 t& U4 }0 `. v1.+ |  z0 i# q' |+ u
0 ]! P7 t) h& U6 I

4 P: J4 r6 T( X6 _  a+ k( ?  d( i) e3 o
ImportError: cannot import name decorate5 P9 h& J: h6 f$ B1 @( ~
4 ]: `8 U( ]' z! |# J- n+ u
ImportError: cannot import name decorate1 l! ?' ^6 f1 J6 y( D8 i
* h" H" u9 |# w/ Z# i. x  O& W
解决方法. {8 _/ U8 x% z5 C% Q
. @0 P% w- `! g9 c, }
Kolla
. f' Z3 x3 k/ \
+ |9 a/ r+ k$ |& U# pip install -U decorator4 x0 c! x3 x- X" G5 f- p
1.7 G4 r9 @4 ^5 y. L, [* q

# W* ^# b7 Y4 y3 B. P/ q4 E, g+ a4 X7 ], E- `; r, H
# r' D) l9 J/ B2 `( C# g2 }
Cannot uninstall 'ipaddress'.8 I) v0 f1 \9 c8 R- I; L

' ^# a9 A) G0 L: W7 ?" |" x% sCannot 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.
& h  w, z- s, N; `& F3 l; H) A: K* `
此类问题强制升级此安装包即可。(已发现PyYAML,ipaddress)' O9 L) l0 X, E0 Z" s6 o& k3 f

5 o2 o  S5 L& Z3 y& _解决方法
7 p7 R7 Y8 E9 U( ^8 q. W. B  z% |5 ?+ a! @
Kolla
5 \0 M2 k7 `& [* }: n0 }
% |. x/ O% r5 g6 ]8 U3 G# pip install --ignore-installed ipaddress3 N% @! D* Z  u
1.
- y8 E- P9 a; d: ~" \2 B  |. D5 S8 a9 n

4 S$ c0 i7 f2 @2 E- f" ]' M% h; F. {# U# P" ?- N
TCP connection reset by peer
" A" @% l& j4 |" o
% X; U6 P6 }; x  P) B4 \/ e"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"]}7 c8 P0 B2 O4 ~: a( ~7 L( F
& c" U9 B& ~. l3 q/ B
解决方法4 j1 v/ D) _* A2 Q; P

' G& C6 Z5 E) p+ j% n% J' c% [Kolla9 u  k$ w' _  e; Q4 L  B" ^
" O" X6 f$ B: U
yum 加速源(centos7 阿里源). Y% R( Q; n/ t. q0 h4 s9 r+ o) z

: t1 t. C2 Q8 e5 a5 F9 R# yum install -y wget4 I& W: i# m/ b

; j. B" C, B8 I+ F" W! p$ ~/ t# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup! G) q4 v" l  _9 s( G

. L4 F5 z" t4 v' k4 E# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
: H# x% v" f. r% P# v, _9 l
) Z. y2 a$ n6 s8 O# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
0 a4 a! `, J) y, W+ }2 [
6 s! r+ {  L0 j6 Q3 r5 g+ `: V# yum clean all" Y$ @9 l, H" N7 ?) i! C! n! x2 K

9 `' s/ W! T# R" l  V) o" _# yum makecache  e! b' W  a' X8 Q
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 02:03 , Processed in 0.016529 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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