找回密码
 注册
查看: 990|回复: 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] ***********************************************************************************************5 o( n& L  H) p, Y5 e; F
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.  g6 c" O7 ]5 q
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}
4 o; e  `  ^1 z. w- c8 H! K# O* G+ ?) F+ S) Y1 E: o
) }+ F. @: K" O
排查过程,怀疑是这个文件导致连接失败了:
9 A: t; E8 O+ v2 |- F, e: R[root@openstack-gnocchi ~]# cd /etc/systemd/system/docker.service.d/; I' ]: j$ c. O* I9 Z5 y% u
[root@openstack-gnocchi docker.service.d]# ls
$ H2 c7 X; y+ u8 p0 dkolla.conf
  d3 b8 `# o" l' {" A. `[root@openstack-gnocchi docker.service.d]# rm -rf kolla.conf        删除文件,接下来重启服务:
* p! a" ]) u! G! C[root@openstack-gnocchi docker.service.d]# systemctl restart docker.service ' `% L  K( S% k; ]0 e
Warning: docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.
9 O4 e6 F* c% i, Y& n5 ][root@openstack-gnocchi docker.service.d]# systemctl daemon-reload. L% U( k3 @6 ^, ~
[root@openstack-gnocchi docker.service.d]# systemctl restart docker.service
- V3 N6 w: J& k; g) _# I3 D. z; Y$ z( O& A+ G
8 _- P$ G* P- u2 A9 v  [! Z

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2022-6-16 09:35:38 | 显示全部楼层
kolla-ansible -i all-in-one prechecks  -vvv9 W- c4 d/ ]( P, V
TASK [haproxy : Get container facts] ******************************************************************************************************************************************************************
- {, a( M& k" _7 E5 rtask path: /usr/share/kolla-ansible/ansible/roles/haproxy/tasks/precheck.yml:2( _- j( `3 I7 y6 V7 u3 y- e
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root, X# R% d7 E( |7 U( F' M8 q- R' z
<localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'" Q  Q6 ~( O% O0 ~# K
<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'# M% v- O! L3 ^* L8 J
Using module file /usr/share/kolla-ansible/ansible/library/kolla_container_facts.py
  a4 J; m4 w# m& r% L<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
  A* D  f* C' z% w5 N/ n<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'
. n- X5 }( G$ w% n9 o6 F- T<localhost> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py && sleep 0'
3 o' C* E+ f2 P& H9 [3 S' C<localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/ > /dev/null 2>&1 && sleep 0'% P2 [! i2 P6 W- O+ K
The full traceback is:5 _0 F. F0 L; `
Traceback (most recent call last):
; u7 D1 a' g& s; N/ L  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 114, in <module>1 C! G. U. x9 k0 ]  X/ n' o
    _ansiballz_main()% X$ W" D  e7 X. h* C0 c* U; u
  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 106, in _ansiballz_main
% I) A6 q3 X# `1 ]    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)1 O7 d5 G2 B/ H! V$ s
  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 49, in invoke_module5 P  \0 v9 t4 ^9 g+ C( w9 f) c- S2 T
    imp.load_module('__main__', mod, module, MOD_DESC)( C% [8 E# w# y8 K  _" s% S! t
  File "/tmp/ansible_kolla_container_facts_payload_gQLkqs/__main__.py", line 86, in <module>5 _8 k  d; C$ M5 [# I, Y5 ^0 V
  File "/tmp/ansible_kolla_container_facts_payload_gQLkqs/__main__.py", line 68, in main# F. F9 b# h: Q1 J3 t3 _' g) `
  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 197, in __init__
: v/ R' U' J1 |. C: J    self._version = self._retrieve_server_version()
; i) c( r) n: c$ }1 G, x$ G& _& u3 V  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 222, in _retrieve_server_version
, \2 q1 Y0 a7 c. N& p5 A( N- k1 Y/ y    'Error while fetching server API version: {0}'.format(e)
0 @$ ?5 @1 e, ?9 L9 D& l0 W+ fdocker.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.7 C9 _" w1 o% K) Q/ m. {

' R3 t% E- v( l2 Ifatal: [localhost]: FAILED! => {9 p$ Q2 o: F2 N$ b5 H0 B
    "changed": false, # M/ r8 a7 P, g$ N5 P
    "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 N. ?2 \3 ^8 C- Y    "module_stdout": "",
  F; `: ]6 J; _, X& c9 x3 v, U* x0 K8 J    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
% y8 F: o6 _) m& A    "rc": 1
/ R/ ?  m$ x( h+ e# D4 [}

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2022-6-16 09:48:41 | 显示全部楼层
How To Solve docker.errors.DockerException: Error while fetching server API version Error ?4 W8 m4 ^/ _3 ]1 p8 c
How To Solve docker.errors.DockerException: Error while fetching server API version Error ?6 q/ p  v4 o$ g; g# H
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
5 G' b, t4 Q( Y: c
; S  O3 a* R0 k- ]docker.errors.DockerException: Error while fetching server API version
6 K6 ^/ [' v$ Y0 ?7 W8 e  f" NTo 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 b' A0 |. u. y3 Q: k, Z: {: b% q/ Q4 k
Solution 1: Make Sure Docker running
/ N' }( R: w3 }) u
3 u0 R- u) V9 l: Z) Z9 [3 f
/ D( }: H$ i' N3 X4 A3 CThis 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.( B0 k5 s9 N# [; @
+ ^5 P" o' B& u
3 y0 u# W+ V2 V  r" N! Z9 Y* _

1 W$ J4 c& L% v, isudo service docker start
3 c5 s0 X2 y( {6 o$ V' ^, N) ]OR; j( b, d. ]0 c) R; p
1 ~4 M6 T. J3 E
sudo service docker restart, Z. {/ P9 X- t
OR+ |2 v- ]% ]: S" }! ?- @9 g( h/ I
! W# j, `. j' b: f: ]
systemctl start docker9 b$ Q5 Z$ y4 o1 X4 o& Q
Solution 2: Set Permission
# r/ k1 L' h8 N
7 P1 [$ b- V  f/ J! f3 J. {1 h, n * F+ {* ?1 U8 M$ @  j" p! l& ?

; I: d8 |# H+ U1 `( T6 c / W4 X. M) k; I. q- ^
Just Set permission 666 for docker Just using below command.
3 Y' s% z5 w# q. \* F- ^9 g9 {* z8 K$ R! _, m
sudo chmod 666 /var/run/docker.sock( N8 F( v" h: v6 Y( V/ `
Solution 3: enable WSL Integration3 u% x, Y: W8 ?7 G& t

/ o4 m& ]) @4 m& I' }- \5 V- l
6 }" s4 m3 r/ p) d7 HJust enable WSL Integration. Follow these step.7 a7 v1 C! r" P) h! V/ Q/ z

& t% }8 |1 x4 l. d) ]First of all Open Docker Desktop
* d$ C2 Z5 O# x1 P3 V; T7 V. N5 `; ~Then Go to Settings
" y* R5 W9 l  V; v# x% D- [" XThen Select Resources2 O. U, D$ g& e3 z7 p; Z
And Click on WSL Integration
: B- O+ |2 l) A& J, `  D( y* R6 `Make sure that your distribution is enabled
# u# |2 [/ J) VRestart Docker) c  j1 \8 M1 F: e0 q' R
Summary4 e0 _0 b  F, L: \8 T) T

) I1 G) C! t+ R) Q4 `
+ h2 l6 Y1 D) \7 K# }/ ^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?

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2022-6-16 10:53:57 | 显示全部楼层
ceph系统有health_warn警告,通过Pool看出池的副本数是3(replicated size),osd tree故障域只有两台host,有一个副本没有地方放置,所以是降级状态(degraded)。
+ Z: z& j& [: a2 u" t1 x$ }# h" k# j. o0 B
解决方法; Y( {" N2 ]1 t& {: Z
0 c/ b4 C5 f. Z; X
Node012 {) f3 J- @. u" L+ M8 U4 |5 z

9 _) V! Z. N% S1 A) ^. w2 H0 \/ |5 G配置副本数量,8个pool池都需要改2 v( b# ]0 u2 f' O) o7 p8 _
  G0 f- ~. `0 l
