-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
bug with accessing RestController endpoints due to #35426 ? #43885
Comments
Thanks for the report. Unfortunately, I don't think I understand the problem as currently described. Your snippet shows the use of Also, please note that Spring Boot 3.2.x is no longer supported. Any sample that you share with us should use 3.3.7 or 3.4.1 to demonstrate the problem. |
this, precisely.
Sure thing. Gimme a sec.
Sure, no problemo, as this problem also affects 3.4.1; basically, everything higher than 3.2.1 or 3.1.7 (including >=3.1.8+, >=3.2.2, >=3.3.0 and >= 3.4.0) is affected. |
spring-boot-actuator-vs-restcontroller-problem-43885-main.zip Here you go mate :) Ping me if anything else is missing, but I guess this is as MCVE as it gets :) |
Thank you. The problem's occurring because there's a clash at the path level between the mappings for the health endpoint and the mapping for your
The combination of a patch match and a method mismatch is detected in I'd like to discuss this with the rest of the team as web request matching is a complex area. I may well be overlooking a risk in overriding |
Impossible for me to say if this is a bug or a feature/documented change, hence the ticket. Facts:
test snippets:
results for 3.2.1:
results for 3.2.2:
Further details:
health
from/
to e.g./foo
"fixes" the behaviour (i.e. the endpoints start to work again)base-path
to anything else than/
(e.g./foo
) in this case triggers:Ambiguous mapping. Cannot map 'Actuator root web endpoint' method Actuator root web endpoint to {GET [/foo], produces [application/vnd.spring-boot.actuator.v3+json || application/vnd.spring-boot.actuator.v2+json || application/json]}: There is already 'Actuator web endpoint 'health'' bean method
My take on it is:
base-path
and at least one of the mappings equal to/
) is deemed invalid, it should throw an exception during bean init for this particular case, like the case with non-/
base and/
endpoint. However, the valid use case for this was hiding the "root" actuator endpoint AFAIK.With all honesty, I'd say this is a bug, mainly due to backwards-compatibility reasons. The code in question did work in previous patches in the same major/minor release (AFAIK both 3.2 and 3.1 are affected in this way), and a patch shouldn't introduce breaking changes that ain't backwards-compatible even if they are just fixing some abuses or corner cases (and the code shown isn't even really one of those I'd argue). If it would introduced purely with a minor increase and clearly documented, only the lack of exception thrown would be a problem here.
The text was updated successfully, but these errors were encountered: