Closed vikasgupta1456 closed 2 months ago
Thanks @vikasgupta1456 for your feedback, let us check that and come back to you.
@vikasgupta1456
Could you please share the entire JSON content of your ocelot.json
file? It would be helpful to see the GlobalConfiguration
section as well. However, it's best to copy and paste the entire file content here.
An error in the method at Ocelot.LoadBalancer.LoadBalancers.LoadBalancerHouse.Get(DownstreamRoute route, ServiceProviderConfiguration config);
suggests there may be an issue with the ServiceProviderConfiguration config
argument. It's possible that the ServiceProviderConfiguration.Type
is not recognized. Additionally, the definition of "ServiceName": "myapp"
within the route indicates that the application setup utilizes service discovery.
@vikasgupta1456
I am trying to upgrade to latest version of ocelot (23.2.2). But when I am hitting one of my endpoint, I get an error. This works until 23.1.0. which means '23.2.0' also has the same issue. Can you let me know what changed ?
The response and potential solutions depend on the type of service discovery provided. In the Hornussen release, v23.1.0, the Load Balancer was updated 👇
However, it seems your issue may be related to a Global Configuration problem. It's worth considering if PR #1944 might have introduced a bug.
This is my ocelot.json
file
{
"Routes": [
{
"ChangeDownstreamPathTemplate": {},
"DelegatingHandlers": [],
"DownstreamHeaderTransform": {},
"DownstreamHostAndPorts": [],
"DownstreamHttpMethod": null,
"DownstreamHttpVersion": null,
"DownstreamPathTemplate": "/{catchAll}",
"DownstreamScheme": "https",
"FileCacheOptions": {
"TtlSeconds": 0,
"Region": "",
"Header": null
},
"HttpHandlerOptions": {
"AllowAutoRedirect": false,
"MaxConnectionsPerServer": 2127483647,
"UseCookieContainer": false,
"UseProxy": true,
"UseTracing": false,
"PooledConnectionLifetimeSeconds": null
},
"Key": null,
"LoadBalancerOptions": {
"Expiry": 2127483647,
"Key": "",
"Type": "LeastConnection"
},
"Priority": 1,
"QoSOptions": {
"DurationOfBreak": 1,
"ExceptionsAllowedBeforeBreaking": 0,
"TimeoutValue": 0
},
"RateLimitOptions": {
"ClientWhitelist": [],
"EnableRateLimiting": false,
"Period": null,
"PeriodTimespan": 0.0,
"Limit": 0
},
"RequestIdKey": null,
"RouteClaimsRequirement": {},
"RouteIsCaseSensitive": false,
"SecurityOptions": {
"IPAllowedList": [],
"IPBlockedList": [],
"ExcludeAllowedFromBlocked": false
},
"ServiceName": "myapp",
"ServiceNamespace": null,
"Timeout": 0,
"UpstreamHeaderTransform": {},
"UpstreamHost": null,
"UpstreamHttpMethod": [],
"UpstreamPathTemplate": "/document/read/{catchAll}"
}
],
"GlobalConfiguration": {
"RequestIdKey": null,
"ServiceDiscoveryProvider": {
"Scheme": null,
"Host": null,
"Port": 0,
"Type": null,
"Token": null,
"ConfigurationKey": null,
"PollingInterval": 0,
"Namespace": null
},
"RateLimitOptions": {
"ClientIdHeader": "ClientId",
"QuotaExceededMessage": null,
"RateLimitCounterPrefix": "ocelot",
"DisableRateLimitHeaders": false,
"HttpStatusCode": 429
},
"QoSOptions": {
"DurationOfBreak": 1,
"ExceptionsAllowedBeforeBreaking": 0,
"TimeoutValue": 0
},
"BaseUrl": null,
"LoadBalancerOptions": {
"Expiry": 2127483647,
"Key": "",
"Type": ""
},
"DownstreamScheme": null,
"HttpHandlerOptions": {
"AllowAutoRedirect": false,
"MaxConnectionsPerServer": 2127483647,
"UseCookieContainer": false,
"UseProxy": true,
"UseTracing": false,
"PooledConnectionLifetimeSeconds": null
},
"DownstreamHttpVersion": null
}
@vikasgupta1456 Did you read my recommendations above?
{
"Routes": [
{
"DownstreamPathTemplate": "/{catchAll}",
"DownstreamScheme": "https",
"Key": null,
"LoadBalancerOptions": {
"Type": "LeastConnection"
},
"ServiceName": "myapp", // This property requires to setup service discovery options in GlobalConfiguration
"ServiceNamespace": null,
"UpstreamPathTemplate": "/document/read/{catchAll}"
}
],
"GlobalConfiguration": {
"ServiceDiscoveryProvider": {
"Scheme": null,
"Host": null,
"Port": 0,
"Type": null, // Developer must provide the type of service discovery provider: Consul, Kube, Eureka etc.!
"Token": null,
"ConfigurationKey": null,
"PollingInterval": 0,
"Namespace": null
},
}
Read Service Discovery docs! Good luck in development!
I am trying to upgrade to latest version of ocelot (23.2.2). But when I am hitting one of my endpoint, I get an error. This works until 23.1.0. which means '23.2.0' also has the same issue. Can you let me know what changed ?
I have routing like this:
And getting this error :