I am using Sitecore XP 9.1.1 and xCommerce 9.1. I have published code to the root but on few pages I am getting below error -
In postman, I am able to access token but on bootstrapping, I am getting error-
An error occurred while starting the application.
Exception in log file -
12492 17:23:59 ERROR Query Exception - Query:https://commerceauthoring.projectname-sc911xc91xp0.dev.local/api/Carts('Defaultbcc4d56b-54ce-469f-b2d1-3f78124bc6a8AUS2')?$expand=Lines($expand=CartLineComponents,CartSubLineComponents($expand=CartLineComponents)),Components - Message:An error occurred while processing this request. 12492 17:23:59 ERROR Failed to render rendering Exception: System.Web.HttpUnhandledException Message: An unhandled exception occurred. Source: Sitecore.Mvc at Sitecore.Mvc.Pipelines.MvcEvents.Exception.ShowAspNetErrorMessage.ShowErrorMessage(ExceptionContext exceptionContext, ExceptionArgs args) at Sitecore.Mvc.Pipelines.MvcEvents.Exception.ShowAspNetErrorMessage.Process(ExceptionArgs args) at (Object , Object ) at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) at Sitecore.Mvc.Pipelines.PipelineService.RunPipeline[TArgs](String pipelineName, TArgs args) at Sitecore.Mvc.Filters.PipelineBasedRequestFilter.OnException(ExceptionContext exceptionContext) at System.Web.Mvc.ControllerActionInvoker.InvokeExceptionFilters(ControllerContext controllerContext, IList`1 filters, Exception exception) at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) at System.Web.Mvc.Controller.ExecuteCore() at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) at Sitecore.Mvc.Controllers.ControllerRunner.ExecuteController(Controller controller) at Sitecore.Mvc.Controllers.ControllerRunner.Execute(TextWriter writer) at Sitecore.Mvc.Pipelines.Response.RenderRendering.ExecuteRenderer.Render(Renderer renderer, TextWriter writer, RenderRenderingArgs args)
Nested Exception
Exception: Microsoft.OData.Client.DataServiceQueryException
Message: An error occurred while processing this request.
Source: Sitecore.Commerce.ServiceProxy
at Sitecore.Commerce.ServiceProxy.Proxy.GetValue[T](DataServiceQuerySingle1 query)
at Sitecore.Commerce.Engine.Connect.Pipelines.Carts.CartProcessor.GetCart(String userId, String shopName, String cartId, String customerId, String currency)
at Sitecore.Commerce.Engine.Connect.Pipelines.Carts.LoadCart.Process(ServicePipelineArgs args)
at (Object , Object )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
at Sitecore.Commerce.Pipelines.PipelineService.RunPipeline[TArgs](String pipelineName, TArgs args)
at Sitecore.Commerce.Services.ServiceProvider.RunPipeline[TRequest,TResult](String pipelineName, TRequest request)
at Sitecore.Commerce.XA.Foundation.Connect.Managers.CartManager.LoadCart(IVisitorContext visitorContext, String shopName, String cartName, String customerId, Boolean recalculateTotals, StringPropertyCollection propertyBag)
at Sitecore.Commerce.XA.Foundation.Connect.Managers.CartManager.GetCurrentCart(IVisitorContext visitorContext, IStorefrontContext storefrontContext, Boolean recalculateTotals, StringPropertyCollection propertyBag)
at projectname.Feature.Store.Repositories.Store.StoreRepository.GetPreferredStore(IStorefrontContext storefrontContext, IVisitorContext visitorContext, IContext context) in C:\Projects\Azure-CI\src\Feature\Store\code\Repositories\Store\StoreRepository.cs:line 93
at projectname.Feature.Store.Controllers.SelectedStoreController.GetModel() in C:\Projects\Azure-CI\src\Feature\Store\code\Controllers\SelectedStoreController.cs:line 38
at Sitecore.XA.Foundation.Mvc.Controllers.StandardController.Index()
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary
2 parameters)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass24_0.b__0()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func
1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
Nested Exception
Exception: Microsoft.OData.Client.DataServiceClientException Message: IIS 502.5 Error
HTTP Error 502.5 - Process Failure
Common causes of this issue:- The application process failed to start
- The application process started but then stopped
- The application process started but failed to listen on the configured port
- Check the system event log for error messages
- Enable logging the application process' stdout messages
- Attach a debugger to the application process and inspect
Sitecore Commerce Engine Service Logs (Updated)
00020 12:34:00 ERROR CtxMsg.Error.EntityNotFound: Text=Core.block.LoadEnvironment.EnvironmentCouldNotBeFound: Environment=ProjectNameAuthoring
00020 12:34:00 ERROR PipelineAbort:Core.block.LoadEnvironment.EnvironmentCouldNotBeFound: Environment=ProjectNameAuthoring
00001 12:34:00 INFO Application startup exception
System.AggregateException: One or more errors occurred. ---> System.TypeInitializationException: The type initializer for 'Microsoft.AspNetCore.OData.Builder.ODataModelBuilder' threw an exception. ---> System.TypeLoadException: Could not load type 'Microsoft.OData.Edm.Library.EdmConstants' from assembly 'Microsoft.OData.Edm, Version=7.5.0.20627, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
at Microsoft.AspNetCore.OData.Builder.ODataModelBuilder..cctor()
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.OData.Builder.ODataModelBuilder..ctor()
at Microsoft.AspNetCore.OData.Builder.ODataConventionModelBuilder..ctor()
at Sitecore.Commerce.Engine.Startup.<>c__DisplayClass14_0.b__4()
at System.Threading.Tasks.Task1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task
1.GetResultCore(Boolean waitCompletionNotification)
at Sitecore.Commerce.Engine.Startup.Configure(IApplicationBuilder app, IConfigureServiceApiPipeline configureServiceApiPipeline, IStartNodePipeline startNodePipeline, IConfigureOpsServiceApiPipeline configureOpsServiceApiPipeline, IStartEnvironmentPipeline startEnvironmentPipeline, ILoggerFactory loggerFactory, IOptions1 loggingSettings, IOptions
1 applicationInsightsSettings, IOptions1 certificatesSettings, IOptions
1 allowedOriginsOptions, GetDatabaseVersionCommand getDatabaseVersionCommand)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
---> (Inner Exception #0) System.TypeInitializationException: The type initializer for 'Microsoft.AspNetCore.OData.Builder.ODataModelBuilder' threw an exception. ---> System.TypeLoadException: Could not load type 'Microsoft.OData.Edm.Library.EdmConstants' from assembly 'Microsoft.OData.Edm, Version=7.5.0.20627, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
at Microsoft.AspNetCore.OData.Builder.ODataModelBuilder..cctor()
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.OData.Builder.ODataModelBuilder..ctor()
at Microsoft.AspNetCore.OData.Builder.ODataConventionModelBuilder..ctor()
at Sitecore.Commerce.Engine.Startup.<>c__DisplayClass14_0.b__4()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()<---
00020 12:34:00 INFO Request starting HTTP/1.1 GET http://commerceauthoring.ProjectName-sc911xc91xp0.dev.local/commerceops/GetCatalogMappings(environmentName='')
00020 12:34:00 INFO Request finished in 180.5607ms 500 text/html; charset=utf-8
00067 12:54:54 INFO Request starting HTTP/1.1 POST http://127.0.0.1:22525/iisintegration 0
00067 12:54:54 INFO Request finished in 0.4942ms 500 text/html; charset=utf-8
Snap of browser console after performing steps mentioned by Shabaaz Shaikh -
Please let me know how to resolve this?