# Troubleshooting

Ensure that you have followed [Post Upgrade Steps](https://help.salesforce.com/s/articleView?id=ind.comms_post_upgrade_steps_winter\_24.htm\&type=5).

Following are some of the troubleshooting scenarios.

## Validate Data Setup for Standard Cart API

Run the `VALIDATION FOR DATA INTEGRITY` tool before before initiating the Standard Cart API's Generate Compiled Data job.
This helps in identifying and resolving common data setup issues and ensures that data compilation process is smooth and efficient.

1. From the App Launcher, find and select **Vlocity CMT Administration**.
2. Click **Validate Data Setup for Standard Cart API**.
3. Click **Start** to run the `VALIDATION FOR DATA INTEGRITY` tool.
   ![Diagnostic Tool](https://a.sfdcstatic.com/developer-website/sfdocs/industries/media/Diagnostic_tool.png "Diagnostic Tool")
4. Diagnostic tool identifies the issues and displays the results. Sample diagnostic details are as follows.
   ![Diagnostic Details](https://a.sfdcstatic.com/developer-website/sfdocs/industries/media/Diagnostic_details.png "Diagnostic Details")

## Generate EPC Compile Data Job fails with error : Lock is engaged on Configuration Snapshot

The Generate EPC Compile Data Job fails with the following error.
![EPC Jobs](https://a.sfdcstatic.com/developer-website/sfdocs/industries/media/epc-jobs.png "EPC Jobs")\
Perform the following steps to fix the issue.

1. From the App Launcher, find and select **Vlocity CMT Administration**.
2. Click **CPQ Configuration Setup**.
   ![CPQ Config](https://a.sfdcstatic.com/developer-website/sfdocs/industries/media/cpq-config.png "CPQ Config")
3. Search for ConfigurationSnapshotLock and set its value as `False`. Click **Save**. Start the Generate EPC Compile Data Job again.\
   ![Snapshot Lock](https://a.sfdcstatic.com/developer-website/sfdocs/industries/media/snapshot-lock.png "Snapshot Lock")

## Generate EPC Compile Data Job fails with error : Not able to query PricebookEntry

The Generate EPC Compile Data Job fails at the Compile Product Hierarchy step. To see the detailed error message:

1. Click **More Details**.
2. Navigate to the related tab on Async Process page. Select Compiled Product Hierarchy from Async Process Steps related list.
3. Navigate to related tab on Async Process Step page. In the Async Process Jobs related list find and select the job which failed. You will see the below error in the Technical Message section:
   ![Execute Process](https://a.sfdcstatic.com/developer-website/sfdocs/industries/media/execute-process.png "Execute Process")

Perform the following steps to fix the issue.

1. From the App Launcher, find and select **Vlocity CMT Administration**.
2. Click **Upgrade Jobs**.
   ![Upgrade Jobs](https://a.sfdcstatic.com/developer-website/sfdocs/industries/media/upgrade-jobs.png "Upgrade Jobs")
3. Execute the Populate PriceBookEntry in PriceListEntry records job. Start the Generate EPC Compile Data Job.
   ![Price Book](https://a.sfdcstatic.com/developer-website/sfdocs/industries/media/pricebook-entry.png "Price Book")

### Populate PriceBookEntry in PriceListEntry Records Job

This job populates `PriceBookEntryId__c` field on the `PriceListEntry__c`. This job assumes that for every combination of PriceBook Id and Product Id, there is a `PriceBookEntry__c` record exists.
If `PriceBookEntry__c` entry is missing, then it creates one and assigns the pricebook Id in appropriate `PriceBookEntryId__c` field of the `PriceListEntry__c`. In case of multi-currency environment the job associates `PriceBookEntry__c` and `PriceListEntry__c` based on the `currencyIsoCode`.

#### Sample Request

```
{
"methodName" : "startPopulatePBEInPLEBatchJob"
}
```

#### Sample Response

```
[
{
"statusCode": 200,
"type": "rpc",
"tid": 6,
"ref": false,
"action": "rs_pc.CMTAdminController",
"method": "telcoAdminConsloleInvokeMethod",
"result": {
"hasErrors": false,
"parameters": "{\"methodName\":\"startPopulatePBEInPLEBatchJob\"}",
"populatePBEInPLEBatchJobs":
[
{
"Id": "7075w0000LWtJhnAQF",
"Status": "Holding",
"NumberOfErrors": 0,
"CreatedDate": 1720085210000,
"JobItemsProcessed": 0,
"ApexClassId": "01p5w00000KsSsMAAV",
"TotalJobItems": 0,
"ApexClass": {
"Name": "PopulatePriceBookEntryIdInPLEJob",
"Id": "01p5w00000KsSsMAAV"
         }
      }
   ]
   }
}
]

```

The CMTAdminController invokes the actual job with 2000 records per batch. In case of large PriceListEntry records, you might face `Batchable instance is too big` error.
This happens because PopulatePriceBookEntryIdInPLEJob class implements `Database.Stateful` and short of heap size issue can occur.
![Database Stateful](https://a.sfdcstatic.com/developer-website/sfdocs/industries/media/database-stateful.png "Database Stateful")
To overcome this issue, run the job manually from the developer console. Currently, 2000 records run per batch that needs to be increased.
This is the sample code with 5000 records.

```
Database.executeBatch(new PopulatePriceBookEntryIdInPLEJob(), 5000);
```
