-
Notifications
You must be signed in to change notification settings - Fork 950
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
Jackson Errors in /env actuator if Closures defined in application.groovy #10279
Comments
Not sure if there is anything we can do about this really. The endpoint is part of Boot and the issue may need to be reported there. |
Is it possible to either workaround that in Grails somehow, or provide the required serializer (or a NOOP error serializer) for this issue? |
Will see what we can do |
On the other hand, the logic that's "polluting" the Environment with a Groovy closure is part of Grails so it could be argued that Grails should ensure that things are sanitised such that Jackson can serialise them, or that it has customised the Actuator's |
@wilkinsona Yes that could be argued. However, Grails for years has allowed richer configuration with closures to for example configure the default constraints and mapping in GORM http://gorm.grails.org/latest/hibernate/manual/index.html#_the_default_mapping_constraints This issue would also impact use of GORM standalone outside of Grails if you were to use it in Spring Boot as is now possible http://gorm.grails.org/latest/hibernate/manual/index.html#springBoot However, yes we can of course fix it only for Grails if the hook is available to do this. Configuration of GORM when using it standalone with Spring Boot would continue to be an issue. |
@wilkinsona currently we have dependency on Grails to Actuator itself. Is there a way to fix this problem without introducing a dependency on Actuator? |
I don't know, as I don't know what's required to fix the problem. I'm guessing a Jackson module might work but a bit of Googling hasn't turned up anything. If we can figure out how to fix the problem then hopefully it'll become obvious where that fix should go. |
When you define a closure in application.groovy, Jackson fails in the /env endpoint.
Steps to reproduce
Create a standard Grails 3.1.13 project, which only has the following things changed:
Stacktrace
Expected Behaviour
Actual Behaviour
Environment Information
Example Application
https://github.com/robertoschwald/grails3-actuator-jackson-error
Just run it and access /env
The text was updated successfully, but these errors were encountered: