> For the complete documentation index, see [llms.txt](https://docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verifone.com/kld/key-information/key-import/handling-key-import-error.md).

# Handling Key Import Error

<figure><img src="/files/JP9TvYytkHaPhymOQ6K3" alt=""><figcaption></figcaption></figure>

* After import, the stats dialog shows failures via **Lines With Error**.
* Always check:
  * **Total Lines**
  * **Lines With Error**
* Total Lines excludes blank and commented lines.

### Finding the failing line

* Export the app log.
  * Use **Log/Export Log**.
* Search for import errors.
* The log includes:
  * line number
  * error reason

Why not show errors on UI:

* Key lists can be large.
  * Up to \~2500 keys.
* UI space is limited.
* Showing all errors is error-prone.

### Example: Master Session import error

Scenario:

* `MS/KBPK/2-xxxxx.txt` contains 100 key lines.
* Lines 33 and 76 resulted in error.
* Export the App log using the "Log/Export Log" menu item and look for the error and line number

#### Recovery options

**1) Creating a new key list**

There is no existing dataset on KLD.

Options:

* Option A (recommended)
  * Delete the partially imported key list in the UI.
  * Fix or remove the failing lines in `2-xxxxx.txt`.
  * Import again using **Create New List**.
* Option B (be careful)
  * Keep the partially imported key list on KLD.
  * In `2-xxxx.txt`, delete all lines except the failing ones.
  * Fix those lines.
  * Remove all other files under `MS/KBPK` on the USB.
  * Copy only the corrected `2-xxxx.txt` back to `MS/KBPK`.
  * Import again using **Existing Key List**.
  * Select the partially imported key list.
  * This appends the corrected keys into the original KLD file.

**2) Refilling an existing key list**

* Use the same approach as **Option B** above.
* Keep only the corrected lines on the USB.

Critical rule for refills:

* Do not keep any successfully imported lines or files on the USB.
* Otherwise you will duplicate key data on KLD.
* Duplicates can be a security issue.
  * The same key could be sent to different terminals.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.verifone.com/kld/key-information/key-import/handling-key-import-error.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
