-
Notifications
You must be signed in to change notification settings - Fork 159
[DOCS] Opster Migration: Add errors to troubleshooting pages #1116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
b39271a
af93f7c
ef42b33
0d4ece4
2c139cb
ef1386e
821f873
cf6b31d
4e8b542
3aa17fc
b0a7c49
2bb12d6
9c3da7c
15f8b70
4c0dc4b
983d746
078c46f
ac184da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
--- | ||
applies_to: | ||
stack: | ||
deployment: | ||
eck: | ||
ess: | ||
ece: | ||
self: | ||
navigation_title: "Error: all shards failed" | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
# is mapped_pages needed for newly created docs? | ||
--- | ||
|
||
# Fix all shards failed error [all-shards-failed] | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
``` | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Error: all shards failed | ||
``` | ||
|
||
This error indicates that {{es}} failed to retrieve a response from any shard involved in a query. This can result from shard allocation issues, misconfiguration, insufficient resources, or unsupported operations such as aggregating on text fields. | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
## Improper use of text fields | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
Text fields aren't optimized for operations like sorting or aggregations by default. Attempting these operations may trigger the error. | ||
|
||
To fix, use the `.keyword` sub-field: | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
```console | ||
GET my-index/_search | ||
{ | ||
"aggs": { | ||
"names": { | ||
"terms": { | ||
"field": "name.keyword" | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
If no `.keyword` sub-field exists, update the mapping to handle [multi-fields](elasticsearch://reference/elasticsearch/mapping-reference/field-data-types.md): | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
```console | ||
PUT my-index | ||
{ | ||
"mappings": { | ||
"properties": { | ||
"name": { | ||
"type": "text", | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Metric aggregations on text fields | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
[Metric aggregations](elasticsearch://reference/aggregations/metrics.md) require numeric fields. Attempting them on text fields will fail. | ||
|
||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Use a script to convert the text to numeric: | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
```console | ||
GET my-index/_search | ||
{ | ||
"aggs": { | ||
"total_cost": { | ||
"sum": { | ||
"script": { | ||
"source": "Integer.parseInt(doc.cost.value)" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Or change the field mapping to a numeric type: | ||
|
||
```console | ||
PUT my-index | ||
{ | ||
"mappings": { | ||
"properties": { | ||
"cost": { | ||
"type": "integer" | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Failed shard recovery | ||
|
||
A shard failure during recovery can prevent successful queries. | ||
|
||
To confirm, check cluster health: | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
```console | ||
GET _cluster/health | ||
``` | ||
|
||
Identify and resolve the cause. If necessary, and as a last resort, delete the problematic index. | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
## Misused global aggregation | ||
marciw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[Global aggregations](elasticsearch://reference/aggregations/search-aggregations-bucket-global-aggregation.md) must be top-level. Nesting them incorrectly causes errors. | ||
|
||
To fix, structure the query so the `global` aggregation is top-level: | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
```console | ||
GET my-index/_search | ||
{ | ||
"size": 0, | ||
"aggs": { | ||
"all_products": { | ||
"global": {}, | ||
"aggs": { | ||
"genres": { | ||
"terms": { | ||
"field": "cost" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Reverse_nested usage errors | ||
|
||
The [reverse_nested](elasticsearch://reference/aggregations/search-aggregations-bucket-reverse-nested-aggregation.md) aggregation must appear within a `nested` context. | ||
|
||
To fix, structure the query so the `reverse_nested` aggregation is within a `nested` context: | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
```console | ||
GET my-index/_search | ||
{ | ||
"aggs": { | ||
"comments": { | ||
"nested": { | ||
"path": "comments" | ||
}, | ||
"aggs": { | ||
"top_usernames": { | ||
"terms": { | ||
"field": "comments.username" | ||
}, | ||
"aggs": { | ||
"comment_issue": { | ||
"reverse_nested": {}, | ||
"aggs": { | ||
"top_tags": { | ||
"terms": { | ||
"field": "tags" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Further troubleshooting | ||
|
||
Use the `_cat/shards` API to view shard status and troubleshoot further. | ||
|
||
```console | ||
GET _cat/shards | ||
``` | ||
|
||
For a specific index: | ||
|
||
```console | ||
GET _cat/shards/my-index | ||
``` | ||
|
||
Example output: | ||
|
||
```console-result | ||
my-index 5 p STARTED 0 283b 127.0.0.1 ziap | ||
my-index 5 r UNASSIGNED | ||
my-index 2 p STARTED 1 3.7kb 127.0.0.1 ziap | ||
my-index 2 r UNASSIGNED | ||
my-index 3 p STARTED 3 7.2kb 127.0.0.1 ziap | ||
my-index 3 r UNASSIGNED | ||
my-index 1 p STARTED 1 3.7kb 127.0.0.1 ziap | ||
my-index 1 r UNASSIGNED | ||
my-index 4 p STARTED 2 3.8kb 127.0.0.1 ziap | ||
my-index 4 r UNASSIGNED | ||
my-index 0 p STARTED 0 283b 127.0.0.1 ziap | ||
my-index 0 r UNASSIGNED | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
navigation_title: Errors | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
--- | ||
|
||
# Troubleshoot errors in {{es}} | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
Use the topics in this section to troubleshoot errors in your {{es}} deployments. | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
* [](/troubleshoot/elasticsearch/all-shards-failed.md) | ||
* [](/troubleshoot/elasticsearch/failed-to-parse-field-of-type.md) | ||
* [](/troubleshoot/elasticsearch/unable-to-retrieve-node-fs-stats.md) | ||
* [](/troubleshoot/elasticsearch/unable-to-parse-response-body.md) | ||
* [](/troubleshoot/elasticsearch/updating-number-of-replicas-to-for-indices.md) | ||
* [](/troubleshoot/elasticsearch/memory-locking-error.md) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,65 @@ | ||||||
--- | ||||||
applies_to: | ||||||
stack: | ||||||
deployment: | ||||||
eck: | ||||||
ess: | ||||||
ece: | ||||||
self: | ||||||
navigation_title: "Error: failed to parse field of type in document with id" | ||||||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
# is mapped_pages needed for newly created docs? | ||||||
--- | ||||||
|
||||||
# Fix failed to parse field of type in document with id [failed-to-parse-field-of-type] | ||||||
|
# Fix failed to parse field of type in document with id [failed-to-parse-field-of-type] | |
# Fix error: Failed to parse field [failed-to-parse-field-of-type] |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error occurs when you try to index a document into an existing index, and one of your fields' values doesn't match the expected data type. {{es}} rejects the document when it encounters incompatible values, like a string in a numeric field or an invalid IP address. | |
This error occurs when you try to index a document, but one of the field values doesn't match the expected data type. {{es}} rejects the document when it encounters incompatible values, like a string in a numeric field or an invalid IP address. |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix, ensure the field's value matches the expected data type in the mapping. | |
To fix this issue, make sure each field value matches the data type defined in the mapping. |
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
|
||
applies_to: | ||
stack: | ||
deployment: | ||
eck: | ||
ess: | ||
ece: | ||
self: | ||
navigation_title: "Error: memory locking requested for elasticsearch process but memory is not locked" | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
# is mapped_pages needed for newly created docs? | ||
thekofimensah marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
--- | ||
|
||
# Fix memory locking error in Elasticsearch [memory-locking-error] | ||
|
||
```console | ||
Error: memory locking requested for elasticsearch process but memory is not locked | ||
``` | ||
|
||
|
||
This error indicates that {{es}} attempted to lock its memory to prevent swapping but failed. Swapping can severely impact performance and stability by introducing large garbage collection (GC) pauses. | ||
|
||
You can fix this by reviewing your memory swapping options, and adjust as needed. | ||
|
||
## What it means | ||
|
||
{{es}} uses the `bootstrap.memory_lock: true` setting to request that its memory be locked into RAM, preventing the OS from swapping it to disk. If this lock fails due to missing system permissions or improper configuration, {{es}} logs this error. | ||
|
||
## How to resolve it | ||
|
||
1. **Enable memory lock in configuration**: | ||
|
||
Edit `elasticsearch.yml` and set: | ||
|
||
```yaml | ||
bootstrap.memory_lock: true | ||
``` | ||
2. **Verify the memory lock status**: | ||
Run the following: | ||
```console | ||
GET _nodes?filter_path=**.mlockall | ||
``` | ||
|
||
A successful configuration will return: | ||
|
||
```json | ||
{ | ||
"nodes" : { | ||
"<node_id>" : { | ||
"process" : { | ||
"mlockall" : true | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
If the value is `false`, further [system-level configuration](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration-memory.html) is required. |
Uh oh!
There was an error while loading. Please reload this page.