mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 04:54:18 +02:00
fix crash
This commit is contained in:
15
TODO.md
15
TODO.md
@@ -6,3 +6,18 @@
|
|||||||
- add datastream support:
|
- add datastream support:
|
||||||
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream
|
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream
|
||||||
|
|
||||||
|
- Fix: cluster status word wrapping adds one \n to much:
|
||||||
|
|
||||||
|
```console
|
||||||
|
Bad health shards_availability This cluster has 1 unavailable replica shard.
|
||||||
|
-> cause Elasticsearch isn't allowed to allocate some shards from these indices to any of the nodes in the
|
||||||
|
|
||||||
|
cluster.
|
||||||
|
-> affected indices foo-t-log-logs-002947
|
||||||
|
-> suggested action to fix Diagnose the issue by calling the allocation explain API for an index [GET
|
||||||
|
|
||||||
|
_cluster/allocation/explain]. Choose a node to which you expect a shard to be allocated, find this
|
||||||
|
|
||||||
|
node in the node-by-node explanation, and address the reasons which prevent Elasticsearch from
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -285,9 +285,11 @@ func IlmExplain(conf *cfg.Config, index string) error {
|
|||||||
|
|
||||||
info := ""
|
info := ""
|
||||||
|
|
||||||
err = json.Unmarshal(ilm.StepInfo["reason"], &info)
|
if len(ilm.StepInfo["reason"]) > 0 {
|
||||||
if err != nil {
|
err = json.Unmarshal(ilm.StepInfo["reason"], &info)
|
||||||
return fmt.Errorf("failed to unmarshal step info: %w", err)
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to unmarshal step info: %w", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
table.Entries = [][]any{
|
table.Entries = [][]any{
|
||||||
@@ -299,8 +301,11 @@ func IlmExplain(conf *cfg.Config, index string) error {
|
|||||||
{"phase", *ilm.Phase},
|
{"phase", *ilm.Phase},
|
||||||
{"phase execution", ilmPhaseString(ilm.PhaseExecution.PhaseDefinition, false)},
|
{"phase execution", ilmPhaseString(ilm.PhaseExecution.PhaseDefinition, false)},
|
||||||
{"step", *ilm.Step},
|
{"step", *ilm.Step},
|
||||||
{"failed step", *ilm.FailedStep},
|
}
|
||||||
{"failed step retry count", ilm.FailedStepRetryCount},
|
|
||||||
|
if ilm.FailedStep != nil {
|
||||||
|
table.AddRow("failed step", *ilm.FailedStep)
|
||||||
|
table.AddRow("failed step retry count", ilm.FailedStepRetryCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := table.Print(); err != nil {
|
if err := table.Print(); err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user