All Products
Search
Document Center

Elasticsearch:FAQ about common errors

Last Updated:Apr 25, 2024

If you encounter issues when you use an Alibaba Cloud Elasticsearch cluster, you may view error messages in related data, such as cluster logs, client logs, and command running results. This topic provides answers to some frequently asked questions about the common errors that may occur when you use an Elasticsearch cluster.

What do I do if the system displays the error message "HTTP/1.1 413 Request Entity Too Large" when data is written to an Elasticsearch cluster?

Cause

The amount of data that is written to the Elasticsearch cluster at a time exceeds the value of the http.max_content_length parameter. The http.max_content_length parameter specifies the maximum amount of data that can be written to an Elasticsearch cluster at a time. The default value of this parameter is 100 MB. We recommend that you do not change the value.

Solution

Adjust the amount of data that you write to the cluster at a time. The amount of data that is written at a time is calculated by using the following formula: Number of documents × Size of each document. You may not be able to precisely estimate the amount of data that is written at a time based only on the number of documents because the amount is also related to the size and complexity of each document. If each document stores a large amount of data, you can reduce the number of documents to write at a time. We recommend that you debug the amount of data to write at a time from 5 MB to 15 MB. By default, the amount of data that is written to an Elasticsearch cluster at a time by using a bulk write request cannot exceed 100 MB. For more information, see HTTP settings. For information about how to debug the amount of data, see Using and Sizing Bulk Requests in the documentation for open source Elasticsearch.

What do I do if the system displays the error message "forbids automatic creation of the index" when data is written to an Elasticsearch cluster?

Cause

The Auto Indexing feature is not enabled for the Elasticsearch cluster.

Solution

Enable the Auto Indexing feature for the Elasticsearch cluster in the YML File Configuration panel of the Elasticsearch console. This is a static operation. You can also run the related command to dynamically enable the Auto Indexing feature for the Elasticsearch cluster. For information about how to configure the settings in the YML file of an Elasticsearch cluster, see Configure the YML file.

What do I do if the cluster logs of an Elasticsearch cluster contain the error message "all shards failed"?

Problem description

The error message indicates that the following issues may occur on the Elasticsearch cluster:

  • No data can be queried from the shards in the cluster.

  • Data cannot be searched because the cluster or nodes in the cluster are being initialized.

  • One or more indexes in the cluster have unassigned shards, or shards are being recovered for indexes in the cluster. The cluster is in an abnormal state indicated by the color red.

Causes

The issues may occur in the following scenarios:

  • A node is disconnected from or is connecting to the Elasticsearch cluster.

  • The shards from which you want to query data are being recovered and are unavailable.

  • A disk of the Elasticsearch cluster is damaged.

Solution

Check whether the Elasticsearch cluster is healthy based on the monitoring data and logs of the cluster. For example, you can check whether the disk space of the Elasticsearch cluster is sufficient or whether some parameter configurations for indexes and the cluster may result in failed shard allocation. If node disconnection occurs or unassigned shards exist in the Elasticsearch cluster, resolve the issue by performing the following steps:

  1. Log on to the Kibana console of the Elasticsearch cluster.

  2. Query the shard allocation status in the Elasticsearch cluster.

    GET /_cluster/allocation/explain
    Note

    If all shards are allocated in the Elasticsearch cluster, an error message is displayed after the command is successfully run.

  3. Reallocate the shards that are not allocated.

    POST /_cluster/reroute?retry_failed=true

What do I do if the cluster logs of an Elasticsearch cluster contain an error message related to SSL or TLS?

Cause

If plaintext traffic is transferred over an SSL connection, the cluster logs of the cluster contain the error message displayed in the following figure. In most cases, this issue occurs when a node for which encrypted communication is not enabled tries to connect to a node for which encrypted communication is enabled.SSL/TSL报错

Solution

We recommend that you resolve the issue based on the following instructions:

  • Check whether access to the Elasticsearch cluster is normal. If HTTPS is not enabled for the cluster, you can access the cluster only over HTTP by default. In this case, if you access the cluster over HTTPS, an error is reported. If you want to access the cluster over HTTPS, you must enable HTTPS for the cluster in the Elasticsearch console. For information about how to enable HTTPS for an Elasticsearch cluster, see Enable HTTPS.

  • Check whether the IP address that is printed in the cluster logs is the IP address used to access the Elasticsearch cluster and whether the IP address is added to a public IP address whitelist of the cluster. We recommend that you add only the IP address or CIDR block that you need to use to access the cluster to a public IP address whitelist of the cluster. We recommend that you do not add 0.0.0.0/0 to a public IP address whitelist.

For more information about issues related to SSL or TLS, see Common SSL/TLS exceptions.

What do I do if the system displays the error message "No keyword/multi-field defined exact matches for [KeywordField]" when I use the SQL plug-in provided by X-Pack to perform a query?

Cause

Fields of the text type are used for the query for which the LIKE operator is used.

Solution

LIKE operator-based queries that are performed by using the SQL plug-in provided by X-Pack can perform exact filter only on fields of the keyword type. These queries do not support exact filter for fields of the text type. To ensure that the query can be performed as expected, you must use fields of the keyword type. For more information, see Unable to run SQL query on multi fields using Elastic Search v. 7.3 and SQL and multi-fields.

What do I do if the system displays the error message "path is not accessible on master node" when I run the PUT _snapshot/my_backup command to create snapshots for an Elasticsearch cluster to back up the data of the cluster?

Cause

The Object Storage Service (OSS) bucket that you use to store the snapshots is a bucket of the Archive storage class. In this case, you must restore the objects in the bucket before you can read data from the bucket.

Solution

Alibaba Cloud Elasticsearch does not allow you to store snapshots created for an Elasticsearch cluster to an OSS bucket of the Archive storage class. You must use an OSS bucket of the Standard storage class that resides in the same region as the Elasticsearch cluster. For information about how to create snapshots to back up the data of an Elasticsearch cluster, see Create manual snapshots and restore data from manual snapshots.

What do I do if the system displays the error message "kibana did not load properly" when I log on to the Kibana console of an Elasticsearch cluster?

Cause

If the disk usage of a data node in an Elasticsearch cluster exceeds 95%, the write protection mechanism provided by Elasticsearch is triggered. The system forcefully configures the read_only_allow_delete property for all indexes in the Elasticsearch cluster. As a result, data cannot be written to the indexes, and you can only read data from the indexes or delete the indexes.

Solution

  1. Resolve the issue of high disk usage. For more information, see High disk usage and read-only indexes.

  2. Run the following command to set the index.blocks.read_only_allow_delete property to null for all indexes. This ensures that all indexes on the cluster are not read-only.

    PUT _settings
    {  
       "index.blocks.read_only_allow_delete": null
    }

What do I do if the system displays the error message "unsupported_operation_execption" when I use the aliyun-qos plug-in?

Problem description

After the throttling feature is enabled for the aliyun-qos plug-in by using the apack.qos.ratelimit.enabled parameter, the following error is reported during the configuration of a limiter:

{
   "error": {
      "root_cause": [
            {
               "type": "unsupported_operation_exception",
               "reason": "unsupported_operation_exception: only define search or bulk action for limit"
            }
         ],
         "type": "unsupported_operation_exception",
         "reason": "unsupported_operation_exception: only define search or bulk action for limit"
      },
   "status": 500
}

Cause

The aliyun-qos plug-in that you use is not of the latest version.

Solution

Run the GET /_cat/plugins?v command to obtain the version of the aliyun-qos plug-in. The latest version of the plug-in for an Elasticsearch V7.10 cluster is 7.10.0_ali1.6.0.2. The latest version of the plug-in for an Elasticsearch cluster of another version is in the format of <Version of the Elasticsearch cluster>-rc4. If the plug-in is not of the latest version, you can use one of the following methods to resolve the issue:

  • Plug-in installed on an Elasticsearch V7.10 cluster: Update the kernel version of the cluster to V1.6.0. For more information, see Upgrade the version of a cluster.

  • Plug-in installed on an Elasticsearch cluster of a version other than V7.10: Submit a ticket to contact Elasticsearch technical engineers to upgrade the version of the plug-in. After the upgrade, you must restart your Elasticsearch cluster for the change to take effect.

Important
  • If the version of the aliyun-qos plug-in is earlier than rc4, the system displays the error message unsupported_operation_exception when you use the plug-in.

  • You can upgrade the version of the aliyun-qos plug-in that is installed on an Elasticsearch cluster of V6.7.0 or later. If you want to upgrade the version of the aliyun-qos plug-in that is installed on an Elasticsearch cluster of a version earlier than V6.7.0, you must upgrade the version of the cluster to V6.7.0 or later before you can upgrade the version of the aliyun-qos plug-in.

What do I do if the system displays an error message that contains "NoNodeAvailableException" when I use Transport Client to access an Elasticsearch cluster over port 9300?

Problem description

When you use Transport Client 5.5 or Transport Client 5.6 to access an Elasticsearch cluster over port 9300, the following error message may be displayed: NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{HVdK7Cff****\_P0c9n****}{es-cn-v1qqweee****.elasticsearch.aliyuncs.com}{172.17.XX.XX:9300}]]. However, the Elasticsearch cluster does not contain a node whose IP address is in the 172.17.XX.XX format.

Solution

We recommend that you use Transport Client 5.3.3 to access Elasticsearch clusters. For more information, see Transport Client (5.x).

What do I do if the cluster logs of an Elasticsearch V7.4 cluster contain the error message "Unclosed object or array found" or "ArrayIndexOutOfBoundsException"?

Cause

This issue is caused by the bugs of open source Elasticsearch 7.4 and does not affect your business.

Solution

This issue is resolved for open source Elasticsearch of versions later than 7.4. Alibaba Cloud Elasticsearch V7.4 clusters are phased out. If you encounter this issue when you use an Elasticsearch V7.4 cluster, we recommend that you cancel the subscription to the cluster, and purchase an Elasticsearch cluster of a later version based on your business requirements. If you want to migrate the data of the original Elasticsearch cluster before you cancel the subscription to the cluster, you can refer to Select a data migration solution to select a data migration solution based on your business requirements. This ensures the integrity of data of the original Elasticsearch cluster.

What do I do if the system displays the error message "No field found for [metaData] in mapping with types" when I use the aliyun-knn plug-in to perform a vector search on a vector index for which the Cosine distance measurement function is configured?

We recommend that you resolve the issue based on the following instructions:

  • Check whether the version of your Elasticsearch cluster meets requirements.

    The aliyun-knn plug-in is available only for Elasticsearch V6.7 clusters whose kernel versions are of V1.2 or later and Elasticsearch V7.10 clusters whose kernel versions are of V1.4 or later. For more information about the requirements for the cluster version, see Use the aliyun-knn plug-in.

  • Check whether you perform a script query. You can perform script queries only by using the script_score parameter.

  • Check whether the fields you specify for the query meets requirements. For example, fields in an index are nested fields, but the fields you specify for the query are not nested fields.

What do I do if the system displays the error message "API keys not enabled in Elasticsearch" when I use the Elasticsearch API key for authentication?

Cause

The API key is not enabled for the Elasticsearch cluster.

Solution

Enable HTTPS. For more information, see Enable HTTPS.