keijack / python-eureka-client

A eureka client written in python. Support registering your python component to Eureka Server, as well as calling remote services by pulling the the Eureka registry.
MIT License
183 stars 43 forks source link

Error when getting host by ip and does not register to the eureka server saying that it is down, but it is not #68

Closed pabloaguilarmartinez closed 2 years ago

pabloaguilarmartinez commented 2 years ago

Hi, I'm in the 0.10.5 version and I'm having an issue.

When I deploy the service in a docker container and start registering into the eureka server I get the following logs:

WARNING: Error when getting host by ip File "/usr/local/lib/python3.10/site-packages/py_eureka_client/netint_utils.py", line 35, in get_host_by_ip

This is my configuration:

eureka_client.init(eureka_server=discover_uri,
                           app_name=app_name,
                           instance_port=port,
)

I have tried setting instance_ip and instance_host and it doesn't work.

Sometimes it registers on the server, but after a while the following log appears: WARNING: Eureka server [http://XXXXXXX:8761/eureka] is down, use next url to try.

However, the eureka server is not down.

I've seen that other people have had these problems, but I don't see the solution.

pabloaguilarmartinez commented 2 years ago

It seems that by setting the instance_ip_network and removing the final /eureka from the eureka_server, it is working correctly so far. I'm closing the issue in the meantime.