易陆发现互联网技术论坛

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

Error while fetching server API version Timeout value connect was Timeout

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

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

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

x
TASK [haproxy : Get container facts] ***********************************************************************************************
" o  b" n2 c! H9 k6 w# NAn 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.
' o0 L  k0 W% C0 f& C/ jfatal: [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}1 X7 \! V* S$ z1 F: k: f! Z+ m# I
5 q/ X' |6 w) r4 _% j7 w2 ^

, \6 G$ o) B9 J6 R排查过程,怀疑是这个文件导致连接失败了:
; \, r2 T4 b: G; a' g[root@openstack-gnocchi ~]# cd /etc/systemd/system/docker.service.d/0 w/ ]) P' E7 ~
[root@openstack-gnocchi docker.service.d]# ls/ i; w1 y! u; t
kolla.conf
7 r4 M7 Q$ w' @, P[root@openstack-gnocchi docker.service.d]# rm -rf kolla.conf        删除文件,接下来重启服务:
& w4 {& C2 `# @& k1 a  e[root@openstack-gnocchi docker.service.d]# systemctl restart docker.service 6 |  {& N0 P5 j3 ?# ]
Warning: docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.
% D3 y+ W) ~: F: U/ Z- i[root@openstack-gnocchi docker.service.d]# systemctl daemon-reload
8 `# H3 L( l% ?! Q( v; u9 S# Q1 E; G[root@openstack-gnocchi docker.service.d]# systemctl restart docker.service . M, j$ m, N9 G. k' x. N. o

0 S: @' \) v  K/ H  t* q. e8 m& M5 T7 w  d& k6 v1 U. N1 ^* c7 p
 楼主| 发表于 2022-6-16 09:35:38 | 显示全部楼层
kolla-ansible -i all-in-one prechecks  -vvv( ~3 @1 ]1 `! t0 f( B
TASK [haproxy : Get container facts] ******************************************************************************************************************************************************************
) [3 C& m% d" \& H# N8 m  Y* Jtask path: /usr/share/kolla-ansible/ansible/roles/haproxy/tasks/precheck.yml:2
4 e3 m0 e; Q: \8 Y: O; L<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root
. s; z2 z0 q% H! K& v9 x<localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'
- _6 U+ F- G3 _% H1 H  j  s<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'
' ]# u# [: x% w. v; SUsing module file /usr/share/kolla-ansible/ansible/library/kolla_container_facts.py) C) R; B1 s1 a* y: _0 _, y
<localhost> PUT /root/.ansible/tmp/ansible-local-13399bPCBGY/tmp4_v29T TO /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py8 C' \$ B" y; m
<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'# p7 V, c. e& e# X$ d* V' E$ J) u
<localhost> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py && sleep 0'0 k& r  F: n6 l- T$ Y6 S6 n% T
<localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/ > /dev/null 2>&1 && sleep 0'  w2 S* e" e6 x( m
The full traceback is:% T3 P" Z9 o! V) f9 ~4 s
Traceback (most recent call last):/ ~% |" Q6 Y) ^2 C6 P, O2 j
  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 114, in <module>
6 Q+ F% L7 m4 `4 Q    _ansiballz_main()
8 }5 e0 k/ X$ ~6 @& ^( i9 J  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 106, in _ansiballz_main, [7 P0 N& q. w7 {
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)$ G: Q, Y- h% f
  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 49, in invoke_module0 M/ h) N/ @  s, Q5 `
    imp.load_module('__main__', mod, module, MOD_DESC)" C  ~' q& m+ J! [; `) m$ ]; b
  File "/tmp/ansible_kolla_container_facts_payload_gQLkqs/__main__.py", line 86, in <module>$ p; ]6 }: k0 K1 i. Q
  File "/tmp/ansible_kolla_container_facts_payload_gQLkqs/__main__.py", line 68, in main/ p8 `' ~1 G* J( R$ D; ~, q
  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 197, in __init__$ v' X* X3 ^: q5 |; P
    self._version = self._retrieve_server_version()- a( D: x* V3 A# T, x1 ~
  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 222, in _retrieve_server_version, a; \7 x5 d. y8 N# @9 _5 m7 N
    'Error while fetching server API version: {0}'.format(e)
5 s; w: ~# _! `. T0 \5 F4 rdocker.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.
& q8 H% S& Z1 G) G  G) f1 m4 B2 J# H+ w! g# q# F% t' a
fatal: [localhost]: FAILED! => {
" ^% i5 z% L7 i- e7 z7 M    "changed": false, # \+ n( Q2 f. y( G
    "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",
2 l* S3 b1 W$ f6 H) e2 A' u    "module_stdout": "",
/ j0 E% f+ {# s- T- L1 Z4 T    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", " V' q) A& B4 `  M; B. l  |  i( q
    "rc": 1# ?' P$ z7 h1 q  G6 g+ K
}
 楼主| 发表于 2022-6-16 09:48:41 | 显示全部楼层
How To Solve docker.errors.DockerException: Error while fetching server API version Error ?( V( M# J$ ^4 ~4 Q5 \$ H
How To Solve docker.errors.DockerException: Error while fetching server API version Error ?
& N7 T! }" P" j; 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, i2 Y' z! d9 @
2 s& z& P2 t( T- u
docker.errors.DockerException: Error while fetching server API version0 b* U. o6 s, Z# [0 P7 V
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$ f1 t- U4 a9 Y' b. o4 V& a3 S' p
9 ]+ |2 N& i+ K9 ?+ T- t- `' B
Solution 1: Make Sure Docker running
1 {) H0 ^$ n. n3 q4 C/ ~7 F3 |
  x; y" F7 j$ Q; L$ V
& c& D* ?9 v/ i7 F  o. ~- N1 z0 m9 [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., x/ c4 l$ s  R. a0 |  E8 {8 @
' H% w6 l+ c3 ]8 |0 _% i% o8 u0 h' k

' P8 R. ~5 e/ M0 Z2 K3 b + d+ @+ D1 h+ M, U3 W+ v5 I
sudo service docker start
5 y8 T( H, N) R1 _2 J. UOR8 l7 r( v5 d7 x# f( b
2 a. f  \$ j$ _, l0 p  Z7 L
sudo service docker restart, u. M" d- _7 v" B
OR
! @1 P7 [, V: c9 |9 M- F( E8 E  b/ @6 @' m( }' b
systemctl start docker
! Q9 c7 G& ?9 u' ASolution 2: Set Permission
: V! b( v5 i4 c& ]: a/ I+ Z
  g; z1 }, Q( |: r: X * g/ s) i/ O, S! s8 V
% @/ _! i) _) Q
. ?6 z) F8 p, C5 I
Just Set permission 666 for docker Just using below command.
$ }+ s+ L6 w3 z3 H! r) j7 t: N1 M4 I" X% X1 }& p
sudo chmod 666 /var/run/docker.sock% Y% f" g. y4 I2 x5 _/ u. e: @
Solution 3: enable WSL Integration
# K1 [; ~3 e5 i! W6 W
( C1 h) T/ k1 X8 k% }6 w/ e  e# u
7 A1 E( @/ N; N) |3 ^: gJust enable WSL Integration. Follow these step.4 c+ x! Z6 A' b$ E

) ?  w* @$ x  K2 a# S' ]: cFirst of all Open Docker Desktop8 z2 M% O( G9 ?
Then Go to Settings7 G" U0 n, b' N7 R
Then Select Resources; g% }( ]2 P+ a0 }
And Click on WSL Integration
! ?9 _7 v7 E6 m2 q$ g6 Q9 G1 m2 ^Make sure that your distribution is enabled* Q4 o: z& L1 g
Restart Docker
) q$ [0 U$ [* u, b# n6 s8 fSummary1 H: D$ F- B' o* k9 {; `* e
' p. k% D3 E" D9 D
: W7 }* Z9 ^- S# B
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)。9 m, N4 I: J* X$ T$ y# }8 ]) F
( u% s  w$ s/ m8 I! e
解决方法/ h& M4 I' b3 V2 J" M6 t

* T2 m# b) }% u0 h9 e9 JNode01) x5 `3 c8 E/ r: ^4 W* A

, e" d6 Y/ `  z' d! V; y9 j配置副本数量,8个pool池都需要改
: g  x( K$ i+ _9 m$ w
0 m3 G" e! u" X+ u. i5 y5 D0 S& U# docker exec -it ceph_mon ceph osd pool set .rgw.root size 2
( O+ c) V: l9 h2 R9 I7 F, K1 C1.
7 a- @; s" w3 |+ r4 z! p
) F1 L) Y9 t& I. J
: C0 U6 f& {$ o8 u  p
+ n- w: t7 P0 A, V1 p$ vCannot uninstall 'PyYAML'.9 t& ?0 Z6 @/ j- `: ~6 j6 }: A7 k

0 H6 g4 B3 w: j- C+ {: E) YIt is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.. e) W7 I- o4 z# k

; R- y1 ^# R& Z  U" @! g: o6 n解决方法) [7 R& |$ C6 ^1 W8 a7 o/ i

' D+ E; l7 }6 K! h, dKolla4 ]  X: d' Y7 O  i, `- D

9 D3 E% R; g' V" Jpip install --ignore-installed PyYAML6 H+ _/ w  ^) A, ^" q- @
1.* a9 l; ?' Z, ^) C1 ]
2.5 G# ^' F2 [8 M# E& Q! i
3.5 z& T# Y1 q7 `/ a9 P. ?
4.
# Q% K. S' b4 }: V: y" B; b5.3 j9 W) e5 L3 ]0 }; d- ^
Network timed out while trying to...
  M. _5 u. O7 L7 g5 m) V+ R% |+ I3 t: f0 B* j5 e" B
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."}
* j2 W% {" l; J0 q
3 ?8 k% M2 r, Q0 o解决方法
4 u0 `' t) i* b2 S1 y. P" ?& U
8 V- H  r# A9 kKolla
7 O. V0 W& B- l) u8 }' I
. L0 ^2 n  e: o9 F4 e# ^& v没有新建:vi /etc/docker/daemon.json' P& W9 w. p) C2 P1 R& u/ h
' q6 Z/ `% S4 E; z* c( i# |
{
' I  r# b" W; I  C$ [
9 w/ i4 I2 p$ Y) t  "registry-mirrors": ["https://jzngeu7d.mirror.aliyuncs.com"]/ Z- i, e" I# r

+ Y  ?* H2 w8 F7 h: h: L}' u) T# A6 F  ^; H1 }

* p3 f$ [* e: ~9 `! z#systemctl daemon-reload
9 r; Q* ^$ R+ D' ~4 c. F* Q; S$ t) N6 m- c
#systemctl restart docker) l5 d- [0 S3 Y  a9 f
1.5 a! l! L$ b/ G! A  O
2.
: E' t- n" K$ p& K  W  W: x3.
7 o! l- U7 @, F) I! y: Q4.
# K4 o3 k: v) @3 D* O8 N& f5.5 X5 I$ ?' ]0 U8 |3 v$ H5 D
6.2 j3 f& v1 p, j. T' n4 g( h( y& D
7.( [+ `& r; y- a) }7 n5 N4 ^3 e
8.% w% h. x: Z3 n2 _/ E7 j4 b
9.
9 P& w6 ?4 W. v, Q: q* y% E% \4 C10.6 {& t/ _/ \8 W; I' d: |; Q
11.
/ H2 z, Z1 Y. F4 m8 w' X 'ReadTimeoutError("HTTPSConnection  n9 e4 \7 c1 z. O2 ]  ~

  M3 z2 }" a% }& d0 kRetrying (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 ~4 K9 A& C7 u
: [4 w9 [9 Q' }! l+ e# ^解决方法
3 ^0 b8 \& q/ F0 T" b) ?2 i, s  w0 e% l! o, n# g6 `8 p
Kolla
0 E( |. v6 @# U! J+ l8 G) ^$ e7 x' j5 y# ?, B8 M9 F  S
# pip install -U ansible --default-timeout=100
% g2 N) A! H, x4 v1.
; e) i( ]% _. u6 z) P% Q4 Q/ r) _, V1 \, G# I' q
6 C# i( @0 {' r  b6 l

