Giter VIP home page Giter VIP logo

Comments (8)

raman-m avatar raman-m commented on June 7, 2024

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.

raman-m avatar raman-m commented on June 7, 2024

@pseudorasbora
Is it so difficult to attach more details here?
We cannot decide having so short description!

from ocelot.

raman-m avatar raman-m commented on June 7, 2024

@AlyHKafoury Are you online?

from ocelot.

pseudorasbora avatar pseudorasbora commented on June 7, 2024

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.

raman-m avatar raman-m commented on June 7, 2024

@ggnaegi Please consult this developer! 🙏 I expect misconfiguration issue...
I'm a bit tired of such inquiries...

from ocelot.

ggnaegi avatar ggnaegi commented on June 7, 2024

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: GET

now 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.

⚠️ Could you maybe change Ocelot log level and provide us more verbose logs?

Thanks!

from ocelot.

pseudorasbora avatar pseudorasbora commented on June 7, 2024

release 23.1

hi,
it worked well after upgrading to release 23.1 .
thanks for ur help!

from ocelot.

pseudorasbora avatar pseudorasbora commented on June 7, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.