Skip to content

Unable to launch the landing page, getting 500 error #35

@ak-anon

Description

@ak-anon

Hi,

We were using the landing page codebase from this repo for our Azure marketplace offering. Since past couple of month, we are having an issue where we get 500 error code when landing page is launched from Azure portal after subscription.

After debugging the logs, we found following errors:

2024-06-27 16:48:04.546 +00:00 [Error] Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer: Connection ID "18374686480476930538", Request ID "400001eb-0000-ff00-b63f-84710c7967bb": An unhandled exception was thrown by the application. System.InvalidOperationException: The exception handler configured on ExceptionHandlerOptions produced a 404 status response. This InvalidOperationException containing the original exception was thrown since this is often due to a misconfigured ExceptionHandlingPath. If the exception handler is expected to return 404 status responses then set AllowStatusCode404Response to true. ---> System.ArgumentOutOfRangeException: Unknown TermUnitEnum value. (Parameter 'value') Actual value was P3Y. at Microsoft.Marketplace.SaaS.Models.TermUnitEnumExtensions.ToTermUnitEnum(String value) at Microsoft.Marketplace.SaaS.Models.RecurrentBillingTerm.DeserializeRecurrentBillingTerm(JsonElement element) at Microsoft.Marketplace.SaaS.Models.PlanComponents.DeserializePlanComponents(JsonElement element) at Microsoft.Marketplace.SaaS.Models.Plan.DeserializePlan(JsonElement element) at Microsoft.Marketplace.SaaS.Models.SubscriptionPlans.DeserializeSubscriptionPlans(JsonElement element) at Microsoft.Marketplace.SaaS.FulfillmentOperationsRestClient.ListAvailablePlansAsync(Guid subscriptionId, Nullable1 requestId, Nullable1 correlationId, CancellationToken cancellationToken) at Microsoft.Marketplace.SaaS.FulfillmentOperations.ListAvailablePlansAsync(Guid subscriptionId, Nullable1 requestId, Nullable1 correlationId, CancellationToken cancellationToken) at LandingPage.Controllers.HomeController.IndexAsync(String token, CancellationToken cancellationToken) in C:\Users\admin\Downloads\mtm-labs-main\mtm-labs-main\saas\lab-code\begin\LandingPage\Controllers\HomeController.cs:line 52 at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Logged|12_1(ControllerActionInvoker invoker) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task) --- End of inner exception stack trace --- at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.HandleException(HttpContext context, ExceptionDispatchInfo edi) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task) at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT1.ProcessRequestAsync()
`

The error points towards line no. 52 in HomeController class. see the code here

It seems to us that there has been some change in the _marketplaceSaaSClient.Fulfillment.ListAvailablePlansAsync() method execution on the Microsoft side.

Please let us know how to resolve this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions