HCL Commerce Version 9.1.14.0 or later

Troubleshooting: queries failing after Docker Compose setup

In the Docker Compose environment, if may run a search Query while the Elasticsearch index is not yet available. When the index does become available, you receive the error message ** java.io.IOException: Unable to open "custom-ner-en_US.txt" as class path, filename or UR".

Problem

This scenario can occur when you have successfully set up the HCL Commerce environment using Docker Compose, and make a query against the storefront before building an index. The typical sequence is as follows:
  1. You deploy the HCL Commerce environment, and query the storefront when the index has not finished building.
  2. The expected error is returned:
    Elasticsearch exception [type=index_not_found_exception, reason=no such index [auth.12001.catalog]]
  3. You allow the index build to complete, and query the storefront again. This time, an unexpected error is returned:
    java.io.IOException: Unable to open "custom-ner-en_US.txt" as class path, filename or URL
  4. Subsequent Category searches fail, returning no results or only partial results.

If you use Kubernetes to set up the system, this issue can be avoided by setting up a lock on the Query service. For more information, see Optimizing the Natural Language Processing service.

Solution

When you deploy using keyword keyref="wc"/> Docker Compose, you will start with no indexes in Elasticsearch. If Advanced NLP is enabled, which it is by default, the Query service attempts to generate the custom-ner-locale.txt file based on the index data. In this case it fails to generates the file because there is no index. The absence of this file causes the error message referred to in Step 3.

To resolve this issue, restart the Query service. Once the indexing process has completed and a custom-ner-locale.txt file is created, subsequent queries will succeed.