Open AAyiku opened 3 months ago
What if you use curl to visit http://discoveryserver.kowri.uat:8080/eureka/
?
It is an internal link, so it can't be accessed locally
@keijack would the library be able to connect to a proxy server, that gives access to a the discovery server?
Currently no, pythone-eureka-client
cannot connect to a eureka server via a proxy server, however, you can define your own HttpClient to do it.
Hi @keijack I am having issues with connecting my python fastapi app to the discovery server on a UAT environment. However, I have no issues connecting to my discovery server locally. Here is the code snippet:
[2024-05-07 10:38:28]-[Thread-1]-[eureka_client:633] WARNING: Eureka server ["http://discoveryserver.kowri.uat:8080/eureka/"] is down, use next url to try. Traceback (most recent call last): 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 709, in do_register await _register(url, self.__instance) File "/usr/local/lib/python3.9/site-packages/py_eureka_client/eureka_basic.py", line 301, in _register req = http_client.HttpRequest(f"{_format_url(eureka_server)}apps/{quote(instance_dic['app'])}", File "/usr/local/lib/python3.9/site-packages/py_eureka_client/http_client.py", line 82, in __init__ raise URLError("Unvalid URL") urllib.error.URLError: <urlopen error Unvalid URL> [2024-05-07 10:38:29]-[Thread-1]-[eureka_client:713] WARNING: Register error! Will try in next heartbeat. Traceback (most recent call last): 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 643, in __try_eureka_servers_in_list raise EurekaServerConnectionException( py_eureka_client.eureka_client.EurekaServerConnectionException: <urlopen error All eureka servers in zone[default] are down!> 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 710, in register await self.__connect_to_eureka_server(do_register) 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 618, in __try_all_eureka_servers await self.__try_eureka_server_not_in_zone(fun) File "/usr/local/lib/python3.9/site-packages/py_eureka_client/eureka_client.py", line 598, in __try_eureka_server_not_in_zone raise EurekaServerConnectionException( py_eureka_client.eureka_client.EurekaServerConnectionException: <urlopen error All eureka servers in all zone are down!>
Any sort of help will be very appreciated!