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
187 stars 44 forks source link

TypeError: '__cache_key' is an invalid keyword argument for this function #5

Closed jxfruit closed 5 years ago

jxfruit commented 5 years ago

您好,在使用eureka_client.init()注册服务之后,隔一段时间会出现以下错误,请问这是什么情况呢,谢谢 Exception in thread Thread-2: Traceback (most recent call last): File "/usr/local/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/local/lib/python3.6/threading.py", line 1182, in run self.function(*self.args, **self.kwargs) File "/usr/local/lib/python3.6/site-packages/py_eureka_client/eureka_client.py", line 833, in heartbeat self.fetch_delta() File "/usr/local/lib/python3.6/site-packages/py_eureka_client/eureka_client.py", line 888, in fetch_delta self.__try_all_eureka_server(do_fetch) File "/usr/local/lib/python3.6/site-packages/py_eureka_client/eureka_client.py", line 853, in try_all_eureka_server fun(url) File "/usr/local/lib/python3.6/site-packages/py_eureka_client/eureka_client.py", line 886, in do_fetch if not self.is_hash_match(): File "/usr/local/lib/python3.6/site-packages/py_eureka_client/eureka_client.py", line 891, in __is_hash_match app_hash = self.get_applications_hash() File "/usr/local/lib/python3.6/site-packages/py_eureka_client/eureka_client.py", line 921, in get_applications_hash sorted_app_status_count = sorted(app_status_count.items(), __cache_key=lambda item: item[0]) TypeError: 'cache_key' is an invalid keyword argument for this function

keijack commented 5 years ago

I am sorry that I introduce this but when refactoring, I have fixed it, please update to 0.5.1 and try. This bug will make the discover service not working. It happened in the refresh service phrase.

jxfruit commented 5 years ago

hi, after update to 0.5.1, another serious error occurs: "'NoneType' object has no attribute 'groups'" and my service can not be found in eureka server. tks

jxfruit commented 5 years ago

I have solved the problem, the version 0.5.1 do not support the hostname in eureka server address. Fixing the regex expression in " /usr/local/lib/python3.6/site-packages/py_eureka_client/__urlopen_proxy__.py" can solve it.

keijack commented 5 years ago

Could you please show me your eureka server URL that you put to the init method? @chasingML

jxfruit commented 5 years ago

Could you please show me your eureka server URL that you put to the init method? @chasingML http://hostname:port/eureka

keijack commented 5 years ago

OK, I see, your eureka server url has not got any ., has it? I've changed the Regx, and v0.5.2 works now.

jxfruit commented 5 years ago

tks

PriyatamNayak commented 4 years ago

how to register with hostname instaed of ips

jxfruit commented 4 years ago

@PriyatamNayak Have you tried to configure the hostname and ips in hosts file?

PriyatamNayak commented 4 years ago

Yes ,have given the hostname and container I’d .. It is working fine now

On Wed, 21 Oct 2020 at 7:30 PM, jxfruit notifications@github.com wrote:

@PriyatamNayak https://github.com/PriyatamNayak Have you tried to configure the hostname and ips in hosts file?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/keijack/python-eureka-client/issues/5#issuecomment-713503081, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXNYTCGLNJP2LDD3KMVYLLSL3A6ZANCNFSM4GQAV3ZA .

--

Regards Priyatam Nayak+6584584608