equinor / witsml-explorer

Witsml Explorer data management tool.
Apache License 2.0
45 stars 50 forks source link

Large log data download bugšŸ› #2496

Open eliasbruvik opened 2 months ago

eliasbruvik commented 2 months ago

When I try to download the log data of a very large log, I end up with this error:

Something went wrong: System.ArgumentException: The JSON value of length 225820511 is too large and not supported.
   at System.Text.Json.ThrowHelper.ThrowArgumentException_ValueTooLarge(Int64 tokenLength)
   at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
   at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.GetMemberAndWriteJson(Object obj, WriteStack& state, Utf8JsonWriter writer)
   at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, WriteStack& state)
   at System.Text.Json.Serialization.JsonConverter`1.TryWrite(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
   at System.Text.Json.Serialization.JsonConverter`1.WriteCore(Utf8JsonWriter writer, T& value, JsonSerializerOptions options, WriteStack& state)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(Stream utf8Json, T rootValue, CancellationToken cancellationToken, Object rootValueBoxed)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(Stream utf8Json, T rootValue, CancellationToken cancellationToken, Object rootValueBoxed)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(Stream utf8Json, T rootValue, CancellationToken cancellationToken, Object rootValueBoxed)
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.SerializeAsync(Stream utf8Json, T rootValue, CancellationToken cancellationToken, Object rootValueBoxed)
   at Microsoft.AspNetCore.Http.HttpResponseJsonExtensions.WriteAsJsonAsyncSlow[TValue](Stream body, TValue value, JsonSerializerOptions options, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Http.RequestDelegateFactory.ExecuteResultWriteResponse(IResult result, HttpContext httpContext)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at WitsmlExplorer.Api.Middleware.LoggingMiddleware.InvokeAsync(HttpContext context) in C:\Users\EBRUV\Projects\witsml-explorer\Src\WitsmlExplorer.Api\Middleware\LoggingMiddleware.cs:line 40
   at UrlDecodeMiddleware.InvokeAsync(HttpContext context) in C:\Users\EBRUV\Projects\witsml-explorer\Src\WitsmlExplorer.Api\Middleware\UrlDecodeMiddleware.cs:line 33
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at WitsmlExplorer.Api.Middleware.ExceptionMiddleware.InvokeAsync(HttpContext httpContext) in C:\Users\EBRUV\Projects\witsml-explorer\Src\WitsmlExplorer.Api\Middleware\ExceptionMiddleware.cs:line 34

The job completed without problems, but the error occured before the download from the API to the frontend was complete (As seen by the progress under network in devtools).

As discussed in a meeting, this should be solved if it only includes a quick fix like increasing the allowed max size. If it turns out to be more complex, we should return a proper error message instead.