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. Spring Cloud Netflix eureka server will not reregister after peer server restarts

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

eureka.zip

@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

Comment From: LozinskiyIlya

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 ?

Yes, absolutely! I am facing the same thing here. For the reproduction you don't even need replicas, just one server and one client. If the client is up while server reloads, the client would keep renewing it`s state with PUT, while the proper flow I believe would be POST (register) and only then PUT (renew lease), but that is not happening, and on the client I see mentioned JSON mismatch error trace

Comment From: zore21

I am facing an issue where I start the Eureka server first, and then I start the other services (Eureka clients). The first time, the Eureka server successfully registers the clients.

However, if I stop and restart the Eureka server, the clients do not automatically re-register, and I start getting a ConnectionError.

I'm new to microservices architecture, so I want to understand: Is this expected behavior, or am I misunderstanding how it's supposed to work?

tech stack : java 17 spring boot 3.5.0 eureka cloud 25.0.0