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
Spring Boot 2.5.0 (Spring Cloud GCP 2.0.2) - spring-cloud-gcp-starter-secretmanager properties broken #490
Comments
@agrantdeakin We have not upgraded Spring Cloud GCP to Spring Boot 2.5 compatibility (#472). I'll be looking at the upgrade blockers this week. |
Yep, that's one of the issues I saw in the attempt to upgrade. |
No, sorry. I've not seen this one before. I would have thought |
Sure, I can create a reproducer if you like, though maybe the following context could help us debug it: We are registering a custom From what it looks like, this converter is not being successfully picked up in 2.5.0. Is this the right way to register a converter now? |
Bootstrap is no longer enabled by default in 2020.0 (aka ilford) https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2020.0-Release-Notes#breaking-changes |
Right, we accounted for this -- We included the |
hmm, there are multiple environments with bootstrap. So it may that the converter gets installed in the parent environment, but not the child. @philwebb how should converters be registered? |
For |
Thanks for the tip; I'll try registering the converters using this alternate way to see if it works. |
Hmm this doesn't quite work for me. I think it's because we're actually relying on the property source converters. Maybe this is different from "configuration properties". We basically need to register a converter to the converter that is used on this line in AbstractPropertyResolver. I was able to get it to work by applying this change to our code, however the puzzling thing is that this now works for spring 2.5.0 but not for 2.4.x. We could just include both methods of registering the converters 🤷♂️ Also have a reproducer here but may not be useful without a GCP account: https://github.com/dzou/secret-manager-repro But overall the idea is that we have a PropertySource that provides properties (like |
I think spring-projects/spring-boot#26088 might be relevant. We wanted to tighten the rules around I'm guessing that previously you did |
You might be able to use an |
I wonder if this Spring Boot issue might also be related spring-projects/spring-boot#26732 |
I see, thanks for the tips. I went with the This method seems to work for 2.4.x and 2.5.1-SNAPSHOT but still does not work 2.5.0. I'm not sure if it is related to the issue you linked; I didn't find the class modified on the classpath of my app. But in any case, finding a solution that works for both 2.4.x and >= 2.5.1 may be good enough. |
@dzou fyi, the problem continues to occur on spring boot @ |
We just submitted the PR that contains the fix #496. I think we will need to release a new release version 2.0.4 to contain the fix. @elefeint @meltsufin -- Could we release a new version soon to contain the fix? |
Yes, we will release next week. |
Spring Cloud GCP 2.0.4 is released on Maven Central. |
Bumps [spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 2.6.2 to 2.6.3. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](spring-projects/spring-boot@v2.6.2...v2.6.3) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-starter-parent dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Describe the bug
After upgrade to Spring Boot 2.5.0 (Spring Cloud GCP 2.0.2), secret manager property binding is broken.
...pubsub.classification-service-secret=${sm://projects/PROJECT_ID/secrets/dev-pubsub-classification-service-secret}
Caused by: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [com.google.protobuf.ByteString$LiteralByteString] to type [java.lang.String]
Sample
Stack trace:
The text was updated successfully, but these errors were encountered: