---
title: "Troubleshooting session traits"
slug: "troubleshooting-session-traits"
abstract: "How to resolve common issues that users may encounter with session traits."
---
# Troubleshooting session traits

This topic describes the most common issues you may encounter with session traits and provides solutions for resolving them.

## Viewing a session trait's error report

When a session trait fails, you can access an error report to view an active session trait's execution data and logs in a table format. This report can help you identify the cause of the failure.

To view a session trait's error report:

1. From the **Session Traits** page, open the active session trait for which you want to view the report.

    On the **Activity** tab, you'll see statistics for the total number of executions, including successful and failed attempts.

    ![SessionTraitEexecutionStats.png](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/SessionTraitEexecutionStats.png)

2. Access the error report using these methods:
    - To access the report for the most recent failed execution, click **View error report** in the banner.
    - To access the report for a specific failed execution, click the number in the **Failed executions** tile on the **Activity** tab.
3. The **Error Report** page lists all session trait executions with errors. Click **View Log** to see details of a specific failed execution, including the failure message and additional information.

    ![SessionTraitErrorReport.png](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/SessionTraitErrorReport.png)

4. To resolve the issue, [pause](urn:resource:component:1398821/section-idm1703437729709820) the session trait and edit the JavaScript code of your session trait.

    > [!important]
    > Always [test the session trait](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/developer-center/session-traits/test-a-session-trait.html "Test a session trait") thoroughly before [reactivating](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/developer-center/session-traits/activate-a-session-trait.html "Activate a session trait") it.

## Handling calculation errors for one or more customers

If a calculation error occurs in an active session trait but only affects certain customers, you can [pause the session trait](urn:resource:component:1398821/section-idm1703437729709820). This pause allows you to make necessary corrections without losing the existing progress. Any successful calculations for other customers will remain intact during this pause, ensuring that you do not restart the process from the beginning. This also gives you the opportunity to address the issues causing the calculation errors for certain customers.

After you pause the session trait:

1. Review and adjust the JavaScript code. Focus on handling all potential input data types to prevent future errors.
2. [Test the modified code](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/developer-center/session-traits/test-a-session-trait.html "Test a session trait") against a customer that previously encountered an error, and make sure the adjustments resolve calculation errors for that customer.
3. [Reactivate](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/developer-center/session-traits/activate-a-session-trait.html "Activate a session trait") the session trait if you want to resume calculations.

## Addressing high failure rates

When a session trait exhibits a high failure rate, specifically, if it has 50 failed executions and zero successful executions in the past hour, Sitecore CDP automatically pauses its execution to prevent additional errors. The system continuously monitors failure rates and intervenes when they exceed the set threshold.

After Sitecore CDP automatically pauses your session trait:

1. You'll receive a notification that details the encountered error.
2. Review and adjust the JavaScript code. Identify the root cause of the high failure rate.
3. [Test the modified code](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/developer-center/session-traits/test-a-session-trait.html "Test a session trait") to ensure the the problems are resolved.
4. [Reactivate](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/developer-center/session-traits/activate-a-session-trait.html "Activate a session trait") the session trait once you're confident of the code changes.