-
Notifications
You must be signed in to change notification settings - Fork 32
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
Enhance troubleshooting support #74
Comments
Testing with the ... fails with apparently missing postgresql driver
Likely would need to rebuild the image with paketo buildpacks and a postgres profile ? |
when adding the TRACE=true environment variable, other relevant traces get displayed but did not yet help me diagnose nor fix the issue
|
Finally, the root cause of my issue was that the K8S binding secret was missing the Reading the documentation at
As a result, the Defining an empty I think it would much help to add a debug trace in spring-cloud-bindings which lists the keys being inserted into the PropertySource, potentially omitting the values for security reasons. |
@gberche-orange Thanks for reaching out. Glad you were able to resolve the issue. I'm a little surprised that it required all of those properties to be set. I could possibly see it just filling in an empty value if it's not present. What's more surprising is that if they are not all set it just quietly skips the operation. I really believe that if you're going to require those fields you should at least pop up some sort of warning, or probably more appropriate fail. That said, I'm pretty sure this is the code that enforces that requirement. I'll drop a quick PR in to update the README to indicate it's all or none for the JDBC URLs. Beyond that, I totally agree that we can do better with logging and debugging. I'll leave this issue open as a feature request to log the property keys at debug level & to log the length of the property value. That should give a clue about what's set but not leak the value. Does that seem reasonable? |
Thanks @dmikusa-pivotal for looking into this issue. Your proposant of doc update and more friendly logging seems good to me ! |
If allowing the mapping to generate a JDBC/R2DBC URL then all three of the fields are required, the host, port and database. If even one is not set, the information will not be mapped and the default value for the property will be used. Reference: #74 Signed-off-by: Daniel Mikusa <[email protected]>
If allowing the mapping to generate a JDBC/R2DBC URL then all three of the fields are required, the host, port and database. If even one is not set, the information will not be mapped and the default value for the property will be used. Reference: #74 Signed-off-by: Daniel Mikusa <[email protected]>
If allowing the mapping to generate a JDBC/R2DBC URL then all three of the fields are required, the host, port and database. If even one is not set, the information will not be mapped and the default value for the property will be used. Reference: #74 Signed-off-by: Daniel Mikusa <[email protected]>
As a springboot developer, in order to fix misconfigurations, I need to be able to troubleshoot when servicebinding fail to be injected
In this particular case, a K8S binding seems properly detected and injected, but the driver seems to not notice it and still be using the default datasource constructed from https://github.com/spring-projects/spring-petclinic/blob/3f8468432d86dcbd0cf4372e93e06d2f47aed26a/src/main/resources/application-postgres.properties#L1-L6
observed behavior
given a petclinic deployment from image
quay.io/service-binding/spring-petclinic:latest
with logging enabledand an injected secret by https://github.com/redhat-developer/service-binding-operator
I see the following debug traces showing a
binding-specific PropertySource from Kubernetes Service Bindings
was created, but still the driver trying to connect tolocalhost:5432
whereas the binding IP address is 10.69.0.34And the container exits immediately after springboot failed start, preventing manual inspection of the mounted bindings
After transiently adding the following command to the petclinic deployment
And ssh into the container and run the following commands
bash
The text was updated successfully, but these errors were encountered: