Comments (8)
Hi
Could you attach ocelot.json file and C# app startup code (configuring services etc.) please?
Also full exception call stack is desired.
But it is better to upload full app code for review.
So, please provide more information!
from ocelot.
@pseudorasbora
Is it so difficult to attach more details here?
We cannot decide having so short description!
from ocelot.
@AlyHKafoury Are you online?
from ocelot.
sorry, it's online.
ocelot.json
{
"Routes": [
{
"DownstreamPathTemplate": "/{url}",
"DownstreamScheme": "https",
"UpstreamPathTemplate": "/msgapi/{url}",
"UpstreamHttpMethod": [ "Get", "Post", "Put", "Delete" ],
"ServiceName": "MsgApi",
"LoadBalancerOptions": {
"Type": "NoLoadBalancer"
},
"RateLimitOptions": {
"EnableRateLimiting": true,
"Period": "1s",
"PeriodTimespan": 3,
"Limit": 5
},
"QoSOptions": {
"ExceptionsAllowedBeforeBreaking": 3,
"DurationOfBreak": 60000,
"TimeoutValue": 120000
},
"AuthenticationOptions": {
"AuthenticationProviderKey": "gatewayBearer",
"AllowedScopes": []
},
"DangerousAcceptAnyServerCertificateValidator": true
}
],
"GlobalConfiguration": {
"BaseUrl": "https://gtw.dev.com",
//consul
"ServiceDiscoveryProvider": {
"Scheme": "http",
"Host": "localhost",
"Port": 3123,
"Type": "Consul",
"Token": "xxxxxxxxxxxxxxxxxxxxx",
"ConfigurationKey": "ocelot"
},
"RateLimitOptions": {
"DisableRateLimitHeaders": false,
"QuotaExceededMessage": "xxxx",
"HttpStatusCode": 222,
"ClientIdHeader": "client-id"
}
}
}
startup code
services
.AddOcelot(new ConfigurationBuilder()
.AddJsonFile("ocelot.json", optional: false, reloadOnChange: true)
.Build())
.AddPolly()
.AddConsul();
logs
2024-02-25 13:57:36.917 +08:00 [WRN] requestId: 0HN1LOOV1BJ61:00000021, previousRequestId: No PreviousRequestId, message: '502 (Bad Gateway) status code, request uri: https://msgapi.dev.com:44322/messages/5705287553122309'
2024-02-25 13:58:02.718 +08:00 [WRN] requestId: 0HN1LOOV1BJ61:00000022, previousRequestId: No PreviousRequestId, message: 'DownstreamRouteFinderMiddleware setting pipeline errors. IDownstreamRouteFinder returned Error Code: UnableToFindDownstreamRouteError Message: Failed to match Route configuration for upstream path: /, verb: GET.'
2024-02-25 13:58:02.719 +08:00 [WRN] requestId: 0HN1LOOV1BJ61:00000022, previousRequestId: No PreviousRequestId, message: 'Error Code: UnableToFindDownstreamRouteError Message: Failed to match Route configuration for upstream path: /, verb: GET. errors found in ResponderMiddleware. Setting error response for request path:/, request method: GET'
2024-02-25 13:58:07.979 +08:00 [WRN] requestId: 0HN1LOOV1BJ61:00000025, previousRequestId: No PreviousRequestId, message: '502 (Bad Gateway) status code, request uri: https://msgapi.dev.com:44322/messages/5705287553122309'
2024-02-25 14:04:51.023 +08:00 [WRN] requestId: 0HN1LOUM7UL5G:00000001, previousRequestId: No PreviousRequestId, message: 'You have ignored all SSL warnings by using DangerousAcceptAnyServerCertificateValidator for this DownstreamRoute, UpstreamPathTemplate: Ocelot.Values.UpstreamPathTemplate, DownstreamPathTemplate: /{url}'
2024-02-25 14:07:06.661 +08:00 [WRN] requestId: 0HN1LOUM7UL5H:00000002, previousRequestId: No PreviousRequestId, message: '502 (Bad Gateway) status code, request uri: https://msgapi.dev.com:44322/agents/10001'
2024-02-25 14:07:19.338 +08:00 [WRN] requestId: 0HN1LOUM7UL5G:00000012, previousRequestId: No PreviousRequestId, message: 'Error Code: RequestTimedOutError Message: Timeout making http request, exception: Polly.CircuitBreaker.BrokenCircuitException`1[System.Net.Http.HttpResponseMessage]: The circuit is now open and is not allowing calls.
at Polly.CircuitBreaker.CircuitStateController`1.OnActionPreExecute()
at Polly.CircuitBreaker.AsyncCircuitBreakerEngine.ImplementationAsync[TResult](Func`3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext, ExceptionPredicates shouldHandleExceptionPredicates, ResultPredicates`1 shouldHandleResultPredicates, ICircuitController`1 breakerController)
at Polly.AsyncPolicy`1.ExecuteAsync(Func`3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext)
at Polly.AsyncPolicy`1.ExecuteAsync(Func`3 action, Context context, CancellationToken cancellationToken, Boolean continueOnCapturedContext)
at Ocelot.Provider.Polly.PollyPoliciesDelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at Ocelot.Requester.TimeoutDelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpMessageInvoker.<SendAsync>g__SendAsyncWithTelemetry|6_0(HttpMessageHandler handler, HttpRequestMessage request, CancellationToken cancellationToken)
at Ocelot.Requester.MessageInvokerHttpRequester.GetResponse(HttpContext httpContext) errors found in ResponderMiddleware. Setting error response for request path:/agents/10001, request method: GET'
from ocelot.
@ggnaegi Please consult this developer! 🙏 I expect misconfiguration issue...
I'm a bit tired of such inquiries...
from ocelot.
hi:
upgrade from 22.0.1 to 23.0.0:
it throws error "bad gateway, 502" when using method "get". methods "put/post/delete" work well.
ocelot log:
requestId: 0HM5DM6ULMR8I:00000002, previousRequestId: no previous request id, message: Error Code: UnableToFindDownstreamRouteError Message: Failed to match Route configuration for upstream path: /api/xxx, verb: GET. errors found in ResponderMiddleware. Setting error response for request path:/api/xxx, request method: GETnow it works after rollback to 22.0.1.
thanks!
Hello @pseudorasbora a lot of new features and changes were introduced in the release 23. We are going to release 23.1 next week. Could you try the new release first (a bug with the request content has been addressed)? If the issue persist, we will try to find a solution with you.
Thanks!
from ocelot.
release 23.1
hi,
it worked well after upgrading to release 23.1 .
thanks for ur help!
from ocelot.
@ggnaegi Please consult this developer! 🙏 I expect misconfiguration issue... I'm a bit tired of such inquiries...
thanks for ur help!
from ocelot.
Related Issues (20)
- 在使用异步流返回时,并不是实时刷新逐条返回结果,而是一次返回结果 HOT 10
- How to Authorize with nested JWT claim generated from Keycloak
- Access to the path '/app/ocelot.json' is denied HOT 1
- Ocelot is missing NuGet package README file HOT 3
- Kubernetes provider should identify different ports HOT 14
- FTP is raising Exception of Timeout but working in FileZilla and WinSCP HOT 3
- Rate Limiting issues in Ocelot HOT 6
- Ocelot Downstream Request Timeout HOT 5
- How to find servicename on PreAuthorizationMiddleware HOT 1
- Proposal to add ExtraProps to the configuration HOT 5
- Regression at DownstreamUrlCreatorMiddleware HOT 7
- Enhancing Ocelot to Automatically Forward Claims from IdentityServer's Introspection Endpoint to Backend Services HOT 1
- how to document rate limit in swagger HOT 1
- Release 23.2: UpstreamPathTemplate doesn't contain the same placeholders in DownstreamPathTemplate HOT 12
- Long duration of CircleCI builds HOT 1
- Map response of rate limit quota into exception
- On the fly `ocelot.json` configuration merging HOT 1
- Body cannot be forwarded twice on Aggregator HOT 17
- 当下游服务返回"text/plain"类型时导致"response.Body"中变得异常得长,这正常吗?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ocelot.