ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.28k stars 1.63k forks source link

Routes containing attribute "UpstreamHost " cannot be found #1926

Closed nrllhylmz closed 7 months ago

nrllhylmz commented 7 months ago

Hi,

My routes worked fine for ocelot 18.0.0 But it didn't work for ocelot 22.0.1

warn: Ocelot.DownstreamRouteFinder.Middleware.DownstreamRouteFinderMiddleware[0]
      requestId: 0HN0N5ETGHV6K:00000001, previousRequestId: No PreviousRequestId, message: 'DownstreamRouteFinderMiddleware setting pipeline errors. IDownstreamRouteFinder returned Error Code: UnableToFindDownstreamRouteError Message: Failed to match Route configuration for upstream path: /test/WeatherForecast, verb: GET.'
warn: Ocelot.Responder.Middleware.ResponderMiddleware[0]
      requestId: 0HN0N5ETGHV6K:00000001, previousRequestId: No PreviousRequestId, message: 'Error Code: UnableToFindDownstreamRouteError Message: Failed to match Route configuration for upstream path: /test/WeatherForecast, verb: GET. errors found in ResponderMiddleware. Setting error response for request path:/test/WeatherForecast, request method: GET'

Sample project link for you to try: https://github.com/nrllhylmz/Example Sample project's details: https://github.com/ThreeMammals/Ocelot/issues/1925#issuecomment-1894553655

Thanks

raman-m commented 7 months ago

@ks1990cn Hello Tanmay! How do you do? Please help us to reproduce this "bug"! 🙏 What I see now, is a misconfiguration issue... Also, attached solution is learning one, and it has no Docker Compose setup and it will be hard to reproduce juggling multiple Visual Studio debug sessions for each service instance... 😄 But possible to juggle multiple console apps and start each service in separate console using self-hosted scenarios.