# Faulty Discover, Shard Loading Problem In Kibana 7.6

**URL:** <https://discuss.elastic.co/t/faulty-discover-shard-loading-problem-in-kibana-7-6/238487>\
**Category:** Kibana\
**Created:** [June 24, 2020, 1:30pm UTC](https://discuss.elastic.co/t/faulty-discover-shard-loading-problem-in-kibana-7-6/238487 "2020-06-24T13:30:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ethan777100](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethan777100/32/70366_2.png) [@Ethan777100](https://discuss.elastic.co/u/Ethan777100)\
**Post date:** [June 24, 2020, 1:30pm UTC](https://discuss.elastic.co/t/faulty-discover-shard-loading-problem-in-kibana-7-6/238487/1 "2020-06-24T13:30:53Z")

</div>

Just 2 hours ago, I could sucessfully pull out all my data for that same time range. Now i can't, it gives me Shard failure and idk whats happening.

The distinguishing point is that Discover only started to behave like this after i introduced my own Scripted Field (valid one), into the picture.

The Discover function is very buggy and needs to be looked into!

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/e/5e953150e08a5ab1cc17bc5928b034c694055409.png)

---

<div class="post-metadata">

**Author:** ![matw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matw/32/13913_2.png) [@matw](https://discuss.elastic.co/u/matw)\
**Post date:** [June 24, 2020, 3:30pm UTC](https://discuss.elastic.co/t/faulty-discover-shard-loading-problem-in-kibana-7-6/238487/2 "2020-06-24T15:30:34Z")

</div>

Hi  
could you share what is displayed when you click on `Show details` ? might be the case that there's a case when your scripted field is failing, could you share the field's source?

Many thx & Best,  
Matthias

---

<div class="post-metadata">

**Author:** ![Ethan777100](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethan777100/32/70366_2.png) [@Ethan777100](https://discuss.elastic.co/u/Ethan777100)\
**Post date:** [June 24, 2020, 3:32pm UTC](https://discuss.elastic.co/t/faulty-discover-shard-loading-problem-in-kibana-7-6/238487/3 "2020-06-24T15:32:40Z")

</div>

Cant click on Show Details, nothing pops up...so i met a dead end to finding out root causes.

Anyway i deleted my scripted field alr. which solves the problem. Now my colleagues advised me to never use scripted field again.

How about u try preparing a scripted field on your end? Mine actually worked, it produced the legit result i wanted. It was just a simple addition of +5 to one of my existing cols.

But once u go into Discover, this happens.

However, in Kibana 7.7.1 i dont see this issue occuring. I have 1 scripted field over there tooo.

---

<div class="post-metadata">

**Author:** ![matw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matw/32/13913_2.png) [@matw](https://discuss.elastic.co/u/matw)\
**Post date:** [June 24, 2020, 3:46pm UTC](https://discuss.elastic.co/t/faulty-discover-shard-loading-problem-in-kibana-7-6/238487/4 "2020-06-24T15:46:33Z")

</div>

Hi

Sorry to hear, anyway generally scripted fields work, but they might fail when e.g. an expected property of a doc is missing. Could you share you scripted field's code? then I could help detecting the cause for the problem.

Thx a lot! Best,  
Matthias

---

<div class="post-metadata">

**Author:** ![Ethan777100](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethan777100/32/70366_2.png) [@Ethan777100](https://discuss.elastic.co/u/Ethan777100)\
**Post date:** [June 24, 2020, 3:47pm UTC](https://discuss.elastic.co/t/faulty-discover-shard-loading-problem-in-kibana-7-6/238487/5 "2020-06-24T15:47:44Z")

</div>

doc['Length'].value + 5

anw idk why...my results all rounded to nearest whole number. My 'Length" was in 3dp btw.

---

<div class="post-metadata">

**Author:** ![matw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matw/32/13913_2.png) [@matw](https://discuss.elastic.co/u/matw)\
**Post date:** [June 25, 2020, 10:19am UTC](https://discuss.elastic.co/t/faulty-discover-shard-loading-problem-in-kibana-7-6/238487/6 "2020-06-25T10:19:12Z")

</div>

Hi  
Let's first fix the script problem. Might be the case that there are docs without 'Length' causing a shard error. So to be safe you should code it like this:

```
if(doc.containsKey('Length')) {
 return doc['Length'].value + 5;
else {
  return 0;

```

}

If there's still an error and `Show details doesn't work` you could have a look in the Browsers console or network tab of the [Developer tools](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools), there should be more info about this.

Best,  
Matthias

---

<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:** [July 23, 2020, 10:19am UTC](https://discuss.elastic.co/t/faulty-discover-shard-loading-problem-in-kibana-7-6/238487/7 "2020-07-23T10:19:27Z")

</div>

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