# Fetching error from APM

**URL:** <https://discuss.elastic.co/t/fetching-error-from-apm/264975>\
**Category:** APM\
**Tags:** docker, ui\
**Created:** [February 21, 2021, 7:41am UTC](https://discuss.elastic.co/t/fetching-error-from-apm/264975 "2021-02-21T07:41:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![akoua\_yao\_alex\_didie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akoua_yao_alex_didie/32/79012_2.png) [@akoua\_yao\_alex\_didie](https://discuss.elastic.co/u/akoua_yao_alex_didie)\
**Post date:** [February 21, 2021, 7:41am UTC](https://discuss.elastic.co/t/fetching-error-from-apm/264975/1 "2021-02-21T07:41:56Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

TIP 1: select at least one tag that further categorizes your topic. For example `server` for APM Server related questions, `java` for questions regarding the Elastic APM Java agent, or `ui` for questions about the APM App within Kibana.

TIP 2: Check out the [troubleshooting guide](https://www.elastic.co/guide/en/apm/get-started/current/troubleshooting.html) first. Not only will it help you to resolve common problems faster but it also explains in more detail which information we need before we can properly help you.

**Kibana version** : 7.10.2

**Elasticsearch version** : 7.10.2

**APM Server version** : 7.10.2

**APM Agent language and version** : java 1.20.0

**Browser version** : Google Chrome 88.0.4324.182 (Build officiel) (x86\_64)

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: docker

**Fresh install or upgraded from other version?**

**Is there anything special in your setup?** I'have not change anything

**Description of the problem including expected versus actual behavior. Please include screenshots  
(if relevant)**: I got this error in Observability An error happened when trying to fetch data. Please try again

**Steps to reproduce** :  
1.  
2.  
3.

**Errors in browser console (if relevant)**:  
`{"type":"log","@timestamp":"2021-02-21T06:47:20Z","tags":["error","http"],"pid":7,"message":"{ Error: [illegal_argument_exception] 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 [service.name] in order to load field data by uninverting the inverted index. Note that this can use significant memory.\n at respond (/usr/share/kibana/node_modules/elasticsearch/src/lib/transport.js:349:15)\n at checkRespForFailure (/usr/share/kibana/node_modules/elasticsearch/src/lib/transport.js:306:7)\n at HttpConnector.<anonymous> (/usr/share/kibana/node_modules/elasticsearch/src/lib/connectors/http.js:173:7)\n at IncomingMessage.wrapper (/usr/share/kibana/node_modules/lodash/lodash.js:4949:19)\n at IncomingMessage.emit (events.js:203:15)\n at endReadableNT (_stream_readable.js:1145:12)\n at process._tickCallback (internal/process/next_tick.js:63:19)\n status: 400,\n displayName: 'BadRequest',\n message:\n '[illegal_argument_exception] 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 [service.name] in order to load field data by uninverting the inverted index. Note that this can use significant memory.',\n path: '/apm-*%2Capm-*%2Capm-*/_search',\n query: { ignore_throttled: true },\n body:\n { error:\n { root_cause: [Array],\n type: 'search_phase_execution_exception',\n reason: 'all shards failed',\n phase: 'query',\n grouped: true,\n failed_shards: [Array],\n caused_by: [Object] },\n status: 400 },\n statusCode: 400,\n response:\n '{\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"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 [service.name] in order to load field data by uninverting the inverted index. Note that this can use significant memory.\"}],\"type\":\"search_phase_execution_exception\",\"reason\":\"all shards failed\",\"phase\":\"query\",\"grouped\":true,\"failed_shards\":[{\"shard\":0,\"index\":\"apm-7.10.2\",\"node\":\"iFgmSRLISUu8nAucOcx1Iw\",\"reason\":{\"type\":\"illegal_argument_exception\",\"reason\":\"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 [service.name] in order to load field data by uninverting the inverted index. Note that this can use significant memory.\"}}],\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"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 [service.name] in order to load field data by uninverting the inverted index. Note that this can use significant memory.\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"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 [service.name] in order to load field data by uninverting the inverted index. Note that this can use significant memory.\"}}},\"status\":400}',\n toString: [Function],\n toJSON: [Function] }"}`

**Provide logs and/or server output (if relevant)**:

 ![Capture d’écran 2021-02-21 à 07.02.30](https://us1.discourse-cdn.com/elastic/original/3X/7/6/760e614aebb2a6ef1ecc811594eb09f86f521a56.png) ![Capture d’écran 2021-02-21 à 07.03.09](https://us1.discourse-cdn.com/elastic/original/3X/2/4/244978bd9ad34ec010d4905178b38e1f7b445b1b.png)

---

<div class="post-metadata">

**Author:** ![akoua\_yao\_alex\_didie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akoua_yao_alex_didie/32/79012_2.png) [@akoua\_yao\_alex\_didie](https://discuss.elastic.co/u/akoua_yao_alex_didie)\
**Post date:** [February 23, 2021, 5:12am UTC](https://discuss.elastic.co/t/fetching-error-from-apm/264975/3 "2021-02-23T05:12:57Z")

</div>

I remove docker volume and all right. I think it's index error.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 16, 2021, 1:13am UTC](https://discuss.elastic.co/t/fetching-error-from-apm/264975/4 "2021-03-16T01:13:20Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![gose](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gose/32/37875_2.png) [@gose](https://discuss.elastic.co/u/gose)\
**Post date:** [August 21, 2021, 5:53pm UTC](https://discuss.elastic.co/t/fetching-error-from-apm/264975/5 "2021-08-21T17:53:06Z")

</div>

For anyone else seeing this error:

> "An error happened when trying to fetch data. Please try again"

I fixed it by loading the Heartbeat index template, and then deleting any `heartbeat-*` indices.

> **[Load the Elasticsearch index template | Heartbeat Reference \[8.11\] | Elastic](https://www.elastic.co/guide/en/beats/heartbeat/current/heartbeat-template.html#load-template-manually-alternate)**
