2

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 -

enter image description here

In postman, I am able to access token but on bootstrapping, I am getting error-

An error occurred while starting the application.

enter image description here

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, IDictionary2 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, Func1 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
Troubleshooting steps:
  • Check the system event log for error messages
  • Enable logging the application process' stdout messages
  • Attach a debugger to the application process and inspect
For more information visit: https://go.microsoft.com/fwlink/?LinkID=808681 Source: Microsoft.OData.Client at Microsoft.OData.Client.BaseAsyncResult.EndExecute[T](Object source, String method, IAsyncResult asyncResult) at Microsoft.OData.Client.QueryResult.EndExecuteQuery[TElement](Object source, String method, IAsyncResult asyncResult)

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.Task1.GetResultCore(Boolean waitCompletionNotification) at Sitecore.Commerce.Engine.Startup.Configure(IApplicationBuilder app, IConfigureServiceApiPipeline configureServiceApiPipeline, IStartNodePipeline startNodePipeline, IConfigureOpsServiceApiPipeline configureOpsServiceApiPipeline, IStartEnvironmentPipeline startEnvironmentPipeline, ILoggerFactory loggerFactory, IOptions1 loggingSettings, IOptions1 applicationInsightsSettings, IOptions1 certificatesSettings, IOptions1 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 - enter image description here

Please let me know how to resolve this?

6
  • Can you check IIS logs? Commented Sep 5, 2019 at 11:26
  • Also check logs of your commerce engine service Commented Sep 5, 2019 at 11:32
  • @HimanshuAgarwal I have edited the question to add instance logs. I do not have read permissions for iis logs.
    – NewbieHere
    Commented Sep 5, 2019 at 12:01
  • @VipinBanka I have edited the question to add instance logs
    – NewbieHere
    Commented Sep 5, 2019 at 12:01
  • @NidhiVaishnava you have added the logs from Sitecore instance, add the logs from Commerce Engine service as well. Commented Sep 5, 2019 at 12:22

2 Answers 2

2

I Was facing the same 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 Troubleshooting steps: Check the system event log for error messages Enable logging the application process' stdout messages Attach a debugger to the application process and inspect

" For me the issue was that my license was expired. So I had replaced it in the siteroot/appdata and site was up but the commerce section was still not working.

The following are the places that we need to replace the license file.

enter image description here

But if the application license is correct. Then the application (business) is unable to connect to the database. please check the logs.

Solution :

Here is where you need to update the details of your database in the following files
i.e.

  1. Global.json : commerce Proj\src\Project\HabitatHome\engine\wwwroot\bootstrap
  2. Plugin.SQL.PolicySet-1.0.0.json : commerce Proj\src\Project\HabitatHome\engine\wwwroot\data\Environments

or if you have already deployed then : in all the copies of the above 2 files located in folders related to commerce i.e.:

**CommerceAuthoring_suffix

CommerceMinions_suffix

CommerceOps_suffix

CommerceShops_suffix**

enter image description here

enter image description here

7
  • First, I checked the licenses. License files at xconnect were invalid. So I changed the licenses. But it didnt work. Then I tried the second option of changing the databases in all 8 config files. Now, when I hit projectname.dev.local/sitecore/login, it keeps on loading but the errors in event viewer is gone. Thanks for resolving the error. But do you have any solution for this loading issue?
    – NewbieHere
    Commented Sep 6, 2019 at 6:54
  • can you please post a snap of the console of the browser Commented Sep 6, 2019 at 7:00
  • Added in question, please check.
    – NewbieHere
    Commented Sep 6, 2019 at 7:08
  • Don't worry it may take some time initially, you can try resetting IIS and then reload the site. In the mean time you can have your lunch. :) Commented Sep 6, 2019 at 7:13
  • It kept loading, so I checked the logs of commerce authoring, it had an exception that I have added in question.
    – NewbieHere
    Commented Sep 6, 2019 at 8:42
0

Thank you all for your helpful comments and suggestions.The error is resolved now. I reverted all the changes that I made to the Authoring, Shops, Ops and Minions roles. Build and deployed fresh assemblies and changed the database server names in all 8 config files as suggested in previous answer. Afer this, I ran the instance again and it threw a different exception of Certificate matching. To resolve this, I took help of this blog - http://andrewsutherland.azurewebsites.net/2018/07/01/valid-certificate-thumbprint-not-matching-in-sitecore-experience-commerce-9/ And now the page is working again!

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.