---
title: "Troubleshooting"
slug: "troubleshooting"
abstract: "Common errors related to the Sitecore Engage SDK and how to fix them (Sitecore Personalize Stream API)."
---
# Troubleshooting

This topic describes the most common errors and solutions when integrating using the Engage SDK.

## Errors in the console or terminal

### 400 Bad Request when running Engage.personalize()

This error occurs when you're trying to return an experiment or experience for a user of your app using an email address or other identifiers that don't exist in Sitecore Personalize. To fix the error, in [the personalization data object](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/objects/personalization-data-object.html "Personalization data object"), specify identifiers that exist in Sitecore Personalize.

### 401 Unauthorized

This error occurs when the value for the `clientKey` attribute is incorrect. To fix the error, set the value to the correct [client key](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950058068 "Client key").

### 404 Not Found

This error occurs in the following cases:

- The browser ID was not stored as a cookie in the web browser. This happens when, for example, the value for the `cookieDomain` is incorrect, a user of your app rejects cookies, or the web browser is blocking cookies. To send events and call personalization, use the correct [cookie domain](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950201916 "Cookie domain (optional)") and make sure that the browser ID is stored as a cookie in the web browser.
- The value for the `targetURL` attribute is the wrong URL from the available URLs for the Stream API. To fix the error, set the value to the correct [Stream API target endpoint](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950147122 "Stream API target endpoint").

### Cookie has been rejected for invalid domain

This error occurs when the value for the `cookieDomain` is incorrect. To fix the error, set the value to the correct [cookie domain](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950201916 "Cookie domain (optional)").

### Cross-origin request blocked

This error occurs when the value for the `targetURL` attribute is different than the available URLs for the Stream API. To fix the error, set the value to the correct [Stream API target endpoint](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950147122 "Stream API target endpoint").

### IE errors

`IE` errors are related to initializing the Engage SDK. You must resolve these errors for the Engage SDK to function properly.

| Code | Description | Note |
| --- | --- | --- |
| `IE-0001` | The `window` object is not available on the server side. Use the `window` object only on the client side, and in the correct execution context. | This error can occur when you call Engage functions on the server.<br><br>Make sure to call Engage functions where the `window` object is present. |
| `IE-0002` | Cannot retrieve the cookie from the server. | See a [code sample](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/integrate-engage-sdk-nextjs-server-side.html) for setting cookies from the server. |
| `IE-0003` | Timeout exceeded. The server did not respond within the allotted time. | This error occurs when you call a function with the `timeout` parameter, then the function makes a network request to the server, but the server doesn't respond in time.<br><br>When you use `timeout`, use try-catch blocks to handle errors. |
| `IE-0004` | Unable to set the cookie because the browser ID could not be retrieved from the server. Try again later, or use try-catch blocks to handle this error. | This error can occur when there are network issues or the Sitecore Personalize server is down when the [Engage.initServer.handleCookie(req, res)](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/engage-initserver-handlecookie.html) function is running.<br><br>When you use the `initServer.handleCookie()` function, you should use try-catch blocks to handle errors. |

### IV errors

`IV` errors are related to incorrect values and wrongly formatted objects in the event data.

| Code | Description | Note |
| --- | --- | --- |
| `IV-0001` | Incorrect value for `targetURL`. Set the value to a valid URL string. | Set the value to the correct [Stream API target endpoint](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950147122). |
| `IV-0002` | Incorrect value for `dob`.<br><br>Format the value according to [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601). | [See examples](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/event-data-object.html) of correctly formatted data. |
| `IV-0003` | Incorrect value for `email`. Set the value to a valid email address. |  |
| `IV-0004` | Incorrect value for `expiryDate`.<br><br>Format the value according to [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601). |  |
| `IV-0005` | This event supports maximum `{{max}}` attributes. Reduce the number of attributes. |  |
| `IV-0006` | Incorrect value for the timeout parameter. Set the value to an integer greater than or equal to `0`. | `N/A` |

### MV errors

`MV` errors are related to missing values in the event data.

| Code | Description | Note |
| --- | --- | --- |
| `MV-0001` | `clientKey` is required. | Set the value to your [client key](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950058068). |
| `MV-0002` | `targetURL` is required. | Set the value to the correct [Stream API target endpoint](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950147122). |
| `MV-0003` | `pointOfSale` is required. | Set the value to the [name of your point of sale](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950166538). |
| `MV-0004` | `identifiers` is required. | [See examples](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/event-data-object.html) of correctly formatted data. |
| `MV-0008` | `friendlyId` is required. | [See examples](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/personalization-data-object.html) of correctly formatted data. |
| `MV-0009` | `pointOfSale` cannot be empty. | Set the value to the [name of your point of sale](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950166538). |

## Events not appearing in Sitecore Personalize

This issue occurs if you sent an event to Sitecore Personalize and your web browser console contains no errors, but the value for the `pointOfSale` attribute is incorrect.

To fix the error:

1. In your script, locate your `pointOfSale` attributes. Usually, they are either in your settings object or your event data objects, or both.
2. For every `pointOfSale` attribute, specify the correct [name of a point of sale](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/collect-required-details.html#UUID-60c4c930-3cfe-e0ad-3b98-69ceff75989f_section-idm1903325950166538 "Name of point of sale").

## Events related to orders are failing in Sitecore Personalize

This issue occurs if an ADD, CONFIRM, or CHECKOUT event is set up incorrectly.

To fix the error:

- Make sure that the event data objects for the [ADD](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/objects/event-data-object/add-event.html "ADD event"), [CONFIRM](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/objects/event-data-object/confirm-event.html "CONFIRM event"), and [CHECKOUT](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/objects/event-data-object/checkout-event.html "CHECKOUT event") events are correctly formatted.
- Make sure to send the events [in the correct sequence](https://doc.sitecore.com/personalize/en/developers/api/integrating-with-sitecore-personalize/understanding-integration-details/sending-orders-using-the-engage-sdk.html "Sending orders using the Engage SDK").
- For each item ID included in an object in the [`product`](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/objects/event-data-object/confirm-event.html "CONFIRM event") array of the CONFIRM event data object, there must be a preceding ADD event data object where the product item ID is specified in [`product.item_id`](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/objects/event-data-object/add-event.html "ADD event").

    See [examples](https://doc.sitecore.com/personalize/en/developers/api/stream-api/sitecore-engage-sdk-reference/add-event.html#UUID-7b1ee50b-d9c6-3bc4-d87e-9603187d3190_example-idm4559219305961633573933574595 "Example 25. Product item IDs in ADD and in CONFIRM events").