Closed xkcomeon closed 2 years ago
Could you please provide the xml from http://[your-eureka-server]/v2/apps
, and the code how you call do_service
?
"
hostName 和 ipAddr 填充的都是 域名 我看后面拼接url的时候多加了port导致异常
带标签贴出来格式被github去除掉了
`
<hostName>config-service-test.xxxxxxxxxx.com</hostName>
<app>SERVICE-CONFIG</app>
<ipAddr>config-service-test.xxxxxxxxxx.com</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">80</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>30</renewalIntervalInSecs>
<durationInSecs>90</durationInSecs>
<registrationTimestamp>1644488362293</registrationTimestamp>
<lastRenewalTimestamp>1645165181335</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1644488362293</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap" />
<healthCheckUrl>http://config-service-test.xxxxxxxxxx.com:80null</healthCheckUrl>
<vipAddress>SERVICE-CONFIG</vipAddress>
<secureVipAddress>config-service-test.xxxxxxxxxx.com:443</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1644488362293</lastUpdatedTimestamp>
<lastDirtyTimestamp>1644488362278</lastDirtyTimestamp>
<actionType>ADDED</actionType>
`
大佬 有微信么 加上微信啊 具体给你反馈
Do you mean that when concatenating url and port like http://config-service-test.xxxxxxxxxx.com:80
visited by do_service
will fail?
If you can debug you code, could you please check whether the port matches the protocol (say: 80 to http, and 443 to https) ?
I think we should discuss this issue here and make it as a record.
http://config-service-test.xxxxxxxxxx.com:80 使requests包请求是正常的 但是用我们包里的do_service()方法是失败的
好像是urllib.request 请求的问题 do_service 使用了这个请求
urllib.request 不支持请求 http://config-service-test.xxxxxxxxxx.com:80这样的链接
I just trim the port when it's a default port, please check out 0.10.3 and try.
好的 感谢🙏
Close issue for the problem seems being resolved, If you have any other problem, please submit a new one.
File "/usr/local/lib/python3.7/site-packages/py_eureka_client/eureka_client.py", line 1284, in do_service return self.walk_nodes(app_name, service, prefer_ip, prefer_https, walk_using_urllib) File "/usr/local/lib/python3.7/site-packages/py_eureka_client/eureka_client.py", line 1240, in walk_nodes raise http_client.URLError("Try all up instances in registry, but all fail") urllib.error.URLError: <urlopen error Try all up instances in registry, but all fail>