# Troubleshooting

> The data run also creates a log file that can help in case of unexpected results or if the data upload with the data uploader fails. The file `extraction.log` contains the logs of the last data run. For each extraction that failed, a return code is displayed. Refer to the official Theobald Software documentation [Call via Commandline](https://helpcenter.theobald-software.com/xtract-universal/documentation/execute-and-automate/call-via-commandline/) for more information. When something with the setup is incorrect, this is mentioned in the error message.

The data run also creates a log file that can help in case of unexpected results or if the data upload with the data uploader fails. The file `extraction.log` contains the logs of the last data run. For each extraction that failed, a return code is displayed. Refer to the official Theobald Software documentation [Call via Commandline](https://helpcenter.theobald-software.com/xtract-universal/documentation/execute-and-automate/call-via-commandline/) for more information. When something with the setup is incorrect, this is mentioned in the error message.

## Extraction Issues With CDPOS for Non-HANA Systems

In some older, non-HANA systems, CDPOS is a cluster table and may result in a “join with pool table” erroras displayed in the following code.

```
ERPConnect.ABAP RuntimeException: RfcReceiveEx failed(RFC_SYS_EXCEPTION) RFC_ERROR_SYSTEM_FAILURE - Join with pool table, cluster or view.
```

The extraction of the `CDPOS` table includes by default a join with the `CDHDR` table to limit the number of records that need to be extracted. Follow these steps to overcome this error.

1. Edit the CDPOS extraction in Xtract Universal Designer to remove the CDHDR from the tables.
2. Replace the `CDHDR~UDATE between @extraction_start_date and @extraction_end_date` with: `CHANGENR between @CHANGENR_min and @CHANGENR_max`
3. In the `extract_theobald.ps1`, replace `&"$xu_location\xu.exe" -s "$xu_server" -p "$xu_port" -n "CDPOS" -o "extraction_start_date=$extraction_start_date" -o "extraction_end_date=$extraction_end_date"` with the code displayed in the following code block.
```
&"$xu_location\xu.exe" -s "$xu_server" -p "$xu_port" -n "CDHDR_CSV" -o "extraction_start_date=$extraction_start_date" -o "extraction_end_date=$extraction_end_date"
CheckExtractionError('CDHDR_CSV')
$CDHDR = Import-Csv -Path "$xu_location\<app_template_specific>output\CDHDR_CSV.csv" -Delimiter "`t"
$CDHDR_sorted = $CDHDR | Sort-Object -Property CHANGENR 
$CHANGENR_min=$CDHDR_sorted.GetValue(0).CHANGENR
$CHANGENR_max=$CDHDR_sorted.GetValue($CDHDR_sorted.Count-1).CHANGENR
&"$xu_location\xu.exe" -s "$xu_server" -p "$xu_port" -n "CDPOS" -o "CHANGENR_min=$CHANGENR_min" -o "CHANGENR_max=$CHANGENR_max"
```

:::note
This is a generic example, the tables names can be different for your app template.
:::
:::note
Replace the output folder with the output folder specified for you app template in `extract_theobald.ps1`.
:::

## Other extraction issues

### Parse errors

When the extraction is failing with a parse error (for example `Unexpected ')'`), check the `WHERE` clause of the extraction that is failing. Ensure that the spacing around brackets and the values inside them are correct. Inconsistent formatting can cause parsing issues.

For example, `name in ('a', ‘b', ‘c’)` should be updated to `name in ( ‘a’, ‘b’, ‘c’ )`).

After correcting the `WHERE` clause and saving the extraction, run it again.

### Duplicate key

When uploading data using Theobald Xtract Universal, the following error message can occur:

![Duplicate key message](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-duplicate-key-message-276450-ef4aebf5-943f6e95.webp)

#### Possible cause

A field used for the primary key on the table is not retrived in the extraction.

#### Solution

To solve this, you need to check if all the fields used for the primary key on the table are retrieved in the extraction.

The following illustration shows an example from the `EKKN` table. For this table, the primary key is not complete, because the field `ZEKKN` is not retrieved. The issue can be fixed by making sure this field is also used in the extraction.

:::tip
Primary keys in SAP tables can be recognized by the key symbol displayed in front of the field name.
:::

![Example EKKN table](https://dev-assets.cms.uipath.com/assets/images/process-mining/process-mining-example-ekkn-table-276459-9eab00ea-7c6ece2e.webp)
