ThreeMammals / Ocelot

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

Big Config files cause failure in IIS #1084

Closed malekmakan closed 4 years ago

malekmakan commented 4 years ago

The issue is due to size of config file, I have added couple of new rule in config and Ocelot started to complain as below:

2019-12-19 04:59:30.7319 - ERROR: Connection ID "17365880169046218111", Request ID "80001580-0001-f100-b63f-84710c7967bb": An unhandled exception was thrown by the application. EXCEPTION: System.InvalidOperationException: No writing operation. Make sure GetMemory() was called. at System.IO.Pipelines.ThrowHelper.ThrowInvalidOperationException_NotWritingNoAlloc() at System.IO.Pipelines.Pipe.DefaultPipeWriter.Advance(Int32 bytes) at System.Buffers.BuffersExtensions.Write[T](IBufferWriter'1 writer, ReadOnlySpan'1 value) at Microsoft.AspNetCore.Server.IIS.Core.OutputProducer.WriteAsync(ReadOnlyMemory'1 buffer, CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.WriteAsync(ReadOnlyMemory'1 memory, CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.IIS.Core.HttpResponseStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.IIS.Core.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 count) at Microsoft.AspNetCore.Server.IIS.Core.WrappingStream.Write(Byte[] buffer, Int32 offset, Int32 count) at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder) at System.IO.StreamWriter.Write(String value) at Microsoft.AspNetCore.Hosting.Views.ErrorPage.ExecuteAsync() at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context) at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT'1.ProcessRequestAsync()

also this might be interesting:

2019-12-19 05:14:00.4708 - ERROR: Connection ID "16717361826999831550", Request ID "80000bff-0002-e800-b63f-84710c7967bb": An unhandled exception was thrown by the application. EXCEPTION: System.OverflowException: Arithmetic operation resulted in an overflow. at System.IO.StreamWriter.Write(String value) at Microsoft.Extensions.RazorViews.BaseView.Write(String value) at Microsoft.AspNetCore.Hosting.Views.ErrorPage.ExecuteAsync() at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context) at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT'1.ProcessRequestAsync() 2019-12-19 05:14:00.4708 - ERROR: Connection ID "18230571297501347982", Request ID "8000008f-0001-fd00-b63f-84710c7967bb": An unhandled exception was thrown by the application. EXCEPTION: System.OverflowException: Arithmetic operation resulted in an overflow. at System.IO.StreamWriter.Write(String value) at Microsoft.AspNetCore.Hosting.Views.ErrorPage.ExecuteAsync() at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context) at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT'1.ProcessRequestAsync()

will breaking down the config file to multiple json files help?

I am running it on a Windows Server 2019 VM and IIS 10

Thanks

malekmakan commented 4 years ago

not a good question I am closing it...