" l5 ~! [6 o0 C0 fImportError: cannot import name decorate7 V) o9 G* P# K0 P# s
: Y$ {' [4 J$ d' ?" U
ImportError: cannot import name decorate+ `& B! a" `$ ^1 d5 s
. _0 ~8 R" M  E0 m% D
解决方法( x: B  U; k2 e# u) D+ S! X% g. F

( {' W$ K3 s* _/ j  J% DKolla
: @; r1 z3 |8 b9 P9 O( @2 B( v; @  j4 H) I$ `" C
# pip install -U decorator
- S4 p; `$ Q1 b( f/ @8 |1.
. z% k' H8 U9 t5 t0 `  m
9 {' |' u5 b# C  @6 ^. Y3 V2 {2 D6 Q
) a2 p7 R* t& I6 m. o
+ t# P2 ^0 w/ ]- {/ b; [! U; KCannot uninstall 'ipaddress'.
# o& K/ c. q0 m) ^! t: c7 I9 }
6 u7 Q+ b3 D/ W, D- ACannot 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.+ X1 ^/ P/ y  r* v) M
8 K# `" o3 a! ?& q; M1 B
此类问题强制升级此安装包即可。(已发现PyYAML,ipaddress). J, e" E( n' I% z* N
1 h* z$ @4 x/ T  D- O! Q
解决方法  `5 X7 I3 ~& ^* x3 n4 T' q
, R$ n2 S2 N$ \0 n7 f& c7 s
Kolla
8 ]1 ^6 F# x; O# K, p! Q2 E8 l) a  }7 B& i' O
# pip install --ignore-installed ipaddress0 e4 C1 r" A5 T: M) X0 ]8 ~, X
1.* H* t* q& H- C( r6 p$ B
; ~; a7 b7 i2 e7 w- U8 D6 L3 I2 L

- J: j: Z1 `" m4 ]. K0 i  Z# ?3 ?
" E! |/ y( E% r/ S6 Y1 r* q; N0 M/ tTCP connection reset by peer
! i2 p# I  U4 I/ i6 n
7 `" F; Y: V" N. M' h"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"]}
& m  O4 l( M& G0 k+ G
6 R7 E: ~6 V4 |* K解决方法: S+ s7 w; _& k' K

+ Z! b" I" ?! j( p, @5 ^Kolla. w2 ?% T1 G; k# n# d

* F: ~/ I' o# L' [) `& N/ Lyum 加速源(centos7 阿里源)
0 [/ e9 }; g: G2 f. Z9 F
5 B9 G( p* J. ^% ~+ T- }3 H6 M# yum install -y wget
% M5 ~" ~7 f& r% L! u: q
1 z# {/ L& B' L5 e8 r5 @; r' {# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
4 R* i# Z6 V1 ]8 R1 m& o* n3 D, I& V$ U2 \1 g8 @) U
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
; a1 l" y, y* F. |7 v4 R: @8 a$ w4 Z
# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo4 I  z, ?# ]$ N% |/ T1 X6 m! Y6 P- a

- D5 H- U+ R) B, b# ~4 o& C# yum clean all
# X  n* `4 L/ d9 e* u, c" v0 N8 X& N# p
# yum makecache# ?$ }- r- I: F9 w
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

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

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

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )点击这里给我发消息

GMT+8, 2026-4-8 23:40 , Processed in 0.081972 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

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