Bug #1067
closedEpic #913: Phase 2
Epic #1053: Client Feedbacks
Bug #1057: Phase 3 bugs
500 Internal Server Error
0%
Description
Getting 500 Internal Server Error while adding options

{
"messages": [],
"source": "Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch+d__50",
"exception": "An error occurred while saving the entity changes. See the inner exception for details.\n23503: insert or update on table "Options" violates foreign key constraint "FK_Options_OptionOperationTypes_OptionOperationTypeId"\n\nDETAIL: Detail redacted as it may contain sensitive data. Specify 'Include Error Detail' in the connection string to include this information.",
"errorId": "93991229-554b-4319-be65-d8d4335bad2e",
"supportMessage": "Provide the ErrorId 93991229-554b-4319-be65-d8d4335bad2e to the support team for further analysis.",
"statusCode": 500,
"stackTrace": " at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList1 entriesToSave, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)\n at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func4 operation, Func4 verifySucceeded, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)\n at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)\n at Billkaro.Infrastructure.Persistence.Context.BaseDbContext.SaveChangesAsync(CancellationToken cancellationToken) in C:\WorkPlace\Internal\new\billkaro\API\src\Infrastructure\Persistence\Context\BaseDbContext.cs:line 46\n at Billkaro.Infrastructure.Orbit.Option.OptionService.UpdateOptionConfigurationAsync(UpdateOptionConfigurationRequest request) in C:\WorkPlace\Internal\new\billkaro\API\src\Infrastructure\Orbit\Option\OptionService.cs:line 154\n at Billkaro.Host.Controllers.Option.OptionController.UpdateOptionConfiguration(UpdateOptionConfigurationRequest request) in C:\WorkPlace\Internal\new\billkaro\API\src\Host\Controllers\Option\OptionController.cs:line 57\n at lambda_method14861(Closure, Object)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)\n at NSwag.AspNetCore.Middlewares.SwaggerUiIndexMiddleware.Invoke(HttpContext context)\n at NSwag.AspNetCore.Middlewares.RedirectToIndexMiddleware.Invoke(HttpContext context)\n at NSwag.AspNetCore.Middlewares.OpenApiDocumentMiddleware.Invoke(HttpContext context)\n at Billkaro.Infrastructure.Middleware.ApiRequestLoggingMiddleware.InvokeAsync(HttpContext httpContext, RequestDelegate next) in C:\WorkPlace\Internal\new\billkaro\API\src\Infrastructure\Middleware\ApiRequestLoggingMiddleware.cs:line 59\n at Billkaro.Infrastructure.Middleware.ApiRequestLoggingMiddleware.InvokeAsync(HttpContext httpContext, RequestDelegate next) in C:\WorkPlace\Internal\new\billkaro\API\src\Infrastructure\Middleware\ApiRequestLoggingMiddleware.cs:line 71\n at Billkaro.Infrastructure.Middleware.ApiRequestLoggingMiddleware.InvokeAsync(HttpContext httpContext, RequestDelegate next) in C:\WorkPlace\Internal\new\billkaro\API\src\Infrastructure\Middleware\ApiRequestLoggingMiddleware.cs:line 71\n at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<b__0>d.MoveNext()\n--- End of stack trace from previous location ---\n at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)\n at Billkaro.Infrastructure.Middleware.SubscriptionAccessMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\WorkPlace\Internal\new\billkaro\API\src\Infrastructure\Middleware\SubscriptionAccessMiddleware.cs:line 78\n at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<b__0>d.MoveNext()\n--- End of stack trace from previous location ---\n at Microsoft.AspNetCore.RateLimiting.RateLimitingMiddleware.InvokeInternal(HttpContext context, EnableRateLimitingAttribute enableRateLimitingAttribute)\n at Billkaro.Infrastructure.Auth.CurrentUserMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\WorkPlace\Internal\new\billkaro\API\src\Infrastructure\Auth\CurrentUserMiddleware.cs:line 16\n at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<b__0>d.MoveNext()\n--- End of stack trace from previous location ---\n at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)\n at Billkaro.Infrastructure.Middleware.ExceptionMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\WorkPlace\Internal\new\billkaro\API\src\Infrastructure\Middleware\ExceptionMiddleware.cs:line 30"
}
Files