# docker exec -it ceph_mon ceph osd pool set .rgw.root size 2
  T* H* X4 Z) l% P1.7 C4 V. G: [: d! x+ G

% W1 @, B) ^8 B8 a0 P9 @* ?: l- K: U# Z' X4 K# K
. b6 k  ^4 R9 ~0 M7 p. M
Cannot uninstall 'PyYAML'.
6 M$ o& {% R  E6 o3 s: W, q6 ?& Y; u& T
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.3 y& [  Y" X& L5 ?3 m- w: i
0 c5 T& }! B& `2 p' Y% V
解决方法$ z- V/ U7 U, X6 Q$ ]
3 [6 A9 w% u1 H  v- C
Kolla
* z# t8 F+ _; U0 v! N% w1 E5 F# s/ ^* Z3 R; g: ~9 B! g; A
pip install --ignore-installed PyYAML
: Y" A) P9 M; p/ }  J* K* @1.
8 O5 b1 ~! a+ p( w& i2.$ v* m" \7 o8 O0 K" @. K& h
3.
' ?& T7 [8 c* @! V* o# {4., I9 r8 L9 R% i& [2 k
5.! |0 n' B$ E0 E$ B6 H6 k' N
Network timed out while trying to...
8 u0 E' t" J" p+ s9 Q9 }3 |$ Y6 m7 T- z
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."}
8 t6 R2 }) Z1 I4 m# d: w' h% n* }6 m+ L3 g
解决方法
* b/ X5 J4 F# b1 b$ f
; v) K5 Y4 S5 ~5 vKolla8 {# ~  p5 b4 _1 m6 ?  q

7 a0 d$ |. X- `2 i4 o) @# o没有新建:vi /etc/docker/daemon.json
! s' ?# \+ o- l! M- U' e* }7 `* G# Q- y" K. e# Y7 I; Q
{% Q- Y! n( s! [! f/ S8 d/ x
# p5 h+ c1 x+ Y; E! N
  "registry-mirrors": ["https://jzngeu7d.mirror.aliyuncs.com"]
- `- \. w, k. w/ T5 r/ g6 p8 v: |
7 D- m: |4 H) v/ y}
4 i. d; U: a( {7 O* R. a6 B7 e; }: ]$ }( k
#systemctl daemon-reload
7 J2 [# W5 J7 t9 X. N8 B/ Y+ k# y( P: c8 j2 p! z" S
#systemctl restart docker$ `( ~2 Y. V# D# g% K" b
1.+ _5 {0 ]) F9 y8 c& }8 [  W8 F
2.( K! {4 ?( a& S" l. J) T
3.
  ~* P9 y' ~( v/ }( i( G6 u4.6 f6 F' h% M& v4 T' c1 |5 G
5.
/ d( A- D/ D. N& {2 r$ v  X6.
( {! t+ C) S% s3 b; i7.
4 a# x- r- X4 A  Q0 I- A' c8.
: m! c  v3 I, A+ f) R  j9.* q$ k- L/ `& R* m. Y/ J
10.
' f* @5 ~0 P9 ~- q, u! S11." E; f. h- U+ H6 O$ g7 _
 'ReadTimeoutError("HTTPSConnection! H1 o" w: b3 U8 G3 \/ n
6 s8 x5 K8 E" c' B+ |
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/
+ z1 s: x9 ]3 ?. `* O9 g" |! }% @
. a  W" Y" m; n- `& x! g5 J+ A解决方法
5 {: g2 M, i, W' z. k8 {/ k
, H) d( ^$ m! _, w$ s" p( pKolla* @& T9 g2 D/ t3 r  T
/ a# ?7 @& @( w
# pip install -U ansible --default-timeout=1003 z8 T: e& ?1 T% X. n0 e" h% j
1.
9 r/ N5 t) E; D; u
7 i% G  ~# Q* S3 R2 x  V2 o& ]8 q0 D! i) a3 K+ [' ~

& D- x2 F/ @+ w) X: YImportError: cannot import name decorate9 I4 v& k) r0 q( Z0 I
5 a9 A1 f5 l# k% p
ImportError: cannot import name decorate
4 w: i; }4 d& M3 S& _& d7 [$ M+ o
解决方法
6 i  R; g& C* Y8 F0 m2 o  G: W+ f) {& b) g6 s
Kolla
4 R9 o/ \6 v' {. f1 n6 e6 e
9 `9 K, c1 C% ~4 G5 x* O# q# pip install -U decorator' [% x: G" Y+ ]3 `  ~4 O" h' E
1.& ?# f9 P$ w6 v5 q; m1 |

  E+ w5 T/ s: C  e0 r
! h/ U; f; x- i/ W6 q5 J& R
# E0 v& k$ H" {) j1 F% @Cannot uninstall 'ipaddress'.+ p1 ]1 R/ Q) v3 M5 n, J6 e2 v

( U9 ?: ^) S* jCannot 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.
% c' m  ]! H6 g0 Z" p6 U# t( i4 j* p* E$ _( m8 h
此类问题强制升级此安装包即可。(已发现PyYAML,ipaddress)9 [, ~/ q% s; {! P2 O' r6 a
3 `4 I" F# P& w$ U
解决方法6 U( h! H8 I3 C6 O
/ \2 B  A- k) M' F  m1 ]+ v- h
Kolla1 v2 F3 D  E$ s6 D2 ^

2 w: }# t* |1 I& G4 [! V+ l& W8 W& L# pip install --ignore-installed ipaddress: U; ^3 c; K. w3 X7 Z; B7 [
1.
' S8 N) _3 G- G0 [- ?3 y1 Q7 q: s5 _  Z

5 V, U1 y' |# u* K0 P
! I' T, U; L: K( X- uTCP connection reset by peer
  t' G, N# l  S3 j2 Y% [- u
" d$ q9 c2 |! c$ z"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"]}3 V( C* J( Z* f1 Q( h) X0 V- J5 f
; A. l4 m- S2 O5 b& g; P
解决方法
$ x5 u; {% v7 a) P. Z" C& ~* z( \5 G, V+ t6 {! S
Kolla# I+ y# L# ]$ P7 P1 l. d

" S* n" m; Q0 c+ q2 h8 @yum 加速源(centos7 阿里源)( m9 v* v9 p! H% E: i

) L- [9 R3 d1 [+ a# ]# yum install -y wget
" F( ~" u2 y" v4 J* i3 H
. P( Q( R1 p4 e8 n. m0 c. D# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup1 ?4 I0 g9 f7 V5 b" O
; d; L3 U) g. J
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
( l  W0 o* O' }8 ^- [+ L
' {0 A7 M5 n- M. M# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
, v8 y6 k5 w; r5 e1 Y, O
- W4 Y" \7 x* Z, v# s0 E+ L# yum clean all
* o& d, h4 z0 o# X8 q# h9 s+ V" f  p7 p8 l/ j3 z+ o
# yum makecache
* r7 s! E1 W" o" n. ]/ Z
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 00:09 , Processed in 0.028282 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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