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

Problem with binding Redis and SCS Config Server #204

Closed
karolpawlak opened this issue Mar 3, 2023 · 6 comments
Closed

Problem with binding Redis and SCS Config Server #204

karolpawlak opened this issue Mar 3, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@karolpawlak
Copy link

karolpawlak commented Mar 3, 2023

Hello Team,

We observed that one of our customers since switching to Spring Boot 3, their application no longer starts and that results in the error (full error stack attached):

"MSG": "Redis health check failed", "DATA": "boundedElastic-1 org.springframework.boot.actuate.data.redis.RedisReactiveHealthIndicator Redis health check failed org.springframework.data.redis.
RedisConnectionFailureException: Unable to connect to Redis\n at...

When the application was using Spring Boot 2.7.3, it worked no problem. Another interesting thing we noticed is that when you remove the Config Server and its dependency, everything works fine. They have managed to find a workaround by manually specifying the datasource configuration in the application.yml file. By redefining Redis properties by copying spring.redis.x to spring.data.redis.x, and it works.

They are using the following versions of products:
TAS 2.13.9
Spring Cloud Services 3.1.40
Redis 3.1.3-build.2

We believe that the problem is in java-cfenv. The root cause: Spring Boot 3.0 now uses a new path for configuring Redis. It used to be spring.redis.x, now it’s spring.data.redis.x. I believe that the following source file should be looked into in java-cfenv.

You can find the sample app used for testing in this repository, it also contains a README with the description of the issue and a workaround https://github.com/benpart/redis-demo

Reproduction steps:
FAIL

  1. Deploy the sample app and bind it to a Config Server and Redis instances
  2. Observe the error

INVESTIGATION

  1. Edit the app and remove the Config Server dependency.
  2. Deploy the app and bind it Redis instance
  3. Works

WORKAROUND

  1. Deploy the sample app but activate correctif profile, and bind it to a Config Server and Redis instances
  2. Works
@karolpawlak
Copy link
Author

FYI since the Spring Cloud Bindings library does for Kubernetes service bindings what Java CFEnv does for CF/TAS services, that project has to make changes as well as shown here.

@pivotal-david-osullivan pivotal-david-osullivan added the bug Something isn't working label Mar 6, 2023
@rama78
Copy link

rama78 commented Mar 10, 2023

Thanks @karolpawlak for reporting this. We have encountered a similar issue and hope that the fix will soon be available for us in the java-cfenv-boot dependency, thanks to @pivotal-david-osullivan. Our team plans to add JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '{enabled: false}' to the manifest file to suppress the warning explained at https://via.vmw.com/EiBW. We would greatly appreciate it if a new release is available before the end of March with Redis fix.

@karolpawlak
Copy link
Author

Great stuff, thanks @rama78. Well done @pivotal-david-osullivan 👏

@rama78
Copy link

rama78 commented Mar 15, 2023

@pivotal-david-osullivan - can you please update when this bug will be fixed?

anthonydahanne added a commit to anthonydahanne/java-cfenv that referenced this issue Mar 15, 2023
@anthonydahanne
Copy link
Member

@pivotal-david-osullivan - can you please update when this bug will be fixed?

in progress: #207

@rama78
Copy link

rama78 commented Mar 16, 2023

Thanks, @anthonydahanne for the update .. looking forward to a new lease!

anthonydahanne added a commit to anthonydahanne/java-cfenv that referenced this issue Mar 16, 2023
anthonydahanne added a commit to anthonydahanne/java-cfenv that referenced this issue Mar 16, 2023
* using SP2 and a SP3 based test projects; very much like: spring-cloud/spring-cloud-bindings@d3290fa
anthonydahanne added a commit to anthonydahanne/java-cfenv that referenced this issue Mar 20, 2023
anthonydahanne added a commit to anthonydahanne/java-cfenv that referenced this issue Mar 20, 2023
* using SP2 and a SP3 based test projects; very much like: spring-cloud/spring-cloud-bindings@d3290fa
anthonydahanne added a commit that referenced this issue Jun 6, 2023
anthonydahanne added a commit that referenced this issue Jun 6, 2023
* using SP2 and a SP3 based test projects; very much like: spring-cloud/spring-cloud-bindings@d3290fa
anthonydahanne added a commit that referenced this issue Jun 6, 2023
# Support for SB2 continuing on the 2.5.x branch
anthonydahanne added a commit to anthonydahanne/java-cfenv that referenced this issue Jun 7, 2023
# Support for SB3 now on main branch
anthonydahanne added a commit that referenced this issue Jul 4, 2023
anthonydahanne added a commit to anthonydahanne/java-cfenv that referenced this issue Aug 16, 2023
anthonydahanne added a commit that referenced this issue Aug 17, 2023
* Upgrade dependencies and tools
* use more recent gradle
* Upgrade Spring boot version to latest bug fix
* Close #204: Add integration tests
* using SP2 and a SP3 based test projects; very much like: spring-cloud/spring-cloud-bindings@d3290fa

* Close #204 SpringBoot2-only support on 2.5.x branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants