question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

spring boot admin does not detect service after restarting spring boot admin

See original GitHub issue

spring boot 2.4.3 spring cloud 2020.0.1 spring boot admin 2.4.0

I have an environment with two services. They are exchange-api-test and admin-test(is a spring-boot-admin project) They all are deployed and managed by Docker images and Kubernetes. I also use admin-test in order to monitor them all and spring-cloud-kubernetes to discover all the services automatically.

It works perfectly whenever I restart the exchange-api-test project (kubectl rollout restart deployment exchange-api-deployment), admin-test discovers every service. image My problem comes when I restart admin-test project(kubectl rollout restart deployment admin-deployment), exchange-api-test is shown as OFFLINE in the SBA and it does not change its status. image applaction.yml (in admin-test project)

server:
 port: 8080
spring:
 profiles:
   active: test
 application:
   name: admin-${spring.profiles.active}
 cloud:
   kubernetes:
     discovery:
       all-namespaces: true
       service-labels:
         env: ${spring.profiles.active}
     reload:
       enabled: true
management:
 endpoints:
   web:
     exposure:
       include: "*"
 endpoint:
   health:
     show-details: always

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
nathankooijcommented, Mar 10, 2021

We also hit this bug after upgrading to SBA 2.4.0 using Spring Cloud Kubernetes Discovery. I noticed that events got “lost” and as such, certain AbstractEventHandlers (like EndpointDetectionTrigger) were not triggered at all. Subsequently, services are reported as down or endpoints are not discovered.

I traced this back to InstanceEventPublisher, where after the Reactor Core upgrade to 3.4.x, the new sinks API was used. However, the new sinks API has one major difference with the previous API (UnicastProcessor), in the sense that serialization (i.e. concurrent access) is not handled for you. Instead, the emission fails silently (adding orThrow() will reveal the errors).

I can fix it locally by either retrying the emission (using a EmitFailureHandler) or by adding synchronized to InstanceEventPublisher#publish. Happy to provide a PR for this if you want, @SteKoe.

1reaction
SteKoecommented, Feb 26, 2021

Hi @star4j, have you added @EnableScheduling to the main Application class of your Spring Boot Admin implementation (see #1506)?

See also: https://cloud.spring.io/spring-cloud-kubernetes/1.1.x/reference/html/#secrets-propertysource

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Boot Admin does not detect service after restarting
This my properties file. It works perfectly whenever I restart the SBA project, it discovers every service.
Read more >
Spring Boot Admin Reference Guide - GitHub Pages
Spring Boot Admin will detect everything that looks like an URL and render it ... This services will be ignored when using discovery...
Read more >
How to Inspect and Troubleshoot Spring Microservices on ...
You can see the Spring Boot Admin server dashboard by entering the URL http://localhost:8080 into your web browser. In the dashboard, you will...
Read more >
codecentric/spring-boot-admin - Gitter
We are running admin server under K8 and leverage K8 discovery. When we upgraded to Spring 2.5.4, the admin server was no longer...
Read more >
Spring Boot Reference Documentation
The following content is for you: Spring Application: SpringApplication. External Configuration: External Configuration. Profiles: Profiles. Logging: Logging ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found