Troubleshooting: queries failing after Docker Compose setup
In the Docker Compose environment, you 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
- You deploy the HCL Commerce environment, and query the storefront when the index has not finished building.
- The expected error is returned:
Elasticsearch exception [type=index_not_found_exception, reason=no such index [auth.12001.catalog]]
- 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
- 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.