Elasticsearch error message "all shards failed"

XMLWordPrintable

    • Type: Problem report
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: 7.4.6rc1, 8.0.0alpha2 (master)
    • Component/s: API (A)
    • Environment:
      Elasticsearch version 7.6.2

      Steps to reproduce:

      1. Create Item with item value type text or character.
      2. Create Top items widget
        1. Add created item.
        2. Set Display value as - Numeric
        3. Set Display - Sparkline
        4. Press update

      Result:

      1. Observe error message in widget display mode:
        "Elasticsearch error: all shards failed."
      2. Error message in Elasticsearch log file:
      [2025-12-04T12:00:04,358][DEBUG][o.e.a.s.TransportSearchAction] [zabbix] [text][4], node[-8KKcfQgQsex5j8iIbZnOw], [P], s[STARTED], a[id=cwDdcpobSg-3FKsbDjYfzw]: Failed to execute [SearchRequest{searchType=QUERY_THEN_FETCH, indices=[text*], indicesOptions=IndicesOptions[ignore_unavailable=false, allow_no_indices=true, expand_wildcards_open=true, expand_wildcards_closed=false, allow_aliases_to_multiple_indices=true, forbid_closed_indices=true, ignore_aliases=false, ignore_throttled=true], types=[], routing='null', preference='null', requestCache=null, scroll=null, maxConcurrentShardRequests=0, batchedReduceSize=512, preFilterShardSize=128, allowPartialSearchResults=true, localClusterAlias=null, getOrCreateAbsoluteStartMillis=-1, ccsMinimizeRoundtrips=true, source={"size":0,"query":{"bool":{"must":[{"terms":{"itemid":["69337"],"boost":1.0}},{"range":{"clock":{"from":1764838804,"to":1764842404,"include_lower":true,"include_upper":true,"boost":1.0}}}],"adjust_pure_negative":true,"boost":1.0}},"aggregations":{"group_by_itemid":{"terms":{"field":"itemid","size":1,"min_doc_count":1,"shard_min_doc_count":0,"show_term_doc_count_error":false,"order":[{"_count":"desc"},{"_key":"asc"}]},"aggregations":{"group_by_script":{"terms":{"script":{"source":"Math.round(params.width*(doc['clock'].value.getMillis()/1000-params.time_from)/params.period)","lang":"painless","params":{"period":3600,"time_from":1764838804,"width":475}},"size":475,"min_doc_count":1,"shard_min_doc_count":0,"show_term_doc_count_error":false,"order":[{"_count":"desc"},{"_key":"asc"}]},"aggregations":{"max_value":{"max":{"field":"value"}},"avg_value":{"avg":{"field":"value"}},"min_value":{"min":{"field":"value"}},"max_clock":{"max":{"field":"clock"}}}}}}}}}]
      [2025-12-04T11:30:23,546][DEBUG][o.e.a.s.TransportSearchAction] [zabbix] All shards failed for phase: [query]
      org.elasticsearch.ElasticsearchException$1: Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [value] in order to load field data by uninverting the inverted index. Note that this can use significant memory.

      Expected:
      No error messages.

            Assignee:
            Zabbix Support Team
            Reporter:
            Katerina Kuzmina
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: