Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eureka server will not reregister after peer server restarts #4220

Closed
ouaibsky opened this issue Nov 9, 2023 · 6 comments
Closed

eureka server will not reregister after peer server restarts #4220

ouaibsky opened this issue Nov 9, 2023 · 6 comments

Comments

@ouaibsky
Copy link

ouaibsky commented Nov 9, 2023

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.
image

@spencergibb
Copy link
Member

So this is replication, not apps?

@ouaibsky
Copy link
Author

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).

@spencergibb spencergibb changed the title App's don'r register after server restarts eureka server will not reregister after peer server restarts Nov 10, 2023
@ouaibsky
Copy link
Author

ouaibsky commented Jan 18, 2024

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 ?

@ouaibsky
Copy link
Author

ouaibsky commented Jan 19, 2024

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

@ouaibsky
Copy link
Author

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));
            }

@spencergibb
Copy link
Member

Closing in favor of Netflix/eureka#1540

@spencergibb spencergibb closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants