> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.14/onboard-cortex-xsoar/elasticsearch/troubleshoot-elasticsearch.md).

# Troubleshoot Elasticsearch

Your Elasticsearch deployment can have issues with feed ingestion, memory, or general functionality.

{% hint style="info" %}

### Note

PANW support will provide customer help to the best of their ability. You should consider vendor support per need.
{% endhint %}

After reviewing the troubleshooting items in the table below, if you need to create a support ticket:

1. Set the log level to debug by going to Settings → About → **Troubleshooting**.
2. Reproduce the issue and [download server log bundles](/xsoar-6-administrator-guide/6.14/customize-cortex-xsoar/customize-and-configure-cortex-xsoar/logs/create-a-log-bundle.md).

   (High Availability) For High Availability deployments, you only need to download the server log bundle once, as it gathers logs from all online application servers. If your High Availability servers are behind a load balancer and the log bundle times out, increase the timeout on your load balancer to five minutes.
3. Attach the logs to the support ticket.

**General issues**

| Issue                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | Description                                                                                                                                                                                | Recommendation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **limit of total fields (X) in index has been exceeded**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Mapping in Elasticsearch exceeded maximum configured field capacity.                                                                                                                       | <p>Use <strong><code>totalFields</code></strong> under the Elasticsearch configuration in your <code>demisto.conf</code> to set matching index to a custom total fields. By default, <strong><code>common-incident</code></strong>, <strong><code>common-indicator</code></strong>, and <strong><code>common-evidence</code></strong> are set to 2000. You can also set the total limit on a selected index using:</p><p><strong><code>PUT \<indexFullName>/\_settings { "index.mapping.total\_fields.limit": 2000 }</code></strong></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **field expansion matches too many fields, limit: X, got: X+Y**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | The number of fields a query can target exceeded the limit of X.                                                                                                                           | Set **`indices.query.bool.max_clause_count`** in **`elasticsearch.yml`** file to a higher value and restart Elasticsearch.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| <p><strong>request to elasticsearch exceeded maximum size, increase</strong></p><p><strong>'http.max\_content\_</strong></p><p><strong>length'</strong></p><p><strong>in your elasticsearch.yml to allow larger requests</strong></p><p>or</p><p><strong>(413) request entity too large</strong></p>                                                                                                                                                                                                                                                  | <p>A request to Elasticsearch exceeded the maximum size of <strong><code>http.max\_content\_</code></strong></p><p><strong><code>length</code></strong>.</p>                               | If the request is a bulk save, decrease the **`innerBatchSize`** bulk size that is set to 250 by default. Alternatively, increase the cluster **`http.max_content_length`** settings in **`elasticsearch.yml`** to increase the maximum limit for Elasticsearch received requests.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| **too many requests to elasticsearch**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                                                                                                                                            | <p>1. Verify the Elasticsearch cluster state is healthy (green) and all nodes are optimized and balanced. If the too many requests error is from a specific node, it might be related to node optimization.</p><p>2. Verify the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/file-descriptors.html">limit on the number of open file descriptors</a> is sufficient to handle the number of parallel requests.</p><p>3. If the error occurs during batch update operations, decrease the base batch size used by Cortex XSOAR when sending requests to Elasticsearch. Edit <strong><code>innerBatchSize</code></strong> under elasticsearch in your <code>demisto.conf</code> file and restart Cortex XSOAR. See the full list of <a href="/pages/EnIT75Cm9LHpGikgjMW0#UUID-67fa1a50-a232-8515-79f5-4b4787e0d566">Elasticsearch configurations</a>.</p><p>4. If the error occurs when using the migration to Elasticsearch tool, rerun the migration with the <strong><code>-elastic-batch-size</code></strong> flag to lower the batch request size. See the full list of <a href="/pages/nc7qgxnja1nuXj8bS8pq#UUID-9b12a2c4-fbfd-366c-f1b5-d5bb3ee6d965">migration flags</a>.</p> |
| **unable to search on entries**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | By default, indexing entries content is disabled for performance reasons.                                                                                                                  | <p>Set the <strong><code>db.index.entry.disable</code></strong> server configuration to false to enable indexing.</p><p>You can also index notes, changes and evidences for searches only using the <strong><code>granular.index.entries: 1</code></strong> server configuration together with <strong><code>db.index.entry.disable: false</code></strong>.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note</strong></p><p>After making these changes, you will be required to wait for a new month to apply the new mapping. To apply the change to the existing entries you will need to reindex the common-entry\_\* indices.</p></div>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| **too many open files**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | By default, most Linux distributions ship with 1,024 file descriptors allowed per process. This is too low for even an Elasticsearch node that needs to handle hundreds of indices.        | Increase your [file descriptor count](https://www.elastic.co/guide/en/elasticsearch/guide/master/_file_descriptors_and_mmap.html) to 64,000.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><strong>\[400] Failed with error \[1:417] \[bool] failed to parse field \[must]. Other reasons: \[\[{x\_content\_parse\_</strong></p><p><strong>exception \[1:417] \[bool] failed to parse field \[must]}]]</strong></p>                                                                                                                                                                                                                                                                                                                           | Queries with multiple **`or`** conditions, such as **`"id:1 or id:2 or id:3 or id:4 or id:5 or id:6 or id:7 or id:8 or id:9 or id:10"`** may fail when using Elasticsearch v7.14 or later. | Avoid using **`or`** by providing a value list **`"id:(1 2 3...)"`**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| **cannot restore index \[.geoip\_databases] because an open index with same name already exists in the cluster. Either close or delete the existing index or restore the index under a different name by providing a rename pattern and replacement name**                                                                                                                                                                                                                                                                                            | When using Elasticsearch v7.14 or later, you may encounter failures when restoring from snapshots.                                                                                         | Add **`ingest.geoip.downloader.enabled: false`** to your Elasticsearch configuration file.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| <p><strong>ReleasableBytesStream</strong></p><p><strong>Output</strong></p><p><strong>cannot hold more than 2GB of data. Other reasons:</strong></p><p><strong>\[\[{illegal\_argument\_</strong></p><p><strong>exception</strong></p><p><strong>ReleasableBytesStream</strong></p><p><strong>Output</strong></p><p><strong>cannot hold more than 2GB of data}]] ) \[error '\[400] Failed with error:</strong></p><p><strong>ReleasableBytesStream</strong></p><p><strong>Output</strong></p><p><strong>cannot hold more than 2GB of data</strong></p> | If there are insufficient shards, Elasticsearch’s circuit breaker limit may be reached due to the search load.                                                                             | Increase the number of shards. For example, if you have a three-data-nodes cluster, you should have at least two replicas for each active shard, making the data available across all nodes. We also recommend using [nodes stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html) to verify the nodes are balanced for read and write operations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Data too large, data for \[\<xxx>] would be \[xxxx/xxxx], which is larger than the limit of \[xxxxx/xxxxx]**                                                                                                                                                                                                                                                                                                                                                                                                                                        | Elasticsearch's circuit breaker limit is reached due to the load of indexing operations.                                                                                                   | <p>1. Verify you have sufficient <a href="https://www.elastic.co/guide/en/elasticsearch/reference/master/advanced-configuration.html#set-jvm-heap-size">JVM</a>. The Elasticsearch default setting is significantly lower than required.</p><p>2. Verify you have implemented <a href="/pages/EnIT75Cm9LHpGikgjMW0#UUID-ca400e9f-8fc5-023d-3e8e-da306031a64d">Cortex XSOAR best practices</a> for Elasticsearch and set up a sufficient number of primary shards for the heavily used indices.</p><p>3. Verify the cluster is balanced correctly by using <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html">nodes stats</a>. Identify unbalanced nodes that store most or all primary shards, causing node write to queue and causing decreased performance on all shards in the node. In this case, we recommend moving some primary shards to a less busy node and/or adding additional primary shards to ensure the nodes are balancing their resource usage (i.e. CPU, memory and IO).</p>                                                                                                                                                                |
| **HTTP 504 gateway request timeouts**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | HTTP requests are timing out and preventing playbook data from loading in the browser.                                                                                                     | If your high availability servers are behind a load balancer, increase the timeout on your load balancer to 300s.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

**Memory issues**

| Issue                                          | Description                                                                                                                                                                                                                       | Recommendation                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Insufficient JVM memory**                    | The default JVM memory is 1 GB. In production environments, this might be insufficient.                                                                                                                                           | <p>Increase the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html#heap-size-settings">JVM memory</a></p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Note</strong></p><p>You should set the JVM to no more than 50% of <a href="https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html#compressed_oops">total machine memory</a> and not more than 32GB.</p></div> |
| **Insufficient term query size**               | The term query size is used by the bulk edit. The default term query size is 65536 and may be insufficient.                                                                                                                       | Increase the [term query size](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#index-max-terms-count).                                                                                                                                                                                                                                                                                                                                                |
| **Insufficient bulk size**                     | The [bulk size](https://www.elastic.co/guide/en/elasticsearch/reference/current/circuit-breaker.html) depends on the available JVM memory and affects the amount of data that Cortex XSOAR can send and process in Elasticsearch. |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **Heap size**                                  |                                                                                                                                                                                                                                   | The recommended maximum [heap size](https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html) is 50% of the entire server, as long as the other 50% is free.                                                                                                                                                                                                                                                                                                         |
| **Performance issues due to swapping enabled** |                                                                                                                                                                                                                                   | [Disable swapping in Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/master/setup-configuration-memory.html) to improve performance.                                                                                                                                                                                                                                                                                                                              |

**Feed Ingestion Issues**

| Issue              | Description                                                                          | Recommendation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------ | ------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Stack overflow** | In some cases, complex search queries cause Elasticsearch to fail on stack overflow. | <p>Use the following search query syntax: <strong><code>field:(a,b,c …)</code></strong>, which is based on a clause count. In this example, a, b, and c each represent a clause.</p><p>To determine how many clauses a query can contain, set the maximum <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/search-settings.html">clause count</a> and the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/master/mapping.html#mapping-limit-settings">maximum total field count</a> in the <code>elasticsearch.yml</code> file.</p><p><strong>Maximum clause count</strong></p><p>Key:</p><p>For ES 6.0 and later the key is <strong><code>index.query.bool.max\_clause\_count</code></strong>.</p><p>For ES 5.x and earlier the key is <strong><code>indices.query.bool.max\_clause\_count</code></strong>.</p><p>Default: 1,024. You can increase the value.</p><p><strong>Maximum total field count</strong></p><p>Key: <strong><code>index.mapping.total\_fields.limit</code></strong></p><p>Default: 1,000. You can increase the value.</p> |


---

# 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://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.14/onboard-cortex-xsoar/elasticsearch/troubleshoot-elasticsearch.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.
