Describe the bug This is a revival of #4145 , It should have been fixed in 4.0.1 But still present in version 4.0.3
Sample * Spring boot 3.1.5 * Spring cloud 2022.0.4
REPRODUCIBLE EXAMPLE in comment here under
Scenario : * start a cluster of 2 servers. * Kill one server * restart the killed serve => this restarted server won't be able to re-register on the other server
ERROR in log of first server:
Caused by: com.fasterxml.jackson.databind.exc.MismatchInputStreamException: Root name ('timestamp') does not match expected ('instance') for type 'com.netflix.appinfo.InstanceInfo' ...
c.n.discovery.shared.transport.decorator.RetryableEurekaHttpClient:130 Request execution failed with message: HTTP 400 Bad Request.
Sorry I cannot copy/paste from my company laptop.
Comment From: spencergibb
So this is replication, not apps?
Comment From: ouaibsky
Yes replication, but I didn't test more ahead) And workaround cannot be applied when you have security in place, like basic auth, 404 will be sent in place of 401).
Comment From: ouaibsky
Hello any news on this ? I'm surprised that many peoples do not face this issue ! I mean how is it possible to use eureka in prod: * Without multi instance (resilience) * without authentication (security)
It looks like it's minimal requirement ?
Comment From: ouaibsky
Hi finally managed to provide a project to reproduce the issue Java21 / Maven / boot 3.2.1 / cloud 2023.0.0. It includes 2 intelliJ runner (peer1 and peer2), but it's basically 2 spring profiles
Steps to reproduce * Run peer1 and peer2, check homepage and wait both instances appear under application list (name: EUREKA). * Kill peer2 * important: Wait peer1 homepage do not display any reference to peer2 ! * start peer2 and you'll get the error in peer1's log
@spencergibb :Can you update label of this issue to Bug please ?
Regards
Comment From: ouaibsky
Looks like the issue is coming from AbstractJersey3EurekaHttpClient into method sendHeartBeat, response status is not check and it tries to decode a body when status is NOT_FOUND.
I'm not able to find the source repository (not in spring-cloud-netflix, notrin netflix/eureka (like pom suggest))
Any clue ?
Simple fix:
if (response.getStatus() != 404 && response.hasEntity()) {
eurekaResponseBuilder.entity(response.readEntity(InstanceInfo.class));
}
Comment From: spencergibb
Closing in favor of https://github.com/Netflix/eureka/pull/1540