23.2.2
Hotfix release (version 23.2.2) for #2031 issue
Route path template placeholders and their validation rules
Special thanks to Guillaume Gnaegi and Fabrizio Mancin!
About
The bug is related to the Placeholders feature in Configuration and Routing.
The bug was introduced in version 23.2.0 as a part of PR #1927.
Breaking Change
The new validation rules of the FileConfigurationFluentValidator
class do not allow the Ocelot app to start when implicit placeholders are defined in custom implementations, such as middlewares, delegating handlers, and replaced services in the dependency injection (DI) container.
These new rules are capable of validating explicit placeholders only within the UpstreamPathTemplate
and DownstreamPathTemplate
properties. Unfortunately, they cannot oversee implicit placeholders in custom implementations, and they do not validate early during the Ocelot app startup process.
Ensure that you avoid using version 23.2.0. If you are currently on that version, upgrade to version 23.2.2 by applying this hotfix patch.
Technical info
With version 23.2.0, particularly if you have overridden certain service classes or implemented custom logic that manipulates placeholders, you may encounter Ocelot app crashes accompanied by the following errors in the log:
One or more errors occurred. (Unable to start Ocelot, errors are: XXX)
where XXX
are the following validation error messages:
UpstreamPathTemplate 'UUU' doesn't contain the same placeholders in DownstreamPathTemplate 'DDD'
DownstreamPathTemplate 'DDD' doesn't contain the same placeholders in UpstreamPathTemplate 'UUU'
Finally, the validation rules resulted from the incorrect assumption that placeholders are always explicit and can be validated early. Therefore, custom implementations and feature services in the dependency injection (DI) container, which rely on or manipulate placeholders, should validate the configuration JSON and appropriate options later, directly within their service implementations.
Bug Artifacts
- Released in version: 23.2.0
- Introduced in: PR #1927
- Reported bug: #2031 by @ggnaegi and tested by @Fabman08
- Hotfix PR: #2032 by @raman-m
Features in Release 23.2.2
2ded872 by Raman Maksimchuk on Friday, April 05 at 15:13 →
Release 23.2.1-2 artifacts | +semver: patch
14c6d82 by Raman Maksimchuk on Friday, April 05 at 12:57 →
#2031 Don't validate placeholders in templates (#2032)
d1855cb by Raman Maksimchuk on Thursday, April 04 at 00:17 →
#1673 #1672 Update Docker for CircleCI builds (#2030)