易陆发现互联网技术论坛

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

Error while fetching server API version Timeout value connect was Timeout

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

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

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

x
TASK [haproxy : Get container facts] ***********************************************************************************************! ]( N- r! [( S9 J* P9 |5 [, V
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.
6 {$ l) M2 @  \fatal: [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}
$ G9 ]8 n, j2 k6 `, B# W5 R1 N  w5 D& x" S5 S3 O1 i4 A
# T: ]+ ^' |! d, U9 I  @- g
排查过程,怀疑是这个文件导致连接失败了:
2 V  E/ V1 C9 q6 q/ p" h7 a* N[root@openstack-gnocchi ~]# cd /etc/systemd/system/docker.service.d/
  I( Y0 L( Q0 f  C. }[root@openstack-gnocchi docker.service.d]# ls7 Q0 c' \# K/ e; Z8 P2 R
kolla.conf4 [" y* P& g( E) r0 v7 p
[root@openstack-gnocchi docker.service.d]# rm -rf kolla.conf        删除文件,接下来重启服务:! U* h' f0 y# R  R. S
[root@openstack-gnocchi docker.service.d]# systemctl restart docker.service
8 w/ P+ j! C, I3 }+ MWarning: docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.
4 g2 O/ t, ~7 \! }8 s& V* z% o[root@openstack-gnocchi docker.service.d]# systemctl daemon-reload
: o9 V: t6 N0 U4 N- m- b+ `[root@openstack-gnocchi docker.service.d]# systemctl restart docker.service
1 {* h! R1 J: L$ e8 ^, g2 V" {7 k- T/ f! G" o& B6 s9 }
' c! a& Q5 Z: i3 C
 楼主| 发表于 2022-6-16 09:35:38 | 显示全部楼层
kolla-ansible -i all-in-one prechecks  -vvv
: ^! Q- e+ ~6 ?3 L& ]TASK [haproxy : Get container facts] ******************************************************************************************************************************************************************" q8 }1 ]/ e, v  N
task path: /usr/share/kolla-ansible/ansible/roles/haproxy/tasks/precheck.yml:2
7 \5 q4 q- @2 j9 z8 l+ X<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
) f' w5 K9 C4 U) h<localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'6 J8 ]. c: @* z0 H
<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'
! }' K8 F8 K3 K8 zUsing module file /usr/share/kolla-ansible/ansible/library/kolla_container_facts.py& Q9 D) D: {9 f% h' D
<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; h( Q' ^, B( P
<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'
2 F# ?: y4 m9 f3 A- O<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 o, I. ~5 W$ h; d- o( l
<localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/ > /dev/null 2>&1 && sleep 0'1 e# M- I& m" }  G. T+ u
The full traceback is:
$ A5 K2 e8 U; Q# @Traceback (most recent call last):# r* B& S# k' A1 q2 ~3 S, |
  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 114, in <module>7 ^4 \3 Z& `" `! Y3 q( A0 w6 r
    _ansiballz_main()4 W7 U2 N8 Y/ L+ D( n& K' s' E
  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 106, in _ansiballz_main
& G' G6 ^- X5 K& d  c3 N/ z% s    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)/ x, K* S0 e9 E2 y1 z! V2 y# {
  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 49, in invoke_module
8 Q% A5 a8 V) ?9 f& |    imp.load_module('__main__', mod, module, MOD_DESC)# b" \% U  ]0 X: {& \! E. |  j* X
  File "/tmp/ansible_kolla_container_facts_payload_gQLkqs/__main__.py", line 86, in <module>8 {/ N8 R  v( Q3 L; C/ J% x
  File "/tmp/ansible_kolla_container_facts_payload_gQLkqs/__main__.py", line 68, in main
% Z5 S0 C3 s9 [" |! W  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 197, in __init__3 n, d& e$ W- I' T+ z" }6 g# h
    self._version = self._retrieve_server_version()5 S0 @6 X3 G7 j7 N2 v: a
  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 222, in _retrieve_server_version
( M2 a  S# l. V2 e. E0 `6 W    'Error while fetching server API version: {0}'.format(e)* e/ A. G2 m+ q: M* A2 a( s( M9 ]8 T9 j
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.
, P& P, q3 u$ `/ |+ O0 x! O6 c
0 C8 Y2 K% U* S0 ?  Pfatal: [localhost]: FAILED! => {9 U. L5 T: Y+ c9 U* u/ P
    "changed": false, . q1 p0 `8 z+ Y" \0 q7 O, |
    "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", ! d6 ]) [% m0 c% r2 \
    "module_stdout": "",
- ]% U+ e7 R4 P" @* V0 `    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", ) N; \8 K% W& O5 R$ Y
    "rc": 12 d4 ]4 M) i0 Q; @1 n3 \
}
 楼主| 发表于 2022-6-16 09:48:41 | 显示全部楼层
How To Solve docker.errors.DockerException: Error while fetching server API version Error ?
! v! n" U5 A! K7 m4 ]8 w; _How To Solve docker.errors.DockerException: Error while fetching server API version Error ?
4 v% k$ M8 ^# s( RTo 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
/ C9 d2 X( x: Z; b5 |* [9 M0 U: h0 X/ W9 W+ {+ ]( |
docker.errors.DockerException: Error while fetching server API version
2 v) Q; t6 \# e6 @. E! y. O: ATo 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% E# B" n& w8 F! a$ p7 f
8 S% T) f7 g5 ^* X
Solution 1: Make Sure Docker running
/ M% t  f" g, o* ?: t' ]4 N2 h7 Y6 I7 I( h# q; D) F
; f. I  K' D3 a  X  T/ U. S# C
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.! P  G1 x( _8 x# Q

8 S' J; G( C( X2 M3 l$ k$ q
! z/ v! m! R1 ?# v: b# S! b$ J' h
; V8 [# i, E4 F" nsudo service docker start  w4 R1 N& Z* n, Y4 \" K
OR. p' @0 B; a$ `: r; `0 [8 j

$ P- |/ {" J: H/ ^. K3 l) ]sudo service docker restart
& k. z; K" z" r8 w8 K$ m" KOR+ m: _0 b, Y1 N1 u. Z! v

# \) Y! o# F! G  C" w- Zsystemctl start docker
; p8 e2 B  V2 O, v, q( R$ X: I( {Solution 2: Set Permission; [, d0 b% x, n  X5 u

: |3 S1 ?5 S( \" i
, H! L9 T0 A0 F; \
1 P( j; F5 Z6 U3 G: t4 v' k- S
1 @( N' J/ C$ N/ |Just Set permission 666 for docker Just using below command., F5 W( E" C% H

! M+ i' E( J7 ]( Ksudo chmod 666 /var/run/docker.sock) d. z: v" X8 L& T) ]$ ]
Solution 3: enable WSL Integration& @1 f* @* U: F. c3 Z) C
& e3 i9 [5 [  t1 @" @8 U

* p- C9 _# G$ i& m, K1 E3 fJust enable WSL Integration. Follow these step.
1 o7 v7 X5 F% x) K( o# W( b+ E
7 Y' h5 I0 R: w) l3 M; R* M$ J, PFirst of all Open Docker Desktop/ `) e1 b5 J+ Q6 N
Then Go to Settings- Z4 u% a* x( l7 ~
Then Select Resources
% e3 T8 \2 k% TAnd Click on WSL Integration
. \% c: |/ Z7 \, fMake sure that your distribution is enabled7 a5 g% g7 S: ]' V
Restart Docker  ^& P8 F: `. X0 y
Summary
2 W/ ?+ b! E( j9 M- B; C! \2 h
/ f. {) `1 `. |, d1 Z1 i# T
+ _8 X! x' |3 v) i; u/ dIt’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)。' D  f7 d! p9 ]/ n: E! ^: `

- D" S, L0 f& m: s  I# G% Z' [9 j解决方法! M2 O) Q" E% y* f3 E

0 e) T, r! h  ]& n: N$ m" ]Node014 l5 Y  o2 Y0 Z  g$ _7 c1 v
* `+ k8 C! V# K) }8 b
配置副本数量,8个pool池都需要改' |9 C8 @9 S6 d# j# {

8 c" f) _1 b. |) ?# docker exec -it ceph_mon ceph osd pool set .rgw.root size 2
4 T- W: o. f+ t& Q  ~  B1.. Z5 M( ~: X+ V
- |9 Q1 c1 r1 e! a2 F

, w8 D4 O% s5 l: t5 L' L
. g) g. ~- g. rCannot uninstall 'PyYAML'.
3 H( v" V2 ]  E' }8 p2 y4 a
* S6 Q& a% M& wIt is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
: l" R" J0 _0 D$ t3 ^
% A9 w1 D3 J/ q: Q7 @解决方法
: _7 ?! j& L) x  E$ x
) p( E7 j/ o& r: h" Q8 iKolla
# [. s; f4 {7 O  a, u8 ^$ d  d/ w3 [( H0 k1 P
pip install --ignore-installed PyYAML6 Q8 E3 T6 P  U7 y0 F2 O
1.
1 \5 W; G, r, e; N1 D1 j1 z( S) }2.. m" q/ n8 j) i( y
3.( _2 ?4 @9 j8 [  |
4.
4 Q2 |  N' r( s5 G: }5.
, B! i& r! K8 y5 G/ t( Q6 Q! pNetwork timed out while trying to...& s0 h' R- d/ W6 b6 ]
' ?0 M1 R7 ?! M
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."}
) f- b& A3 Z2 ^% H2 E  |8 O: ?! |. _9 a$ b5 g% s& f: j- ]
解决方法
; s8 K/ X% b7 i7 l; @
* P  I" @8 w; @' rKolla
8 p0 o( J2 A4 C5 y; i8 ]2 ^% b2 a2 f5 m' U8 q
没有新建:vi /etc/docker/daemon.json
0 Q" G0 [% }. u) Y) `! \5 B* g/ W/ f* p. `: s$ N% `6 y
{% l/ s& t6 F4 I6 C  s% t
# S* x# Q- Q7 H# S) @5 t
  "registry-mirrors": ["https://jzngeu7d.mirror.aliyuncs.com"]. |7 h; K2 z- w, _! P# {  {& d" d

: ~: U# }1 I5 n+ U# ^}
: O( \# z# x$ q2 B1 S
4 e( U! H1 C9 X! [, T#systemctl daemon-reload; e; y5 p% ?& T% J  H) W; o

% _5 C: p; s8 h  _# [#systemctl restart docker
$ R. i' ?. l. i: I& y! {% E1 P1.
3 o5 a. b8 y/ t: T0 i3 L& o2.# [% J* [% D! v- {
3.
8 n" ]  x' ^9 L9 x0 Z) |4.
# e$ U8 v  x9 U6 y5.6 |1 o6 o' v. M$ Z; b- y
6.& b/ ~, z% R9 n/ u* O, Q" q
7.+ P- p5 q/ D: C9 V
8.
/ v& {& a" w1 M9 v+ U% R! g  j9.0 @' }. Q$ E) t4 W4 E
10.
, f( Y" P- e1 Z0 B+ L2 A: {# e11.) ]( ~! P" c% W* U0 |
 'ReadTimeoutError("HTTPSConnection
4 b/ f7 m) l9 `& M% w: u4 V5 s
' X! i& z% W$ F" }$ iRetrying (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/
3 Z, p- z7 n! |" h1 r2 k
! u: ~4 ]) n& o* g解决方法
- C/ g9 U; I, `* p/ Y7 f; \7 m. r# ]0 r! j' e: Z9 d3 B9 P
Kolla9 V3 {, q  y9 C+ o3 g
/ _3 Q8 ]7 W% L2 M4 J
# pip install -U ansible --default-timeout=1003 H: |) z( A9 l' y1 ~# a; Z# c
1.
/ E+ T9 X% @$ p. F; P+ n
/ [3 K$ Q0 i8 n3 Z. i
6 N5 S* c9 o! Q* \* I% }2 }. [5 D; A6 D5 p
ImportError: cannot import name decorate7 [( s% k: `; g0 k0 A! ?/ s

+ h% d- f8 ?9 `ImportError: cannot import name decorate
2 R0 F5 I& ~3 q. l
% ~, J. a! h4 ]% O% s3 ~& v解决方法
/ h, V! ~. D) V; y3 z6 d. G
+ p, |: F* ^( Y4 ?1 }! f" a( UKolla
3 W, x" Z. @" Y6 `6 B& r: n1 I; M8 F% B) ]. V$ X
# pip install -U decorator
( _: t" y- G  X- e1.% D) A. S9 S' P2 d% [- u
* ~1 M; \- h7 M

3 h1 ~+ F1 ?- D% |4 q9 f0 H6 f1 X0 D' R( \
Cannot uninstall 'ipaddress'.8 R& I4 U' h, _! W
" N) }. D$ k) {# v+ Z. u
Cannot 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.) O9 b6 g" ^! _& Z, Z8 R
* k4 u  y4 l  D& n; L8 y+ K: k4 x$ J( W9 B
此类问题强制升级此安装包即可。(已发现PyYAML,ipaddress)
* u8 v6 k4 E: l3 R$ V9 d5 x3 g. s  f0 W/ |" @# r
解决方法
, r" L/ O" ?5 G$ I+ f
. G  T0 [  c2 jKolla
7 U* w1 L3 [+ K1 O. S; |$ \# z; H' Y+ c  D% B8 a$ I
# pip install --ignore-installed ipaddress1 E% u3 n# O' z4 [
1.
) ~; l5 V: f/ I7 @; E+ l/ {
) c9 |' t3 m- e6 b% z- d' }
3 l0 G# n6 l7 U% I4 f9 O
. j# j% V8 p4 m8 F7 f" U6 YTCP connection reset by peer
: ?3 j4 u$ d- p# k1 c$ ]( ~0 ?4 t5 [9 }6 M1 G2 e+ P( ?. y& h3 r5 Q
"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"]}
. m1 @4 r4 m& _0 J) C- G8 ~+ V6 l9 j
2 r+ m7 A/ U- V# l解决方法
- C! y# B7 @& L4 p9 }5 j4 t) E+ b5 u4 T; i! _
Kolla9 p! o& `2 h8 z. i- j5 T) T' a
- u1 y! R: y: S& l$ {0 j1 O
yum 加速源(centos7 阿里源)$ J& }' i( Q) l  G- R: `

3 F. O" l% W8 [/ g! V# yum install -y wget
, U  d6 ~1 A( G% M8 `6 }' U2 [% k0 q
5 P& ?; Q* X* q6 r. l# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
% B" R  V: o: v# @* ^% x% C4 ^& P* q: Q/ v4 A. J, _3 @
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo* S' a, K8 h& \5 n* h3 r
( C% k2 S+ V# o4 U/ [$ u
# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo$ x9 K, n8 T: _# ?# [
# J- {4 m) w( G) r* m* ^6 |+ t
# yum clean all
& u4 Q  t7 f; \+ Y  ^# z+ G0 P2 m5 A. ~, g0 J
# yum makecache
6 D) C" ^; A& s; K
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

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

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

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

GMT+8, 2026-4-8 21:02 , Processed in 0.042579 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

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