Troubleshooting: Must Gather information for Page Composer

This document provides the steps to address problems related to the Page Composer.

Problem

While working on the Page Composer, shoppers can encounter the following errors:
  1. The assigned layout to the store pages is not visible on the storefront.
  2. Content is missing on the storefront.
  3. Widgets are missing on the storefront.

Pre-requisites

  • The page layout configuration is enabled for your headless store.
    INSERT INTO STORECONF (STOREENT_ID ,NAME ,VALUE ,OPTCOUNTER ) VALUES (12345,'hcl.pageLayoutTool.enabled','true',1)
  • If the Pages and Layouts support the Storefront asset store (SAS) model, ensure to update the following entry to the STORECONF table:
    INSERT INTO STORECONF (STOREENT_ID ,NAME ,VALUE ,OPTCOUNTER ) VALUES (12347,'hcl.pageLayoutTool.sas.enabled','true',1)
    See Enabling the Storefront Asset Store support for more information.

The flow of layout and widget information

When the shopper invokes any URL on the storefront, such as https://Hostname/Store/home, the logic invokes URL API from the Query Server to get layout details, as shown in the example below:
https://QUERY-SERVICE-HOST:PORT/search/resources/api/v2/urls?storeId={StoreId}&langId=-1&identifier={Your Home keyword Identifier}
The URL service endpoint of Query Service returns the layout details associated with the keyword to fetch the details for the content page layout. The query service URL endpoint internally calls to TS-APP ( /page_design api ) to get the layout details.​

The layout details section provides the URL service response that containing the details of SPA widgets.

Figure 1. Page Design API

See GIT Reference where Query Server invokes Transaction server page design API for more information.

Procedure

To address the problems encountered while using Page Composer, follow the steps given below:
  • Configure the following trace strings in the Transaction server Docker container:
    *=info:com.ibm.commerce.rest.*=all:com.ibm.commerce.foundation.logging.ServiceLogger=finest:com.ibm.commerce.pagelayout.*=all
  • The ‘com.ibm.commerce.pagelayout.*=all’ is for a PRODUCTION environment and should be avoided at peak traffic hours.
  • Run the following database queries to collect the necessary information from your database (output results in the .CSV format):
    select * from PLWIDGET
    select * from PLWIDGETDEF
    select * from PLWIDGETDEFDESC
    select * from PAGELAYOUT
    select * from PLWIDGETNVP
    select * from PLWIDGETREL
    select * from PLWIDGETSLOT
    select * from PLLOCATION
    select * from PLTEMPLATEREL
    
  • Execute the following query REST request with an additional header "X-Log-Level=TRACE":
    https://QUERY-SERVICE-HOST:PORT/search/resources/api/v2/urls?storeId={StoreId}&langId=-1&identifier={Your Home keyword Identifier}
    Note: Do not add this to your REST request through a URL parameter.
  • Collect all the trace files generated at the /app/ESQueryService/logs/ ​query service location.

What to do next

