Closed markmjm closed 2 years ago
Have you even change your hosts file (Mostly located in /etc/hosts
) to configure server name eureka1
to your loacal IP? And check in your docker container, whether that is correctly configured.
Close for long time silence, please re-open it if you have any questions.
Hello, I am encountering a similar issue. @keijack could you kindly give a bit more explanation to the resolution you were suggesting
@AAyiku Please upgrade to 0.11.8 and try. If errors still occur, please post the logs here.
Will try that out and revert
So this is the error that arises:
[2023-09-26 11:26:19]-[HeartbeatThread]-[eureka_client:802] WARNING: pull full registry from eureka server error!
Traceback (most recent call last):
File "/usr/local/lib/python3.9/urllib/request.py", line 1346, in
do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/usr/local/lib/python3.9/http/client.py", line 1285, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.9/http/client.py", line 1331, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.9/http/client.py", line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.9/http/client.py", line 1040, in _send_output
self.send(msg)
File "/usr/local/lib/python3.9/http/client.py", line 980, in send self.connect()
File "/usr/local/lib/python3.9/http/client.py", line 946, in connect
self.sock = self._create_connection(
File "/usr/local/lib/python3.9/socket.py", line 844, in create_connection
raise err
File "/usr/local/lib/python3.9/socket.py", line 832, in create_connection
sock.connect(sa)
OSError: [Errno 99] Address not available
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/py_eureka_client/eureka_client.py", line 800, in pull_full_registry
await self.connect_to_eureka_server(do_pull)
File "/usr/local/lib/python3.9/site-packages/py_eureka_client/eureka_client.py", line 653, in connect_to_eureka_server
await self.try_all_eureka_servers(fun)
File "/usr/local/lib/python3.9/site-packages/py_eureka_client/eureka_client.py", line 616, in try_all_eureka_servers
await self.try_eureka_server_in_zone(fun)
File "/usr/local/lib/python3.9/site-packages/py_eureka_client/eureka_client.py", line 586, in try_eureka_server_in_zone
await self.try_eureka_servers_in_list(
File "/usr/local/lib/python3.9/site-packages/py_eureka_client/eureka_client.py", line 631, in try_eureka_servers_in_list
await fun(url)
File "/usr/local/lib/python3.9/site-packages/py_eureka_client/eureka_client.py", line 797, in do_pull
self.applications = await get_applications(url, self.__remote_regions)
File "/usr/local/lib/python3.9/site-packages/py_eureka_client/eureka_basic.py", line 353, in get_applications
res = await _getapplications(f"{_format_url(eureka_server)}apps/", regions)
File "/usr/local/lib/python3.9/site-packages/py_eureka_client/eureka_basic.py", line 370, in _getapplications
res = await http_client.http_client.urlopen(
File "/usr/local/lib/python3.9/site-packages/py_eureka_client/http_client.py", line 151, in urlopen
res = urllib.request.urlopen(req, data=data, timeout=timeout)
File "/usr/local/lib/python3.9/urllib/request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python3.9/urllib/request.py", line 517, in open
response = self._open(req, data)
File "/usr/local/lib/python3.9/urllib/request.py", line 534, in _open
result = self._call_chain(self.handle_open, protocol, protocol
+
File "/usr/local/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.9/urllib/request.py", line 1375, in
http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/local/lib/python3.9/urllib/request.py", line 1349, in
do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 99] Address not available>
this the eureka client initialization eureka_client.init(eureka_server="http://localhost:8082/eureka", app_name= "rec-engine", instance_port=rest_port, instance_ip="172.22.176.1")
this the eureka client initialization eureka_client.init(eureka_server="http://localhost:8082/eureka", app_name= "rec-engine", instance_port=rest_port, instance_ip="172.22.176.1")
You should not use localhost
or 127.0.0.1
inside a Docker container.
@keijack what should I be using In this case what would the eureka_server be
You can use your local network IP or host to visit, or docker container IP which may starts with 172 or host if you use compose. Please check the basic network architecture of Docker containers.
Hi
I have a flask application that is deployed to a docker container, but i works fine in my desktop build.
Local build When I set up Eureka service (Springboot), Zuul(Springboot) and my app (Flask) on my local desktop, I see no error and I can see the app getting registered in Eureka service.
However, in the docker container, I keep running into this error show at the end. My flas setup is:
eureka_client.init( 'http://eureka1:3001/eureka/', app_name="my_flask_app", instance_port=my_flask_app_port)
inside the docker container, a curl request seems to produce the 'correct' html page, but my_flask_app is not one of this listed in this html page, which tells me that my_flask_app is not getting registed.
curl http://eureka1:3001/
I would appreciate an insight on what might be causing the error below; what additional info I need to provide in the init call?
Thanks you
Error found in Container logs