将设为首页浏览此站
开启辅助访问 天气与日历 收藏本站联系我们切换到窄版

易陆发现论坛

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

Error while fetching server API version Timeout value connect was Timeout

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

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

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

x
TASK [haproxy : Get container facts] ***********************************************************************************************
3 U4 R1 c0 I& I# QAn 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., @- v6 `. }) u! P1 |, D
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}
8 r1 t* L7 k8 \6 _. O- `+ ]& H' I% j9 y
0 e. X3 n' i0 s" y( d" o) g& l
排查过程,怀疑是这个文件导致连接失败了:
4 G8 N: Z3 H0 I. M[root@openstack-gnocchi ~]# cd /etc/systemd/system/docker.service.d/
% Y3 [/ [) U. `  F( Y2 T[root@openstack-gnocchi docker.service.d]# ls
8 a8 f) u- v2 g/ F; f$ t* {kolla.conf, U& P) K! a! t% D; s9 e
[root@openstack-gnocchi docker.service.d]# rm -rf kolla.conf        删除文件,接下来重启服务:
+ j: w3 b! |$ Z, m; w) U[root@openstack-gnocchi docker.service.d]# systemctl restart docker.service 1 f! c, u+ H4 q6 t; n; a  z
Warning: docker.service changed on disk. Run 'systemctl daemon-reload' to reload units.
5 e2 `$ Y$ k; T% u[root@openstack-gnocchi docker.service.d]# systemctl daemon-reload
- @: C/ [0 b  ^3 Z% Y8 L[root@openstack-gnocchi docker.service.d]# systemctl restart docker.service ; ^, P: b& k  h1 x

: e- d' P+ u/ I: T" l, j1 B# C: J% y2 F
 楼主| 发表于 2022-6-16 09:35:38 | 显示全部楼层
kolla-ansible -i all-in-one prechecks  -vvv
# e- p' Y0 g: {+ BTASK [haproxy : Get container facts] ******************************************************************************************************************************************************************/ z$ L1 H! y1 i4 L9 t
task path: /usr/share/kolla-ansible/ansible/roles/haproxy/tasks/precheck.yml:2) ^4 I1 M0 S1 x' y
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: root- N% c9 p$ x4 d3 B) S" n
<localhost> EXEC /bin/sh -c 'echo ~root && sleep 0'
$ d! R  E$ B2 g4 \6 |. C<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'
+ V& X5 k: z, o3 `, Y2 RUsing module file /usr/share/kolla-ansible/ansible/library/kolla_container_facts.py
! q7 U1 _% F5 X- z) m0 V9 v7 Z; m<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
) B1 g4 G) V& U1 o9 w3 h. v<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'
" r. f- b' I+ H, S  [<localhost> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py && sleep 0'' E8 W# v8 }: ?6 j/ [* e2 y+ `
<localhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/ > /dev/null 2>&1 && sleep 0'
, M% K. E8 _) \. a; o6 y2 CThe full traceback is:
8 k: s4 S- A. w6 WTraceback (most recent call last):) Y$ ~6 @" b* N5 y+ ~
  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 114, in <module>- o- a( _  e3 }# N. ]9 P0 |
    _ansiballz_main()8 O9 X0 s6 e4 v5 `9 H$ _& {, p0 S
  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 106, in _ansiballz_main
. [& c# c* b! d, a6 l; p$ H( S    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
3 T2 u2 ^& q/ E7 k; k' m7 a  File "/root/.ansible/tmp/ansible-tmp-1655343195.01-13693-147197134416776/AnsiballZ_kolla_container_facts.py", line 49, in invoke_module
" R; i; `2 N6 x! M: T    imp.load_module('__main__', mod, module, MOD_DESC)6 R: H. H, y. R5 X: ?1 V4 A
  File "/tmp/ansible_kolla_container_facts_payload_gQLkqs/__main__.py", line 86, in <module>8 [7 {5 E. \1 Q- Q4 D- b3 {
  File "/tmp/ansible_kolla_container_facts_payload_gQLkqs/__main__.py", line 68, in main
0 O: a/ I6 M6 c! Y: s  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 197, in __init__9 H/ O; L' K& I. F9 _" Q( K
    self._version = self._retrieve_server_version()
; F# T# ^8 r" d7 `8 Q  File "/usr/lib/python2.7/site-packages/docker/api/client.py", line 222, in _retrieve_server_version: Q: ?5 r" H& s" v
    'Error while fetching server API version: {0}'.format(e)* t6 ^8 R  [4 \4 _5 _
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.
2 q. C; l' q, s1 t2 y; ~* l
" ^0 ]0 p0 ]1 Xfatal: [localhost]: FAILED! => {, o" X( @( m+ v
    "changed": false, : b8 Z: |" X$ Z9 T3 _
    "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", ' T% j& ~2 Z6 ?5 m' r
    "module_stdout": "",
* l% D- ]* v* R    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", 5 v: }- m1 F* |! Q+ G) S$ O. I; H
    "rc": 1; U1 D# g6 o6 r+ P- P) _; A
}
 楼主| 发表于 2022-6-16 09:48:41 | 显示全部楼层
How To Solve docker.errors.DockerException: Error while fetching server API version Error ?; N# V8 @9 a# g
How To Solve docker.errors.DockerException: Error while fetching server API version Error ?
8 W+ i8 q7 j9 M/ j8 ~6 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
5 X2 P1 R8 J: m  `
- g# G4 [2 g" E2 idocker.errors.DockerException: Error while fetching server API version
& T( V! d0 e1 |3 z% xTo 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" G3 \7 y3 g& ]. @0 ]
3 x. r$ \9 t- r5 e: I7 T$ D
Solution 1: Make Sure Docker running4 T% q/ b4 D7 Z; r
+ w( r( N# U% t
4 y0 c  J% x' U8 h% S) U9 `1 ~
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.8 M9 U, h5 y1 W: |
; Y" h) p6 k3 J8 ^
& b2 y6 z+ ?% i
6 r8 Y) _( D! g* }  m( B
sudo service docker start1 U2 N# O0 b1 @: F' W+ B7 q
OR
! u, U/ ^1 ?3 l+ r
' b1 l& E- \& J, T! G/ lsudo service docker restart" c! m" u. ?; r
OR, |7 ]4 ~8 T$ x& T

+ i2 m( G0 K/ u$ j" a/ t2 s9 zsystemctl start docker
+ v9 c1 ]/ R& iSolution 2: Set Permission
7 S2 a- b  R4 z- ^" U2 E, P* L+ @& P& _! C/ u" Y
) S- h% Q1 `4 Q: R2 D
5 }# U% @: n* H
$ _/ A& ~+ M& D. f
Just Set permission 666 for docker Just using below command.% ~) M( ?. I' g0 E2 @% _
8 \: a* s3 O0 o* q6 u
sudo chmod 666 /var/run/docker.sock
% Q: f( k" [" k2 \Solution 3: enable WSL Integration
& x& n: [# d5 l' w; R: Z. W: J" b, m: g3 H* \; m- p
+ G! j4 D$ }6 ~* {$ V' o, t! w; Q
Just enable WSL Integration. Follow these step.
  q  }1 }& G+ y! i; ^! ^# W# n/ \) v: U9 u6 U) m
First of all Open Docker Desktop
$ }5 h3 D. c  I0 pThen Go to Settings7 q: P" g. v6 I- ?- Q8 [/ K" j
Then Select Resources
2 r2 h5 b! Y, }8 B( vAnd Click on WSL Integration. y! A: _8 w8 {# q/ v
Make sure that your distribution is enabled0 ^% f0 X9 u0 N7 k' P5 ^+ s
Restart Docker5 m9 e( L8 b% w" ?. M6 r* H( Q% X
Summary
9 F0 l+ n, _' x: @( G/ |+ N! g
! f( T. h6 P& j$ k. }
- p* j# y4 k, l3 EIt’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)。
& ?% q$ U; X9 n4 ?0 `# n
9 z$ y* r% L  i- O! f1 C6 @解决方法
1 L5 L! U' P- ]7 G; I
% ~9 r- I# O$ kNode01) W5 h" g9 N* u. V! h

. K! n6 u- N- {9 n# T* K4 P* [$ d配置副本数量,8个pool池都需要改
- G- S. L5 i4 `2 A) R% a/ f% f0 T+ g0 A1 ^% z
# docker exec -it ceph_mon ceph osd pool set .rgw.root size 2- |* R6 v/ y1 v, M2 S
1.( ?( n* i) F8 g5 I4 O
; [9 i& `! a0 x' s

( u4 i) H5 c4 v! k: s( g# {
7 }% ~! R: S6 n6 w3 GCannot uninstall 'PyYAML'.
+ B' d: ^0 v3 O% w, w/ d* @$ o# i4 o- d1 R' E
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.9 b; x1 B9 q" z$ E) b$ I9 D+ E

# t" g$ R5 }, O9 f3 V- @' d解决方法
& ]. h9 @: S/ }' ~9 A7 W: }% T2 |9 Y! s8 ^6 Y3 o7 \
Kolla
" v" |9 j% P0 ?, f/ \" C" {
7 M& [! E& Z# j6 d- Y2 u; {pip install --ignore-installed PyYAML
+ N3 \$ n+ V# j* A6 r# \7 z9 R1.+ B, ]* t7 G! x# A% {" e' q
2.- M3 H0 C( U9 E1 V
3.( b5 }9 m. S1 ~7 V+ c
4.
. P& f' D0 {) T5 n$ A+ x+ M- o5.
6 D# Z' V% A/ Z4 ENetwork timed out while trying to...
$ y# H  w) }$ a" r9 ^* \; q. i2 g9 K7 n9 t0 K6 P8 ?- [' f: }4 ^/ O
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."}( N! t# L  p/ k) @
+ R8 i: U6 N* d) L% b# L5 R! p7 P, f
解决方法2 y4 J; D0 @2 V( c

: ?$ L3 v1 u+ C, ^, MKolla
6 V' ~) Y: M. s4 d3 H& l3 S) L5 w' e2 H/ D
没有新建:vi /etc/docker/daemon.json
5 k# Q8 p' O$ P3 X( V1 i  |9 V2 W: k; \. v  V- @* g: ^) F
{: ]6 U$ x2 A, j' P' E

+ c. L1 L1 M% G8 M  "registry-mirrors": ["https://jzngeu7d.mirror.aliyuncs.com"]8 ^& Z( K- O6 w

6 O% i3 J" {5 ], p; C" C}
, @  i) M6 E! a/ B2 z9 s7 o! D. y4 ?0 C- Z0 ^4 T: J
#systemctl daemon-reload8 o) `" p* F; s8 ~. A+ ?5 O/ Y
0 O' R; m# |; {7 s7 }+ v
#systemctl restart docker
* R  {: b" h0 t; {$ U. m8 e/ c1.3 ?0 ~& N6 e5 S
2., e% K/ ]3 F' R+ W
3.0 e. |! k2 C$ T
4.
7 [) U$ U5 d3 l! ?2 |0 ?5.3 `( ^7 }3 `2 Q$ ]* C4 ^1 K
6.* v( v: k3 Q" N$ N" ^) l
7.
- T- j9 n0 E2 O5 B; a% O8.* \( K% S1 g7 [0 m% }, w" {
9.* L  i& L% R4 ?
10.
9 Z# \5 T; D* D, \  x11.; `- _( }9 M6 G+ X' E5 z
 'ReadTimeoutError("HTTPSConnection* L4 [, F, I. s! c
$ \# L' v( T$ }2 W& J: x& {. R& E
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/  \: D; F1 \9 X9 J
- U; Q, ?1 _. {/ {3 c
解决方法
8 c( a) }2 H, @2 L0 h7 B+ i5 U: V$ \/ Y- U
Kolla
' O" m3 j* ]( d. @' |7 e
4 ^+ O. b+ ~4 ^" A7 J/ d. V. j/ L# pip install -U ansible --default-timeout=100" ?$ X( t% A; [3 V
1.
1 A' R& o$ S( h' f/ E6 j) m& |
1 L( D6 \6 ]& w9 j, D1 ^: [) T* I: c( g: c! C* Q4 c8 r7 o

! e4 `' i- r4 qImportError: cannot import name decorate3 H% `: ~3 I7 K) p% g

2 T! b9 p, g# sImportError: cannot import name decorate+ {' o* N9 P  V
: P: t- {3 s+ R0 w3 K7 R; C& {5 \. H5 t2 t
解决方法3 J) a6 p1 l0 Q! c

' M8 x6 A' N- @0 @) RKolla! w3 k  l/ s0 f9 r6 I0 G4 s

7 d# Y0 h9 p, {& Q" e# pip install -U decorator
7 k! b7 q# L2 J1.
% D! G7 _9 p2 K$ R9 H" |
5 b5 j6 L5 f4 a" I# Z( Q  u
. P8 ^' P3 Z/ A, F$ c7 n* E/ T( A' _- ]9 I% D# g7 k
Cannot uninstall 'ipaddress'.
9 V# G4 y/ m9 O# Y, v) S7 f' S  j. K/ ?" H& L; L
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.) \+ `% m( m  d9 I! Y3 ]  K% t' K" w

/ I6 ?0 y( M" [4 S* a, ?8 G此类问题强制升级此安装包即可。(已发现PyYAML,ipaddress)
* J. Z/ ~- C8 b$ I( K1 o  n$ r# `6 Y# Z" V1 w5 Y
解决方法
/ f' v0 e3 V; T$ s# w1 k
: E- T) v7 J/ y# L% h4 fKolla
- M3 q% l# H# V, F$ J$ E9 J' G/ t  s" q2 M$ \- O0 M
# pip install --ignore-installed ipaddress
2 W- }1 c- R8 n8 {/ g1.
- W: V0 b: I& S3 w6 v; s+ _7 s( f- C
$ I/ ~8 W( D0 H9 O( O& F
! [$ |: ~) K( N1 ]* u0 ^# @7 `0 y. @8 d" s: z/ N
TCP connection reset by peer& v: ^: L4 a9 e4 p2 L
+ v' [% D7 W$ K/ a6 R& B- N0 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"]}; l8 B# @2 G. F7 e9 f2 p( U

& U0 O( t9 ~" ?; L2 I9 O解决方法) I: o0 E' l9 j% Q& D1 D

2 o: m% S: v% m2 BKolla& C# T" X* Z) l/ D

3 d3 g4 y1 K( [4 ]: @yum 加速源(centos7 阿里源)
  J6 B3 b$ |0 t3 ]" P1 T( a
! T: s( v/ a  ?, t# yum install -y wget
8 K$ [8 K0 f0 E' L2 I# q
/ m  G( p; u# k4 C# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
0 u1 Z( L2 G- t, V
, l0 w- u& |& l8 E1 i# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo* U4 O5 g2 g9 {  @
/ ^2 t* |) V. P* L2 }8 {
# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo" c  C- ~) q2 P$ t

6 o9 |) \0 C7 x% O; u# yum clean all3 n, P; @; ~$ b  v
9 S$ ~$ g$ C+ M; P- b
# yum makecache
2 W) H9 Y0 z; |: x8 M
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

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

如有购买积分卡请联系497906712

QQ|返回首页|Archiver|手机版|小黑屋|易陆发现 点击这里给我发消息

GMT+8, 2022-7-4 11:11 , Processed in 0.044443 second(s), 22 queries .

Powered by LR.LINUX.cloud bbs168x X3.2 Licensed

© 2012-2022 Comsenz Inc.

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