The following example helps to understand the process:
  • To validate the layout assigned to the Home Page of the Emerald store, assume that the shopper is hitting the Emerald Store Home Page link https://HOST:PORT/Emerald/ to display the home page layout assigned to the Home Page of the Emerald Store.
  • As shown in the image above, the flow starts with the URL API call to the query server. Start with the query service traces and verify that SearchV2ContentPageQueryPostProcessor is invoking the page_design API call to the Transaction Server.
    2023-11-15T06:02:20.233Z [Default Executor-thread-268366] [7301565262347699376] TRACE c.h.c.s.i.e.p.SearchV2ContentPageQueryPostProcessor.getLayoutDetails:119 - ENTRY
    . . .
    2023-11-15T06:02:20.234Z [Default Executor-thread-268366] [7301565262347699376] TRACE c.h.c.s.i.util.RemoteRestCallHelper.issueRESTServiceRequest:228 - ENTRY
    2023-11-15T06:02:20.234Z [Default Executor-thread-268366] [7301565262347699376] TRACE c.h.c.s.i.util.RemoteRestCallHelper.issueRESTServiceRequest:272 - Final URL: https://app:5443/wcs/resources/store/11/page_design?identifier=home&q=byObjectIdentifier&catalogId=11501&deviceClass=Desktop&pageGroup=Content&objectIdentifier=1001&storeId=11&langId=-1
    
  • From the transaction server traces, look for the service call to page_design API and verify the parameters.
    [11/14/23 18:37:57:702 GMT] 0000010f ServiceLogger 2   REST <https://search:5443/wcs/resources/store/11/page_design> <user:1003> <method:GET> <identifier=home&q=byObjectIdentifier&catalogId=11501&deviceClass=Desktop&pageGroup=Content&objectIdentifier=1001&storeId=11>  ENTRY
  • This API Invokes the PageDesign handler with criteria byObjectIdentifier passing the storeId value of 11.
    [11/14/23 18:37:57:993 GMT] 0000010f PageDesignHan > com.ibm.commerce.rest.pagelayout.handler.PageDesignHandler queryPageDesign(String storeId, String queryName) ENTRY 11 byObjectIdentifier
    . . .
    [11/14/23 18:37:58:009 GMT] 0000010f PageDesignHan > com.ibm.commerce.rest.pagelayout.handler.PageDesignHandler getPageDesign(ExpressionType expression, String storeId, String profileName, boolean single) ENTRY com.ibm.commerce.oagis9.datatypes.impl.ExpressionTypeImpl@2f862727 (value: {storeId='11';identifier='home';q='byObjectIdentifier';catalogId='11501';_wcf.ap=IBM_Store_Details;_pgl.evalStrategy=IBM_DEPTH_FIRST}/PageDesign[(ObjectIdentifier='1001') and @deviceClass='Desktop' and @pageGroup='Content'], expressionLanguage: _wcf:XPath) 11 IBM_Store_Details true
    [11/14/23 18:37:58:016 GMT] 0000010f AbstractPageL > com.ibm.commerce.pagelayout.facade.client.AbstractPageLayoutFacadeClient getPageDesign(GetType) ENTRY 
    
  • The API invokes the class FetchPageDesignCmdImpl resolves and evaluates the winning layout. Look for evaluateWinningLayout and The winning layoutId in the traces.
    [11/14/23 18:37:58:272 GMT] 0000010f FetchPageDesi > com.ibm.commerce.pagelayout.facade.server.commands.FetchPageDesignCmdImpl FetchPageDesignCmdImpl() ENTRY
    . . .
    [11/14/23 18:37:58:274 GMT] 0000010f FetchPageDesi > com.ibm.commerce.pagelayout.facade.server.commands.FetchPageDesignCmdImpl evaluateWinningLayout(PageDesignType pageDesign) ENTRY com.ibm.commerce.pagelayout.facade.datatypes.impl.PageDesignTypeImpl@22b8131a (objectIdentifier: 1001, layoutID: null, layoutName: null, previewReport: null, deviceClass: Desktop, pageGroup: Content)
    . . 
    [11/14/23 18:37:58:569 GMT] 0000010f FetchPageDesi 1 com.ibm.commerce.pagelayout.facade.server.commands.FetchPageDesignCmdImpl evaluateWinningLayout(PageDesignType pageDesign) The winning layoutId == 12501 name = 12501
    
  • Verify and match the Layout from database and Management Center configuration.
    select * from PAGELAYOUT where name ='HomePageLayout' and storeent_id in ( select storeent_id from storeent where identifier in ('EmeraldSAS' , 'Emerald'))
  • Verify the widget and match it with the database and Management Center.
    [11/14/23 18:37:58:801 GMT] 0000010f PageLayoutGra > com.ibm.commerce.pagelayout.facade.server.services.dataaccess.graphbuilderservice.PageLayoutGraphComposer appendPageLayoutWidgetPropertyToWidgets ENTRY [3001, 3002, 3003, 3004, 3005, 3006, 3007] {3001=com.ibm.commerce.pagelayout.facade.server.entity.datatypes.impl.PageLayoutWidgetImpl@ee4fcd5a (pageLayoutWidgetId: 3001, pageLayoutId: 12501, pageLayoutWidgetDefinitionId: -8000, adminName: Home page, slotId: null, field1: null, field2: null, field3: null, optcounter: 1), 3002=com.ibm.commerce.pagelayout.facade.server.entity.datatypes.impl.PageLayoutWidgetImpl@1f9fab8f (pageLayoutWidgetId: 3002, pageLayoutId: 12501, pageLayoutWidgetDefinitionId: -8513, adminName: HomePageBannerWidget, slotId: 1, field1: null, field2: null, field3: null, optcounter: 1), 3003=com.ibm.commerce.pagelayout.facade.server.entity.datatypes.impl.PageLayoutWidgetImpl@b8752849 (pageLayoutWidgetId: 3003, pageLayoutId: 12501, pageLayoutWidgetDefinitionId: -8513, adminName: HomePageFreeDelivery, slotId: 2, field1: null, field2: null, field3: null, optcounter: 1), 
    . . .
    
  • The query server responds with the final JSON response. Look for the following string on the query server:
    2023-11-15T06:11:19.376Z [Default Executor-thread-268394] [7301567579374342019] TRACE c.h.c.s.rest.AbstractSearchResource.executeSearch:505 - Result : <200 OK OK,{contents=[{layout={id=12501, name=HomePageLayout, containerName=home-page, slots=[{id=1, widgets=[{id=3002, name=HomePageBannerWidget, widgetName=e-marketing-spot-widget, sequence=0.0, properties={emsName=Home Hero, emsType=global}}]},