-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArgumentOutOfRangeException #673
Comments
@ogomaemmanuel can you copy the full output of your |
Stack trace would be helpful |
I've just gotten the same error. Here's the full exception details:
This was triggered after updating a K8S configmap and restarting the pod (POSTing to the administration API didn't trigger it; in fact it didn't seem to do anything despite returning a 200 response). There doesn't appear to be anything wrong with the config. (I can't post it here because it's 2000 lines long and contains internal stuff.) Edit: Fixed. In my case it was caused by reusing catch-alls, e.g. "/foo/{everything}/bar/{everything}". This is the same issue as #683 . |
Outdated issue ❗You have the right to reopen this issue in the future if you come with a PR ready |
Expected Behavior / New Feature
Actual Behavior / Motivation for New Feature
I keep getting argumentoutofrange exception in the newer version of Ocelot while using asp net core 2.1. Ealier version of the eg 5.3.0 with asp net core 2.0 have no problems, I need to use the websocket feature added on version greater than 9
Program.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Ocelot.DependencyInjection;
using Ocelot.Middleware;
namespace ShoppingCartApiGateWay
{
public class Program
{
public static void Main(string[] args)
{
new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.ConfigureAppConfiguration((hostingContext, config) =>
{
config
.SetBasePath(hostingContext.HostingEnvironment.ContentRootPath)
.AddJsonFile("appsettings.json", true, true)
.AddJsonFile($"appsettings.{hostingContext.HostingEnvironment.EnvironmentName}.json", true, true)
.AddJsonFile("ocelot.json")
.AddEnvironmentVariables();
})
.ConfigureServices(s => {
s.AddOcelot();
})
.ConfigureLogging((hostingContext, logging) =>
{
//add your logging
})
// .UseIISIntegration()
.Configure(app =>
{
app.UseOcelot().Wait();
})
.Build()
.Run();
}
}
}
Ocelot.json
{
"ReRoutes": [
//Basket reroutes config
{
"DownstreamPathTemplate": "/api/Basket",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "basketservice",
"Port": 80
}
],
"UpstreamPathTemplate": "/api/Basket",
"UpstreamHttpMethod": [ "Options", "Delete", "Post", "Get" ]
],
"Aggregates": [
{
"ReRouteKeys": [
"paymentMethods",
"shipmentMethods"
],
"UpstreamPathTemplate": "/CheckoutOption"
}
],
"GlobalConfiguration": {}
}
The text was updated successfully, but these errors were encountered: