go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

etcd error:retrying of unary invoker failed

Open Arrowarcher opened this issue 1 year ago • 14 comments

配置etcd后,启动后一段时间开始不断报错,内容如下: {"level":"warn","ts":"2023-03-22T12:42:04.341+0800","logger":"etcd-client","caller":"[email protected]/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target ":"etcd-endpoints://0xc0000f9500/10.0.xxx.xx:2379","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = latest balancer error: last connection error: connecti on error: desc = "transport: Error while dialing: dial tcp 127.0.0.1:2379: connectex: No connection could be made because the target machine actively refused it.""}
{"level":"info","ts":"2023-03-22T12:42:04.342+0800","logger":"etcd-client","caller":"[email protected]/client.go:210","msg":"Auto sync endpoints failed.","error":"context deadl ine exceeded"}

yaml:

Name: base-rpc
ListenOn: 0.0.0.0:2004
Mode: dev

Etcd:
  Hosts:
  - 10.0.xxx.xx:2379
  Key: base123.rpc

ETCD里可以看到注册key: image

Arrowarcher avatar Mar 22 '23 04:03 Arrowarcher

启动服务会有几率(几率还比较高,偶尔会不出现这样的警告信息)出现1条或2条这样的警告信息,我也碰到这个问题了,只是有这样的警告信息,但是对服务之间的调用没有影响

image

dede8385 avatar Mar 22 '23 15:03 dede8385

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


There will be a chance of starting the service (the probability is relatively high, and occasionally such a warning message will not appear). One or two such warning messages will appear. I have also encountered this problem, but there is such a warning message, but for the service Calls between

image

Issues-translate-bot avatar Mar 22 '23 15:03 Issues-translate-bot

Please make sure you can access etcd server out of the docker container.

zcong1993 avatar Mar 24 '23 03:03 zcong1993

我也遇到了这个问题,并且出现后rpc服务就不可用了. 首先确认你是不是再docker上部署的etcd,我改换为本地部署的etcd后就不存在该问题了(应该是某些配置文件设置问题)

I also encountered this problem and the rpc service became unavailable afterwards. First, confirm if you are deploying etcd on Docker. After changing to locally deployed etcd, the problem no longer exists (it should be a configuration file setting issue).

rholin33 avatar Mar 30 '23 03:03 rholin33

I have also encountered it. Have you found a solution yet.

zhaoyadong00 avatar Jun 07 '23 09:06 zhaoyadong00

I have also encountered it. Have you found a solution yet.

经过实验,当etcd服务监听内网IP并且使用内网IP连接,这个错误可以避免。

zhaoyadong00 avatar Jun 08 '23 09:06 zhaoyadong00

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Is there a solution? I also encountered.

Issues-translate-bot avatar Jul 13 '23 09:07 Issues-translate-bot

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Is there a solution? I also encountered that the etcd cluster starts normally and is available.

Issues-translate-bot avatar Jul 13 '23 09:07 Issues-translate-bot

有解决方案吗?我也遇到了,etcd集群正常启动可用。 image image go-zero启动一段时间后一直报这个警告,但是不影响使用,可以正常访问。 image

info193 avatar Jul 13 '23 09:07 info193

I'm facing the same issue and my rpc become unavailable.

  • The etcd is dockernized
  • My microservices are running as standalone ( undockernized )
  • Each time I've to restart my microservices

Any fix please ?

randydom avatar Jan 06 '24 16:01 randydom

I'm facing the same issue and my rpc become unavailable.

  • The etcd is dockernized
  • My microservices are running as standalone ( undockernized )
  • Each time I've to restart my microservices

Any fix please ?

II suggest you run both your etcd and microservices in either a containerized (dockernized) or non-containerized (undockernized) manner. Based on my experience in production environments, both approaches are feasible.

rholin33 avatar Jan 08 '24 06:01 rholin33

Same error encountered when deploying standalone on WSL2 using docker-compose. It works on windows though.

pengtb avatar Mar 29 '24 10:03 pengtb