# Kibana X-pack Machine Learning Jobs list could not be retrieved

**URL:** https://discuss.elastic.co/t/kibana-x-pack-machine-learning-jobs-list-could-not-be-retrieved/117501
**Category:** Kibana
**Tags:** elastic-stack-machine-learning
**Created:** [January 29, 2018, 5:15pm UTC](https://discuss.elastic.co/t/kibana-x-pack-machine-learning-jobs-list-could-not-be-retrieved/117501 "2018-01-29T17:15:48Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![thirusama](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@thirusama](https://discuss.elastic.co/u/thirusama)
#### Post date: [January 29, 2018, 5:15pm UTC](https://discuss.elastic.co/t/kibana-x-pack-machine-learning-jobs-list-could-not-be-retrieved/117501/1 "2018-01-29T17:15:48Z")

</div>

**Versions** being used ( all are installed on a single node).  
logstash-6.0.1  
elasticsearch-6.1.1  
kibana-6.1.1-linux-x86\_64

I am getting the error in Machine learning -\> Job Management Page.  
Error: Job list could not be retrieved  
[search\_phase\_execution\_exception] all shards failed

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/4/64dcec99efb17df964bf46a4b8290a85ff27593b.png)

Even If I try to create new Job also, I get below error

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/f/bf1e30db191fabb6f85f3072ddf943fd9a38563a.png)

When I try to get below stuff  
GET /\_xpack/usage  
the output is

```
{
  "error": {
    "root_cause": [],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": []
  },
  "status": 503
}

```

Please let me know how I can debug this. I tried restarting all services, but did not help. Thanks

---

<div class="post-metadata">

### Author: ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)
#### Post date: [January 29, 2018, 6:14pm UTC](https://discuss.elastic.co/t/kibana-x-pack-machine-learning-jobs-list-could-not-be-retrieved/117501/2 "2018-01-29T18:14:18Z")

</div>

What errors are seen in elasticsearch.log when you try to save a job? I suspect the root cause of what's going on will be seen there...

---

<div class="post-metadata">

### Author: ![thirusama](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@thirusama](https://discuss.elastic.co/u/thirusama)
#### Post date: [January 29, 2018, 6:34pm UTC](https://discuss.elastic.co/t/kibana-x-pack-machine-learning-jobs-list-could-not-be-retrieved/117501/3 "2018-01-29T18:34:00Z")

</div>

This is what I am seeing in ealsticsearch.log when I am trying to save the Job.

```
[2018-01-29T11:31:31,389][WARN][r.suppressed] path: /_xpack/ml/anomaly_detectors/testing2, params: {job_id=testing2}
org.elasticsearch.action.search.SearchPhaseExecutionException: all shards failed
        at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:274) ~[elasticsearch
-6.1.1.jar:6.1.1]
        at org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:132) ~[elasticsear
ch-6.1.1.jar:6.1.1]
        at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseDone(AbstractSearchAsyncAction.java:243) ~[elasticsearch-6.
1.1.jar:6.1.1]
        at org.elasticsearch.action.search.InitialSearchPhase.onShardFailure(InitialSearchPhase.java:107) ~[elasticsearch-6.1.1.jar:6.1
.1]
        at org.elasticsearch.action.search.InitialSearchPhase.lambda$performPhaseOnShard$4(InitialSearchPhase.java:205) ~[elasticsearch
-6.1.1.jar:6.1.1]
        at org.elasticsearch.action.search.InitialSearchPhase$1.doRun(InitialSearchPhase.java:184) ~[elasticsearch-6.1.1.jar:6.1.1]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:637) [elas
ticsearch-6.1.1.jar:6.1.1]
        at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.1.1.jar:6.1.1]
        at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:41) [elasticsearch-6.1.1.jar:6.1.1]
        at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.1.1.jar:6.1.1]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_151]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_151]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
[2018-01-29T11:31:31,639][DEBUG][o.e.a.s.TransportSearchAction] [8QF1u_C] All shards failed for phase: [query]
[2018-01-29T11:31:31,641][ERROR][o.e.x.m.c.c.ClusterStatsCollector] [8QF1u_C] collector [cluster_stats] failed to collect data
org.elasticsearch.action.search.SearchPhaseExecutionException: all shards failed
        at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:274) ~[elasticsearch
-6.1.1.jar:6.1.1]
        at org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:132) ~[elasticsear
ch-6.1.1.jar:6.1.1]
        at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseDone(AbstractSearchAsyncAction.java:243) ~[elasticsearch-6.
1.1.jar:6.1.1]

[2018-01-29T11:31:31,647][DEBUG][o.e.a.s.TransportSearchAction] [8QF1u_C] All shards failed for phase: [query]
[2018-01-29T11:31:31,831][DEBUG][o.e.a.s.TransportSearchAction] [8QF1u_C] All shards failed for phase: [query]
[2018-01-29T11:31:31,832][DEBUG][o.e.a.s.TransportSearchAction] [8QF1u_C] All shards failed for phase: [query]
[2018-01-29T11:31:31,831][ERROR][o.e.x.m.c.m.JobStatsCollector] [8QF1u_C] collector [job_stats] failed to collect data
org.elasticsearch.action.search.SearchPhaseExecutionException: all shards failed
```

---

<div class="post-metadata">

### Author: ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)
#### Post date: [January 29, 2018, 6:42pm UTC](https://discuss.elastic.co/t/kibana-x-pack-machine-learning-jobs-list-could-not-be-retrieved/117501/4 "2018-01-29T18:42:31Z")

</div>

Hmm...this seems to me that something fundamental to elasticsearch is not working (not just ML). Are you actively using this cluster for other things or did you stand this up just to test ML?

What do you see when your run the following in Console (Dev Tools):?

`GET _cluster/health`

---

<div class="post-metadata">

### Author: ![thirusama](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@thirusama](https://discuss.elastic.co/u/thirusama)
#### Post date: [January 29, 2018, 6:46pm UTC](https://discuss.elastic.co/t/kibana-x-pack-machine-learning-jobs-list-could-not-be-retrieved/117501/5 "2018-01-29T18:46:25Z")

</div>

We mainly want to explore ML features, so built this node and installed all here. Regular Discover/Visualization, ingestion of data using logstash is working fine.

This is what I get when I run `GET _cluster/health`

```
{
  "cluster_name": "elasticsearch",
  "status": "red",
  "timed_out": false,
  "number_of_nodes": 1,
  "number_of_data_nodes": 1,
  "active_primary_shards": 824,
  "active_shards": 824,
  "relocating_shards": 0,
  "initializing_shards": 0,
  "unassigned_shards": 833,
  "delayed_unassigned_shards": 0,
  "number_of_pending_tasks": 0,
  "number_of_in_flight_fetch": 0,
  "task_max_waiting_in_queue_millis": 0,
  "active_shards_percent_as_number": 49.728424864212435
}
```

---

<div class="post-metadata">

### Author: ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)
#### Post date: [January 29, 2018, 6:51pm UTC](https://discuss.elastic.co/t/kibana-x-pack-machine-learning-jobs-list-could-not-be-retrieved/117501/6 "2018-01-29T18:51:39Z")

</div>

Glad to hear you're interested in ML!

Unfortunately, your cluster status is red and that will certainly hinder things...you'll need to figure out why that's the case before I can help. Perhaps restart elasticsearch and watch the logging for reasons why the cluster won't go into at least a yellow state.

---

<div class="post-metadata">

### Author: ![thirusama](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@thirusama](https://discuss.elastic.co/u/thirusama)
#### Post date: [January 29, 2018, 6:54pm UTC](https://discuss.elastic.co/t/kibana-x-pack-machine-learning-jobs-list-could-not-be-retrieved/117501/7 "2018-01-29T18:54:40Z")

</div>

Ok, Thanks for your response. I am doubting it could be because of no.of shards, as we have a single node. Any pointers to debug in that route? How can I delete all the data (and indices/shards) and start from scratch?

---

<div class="post-metadata">

### Author: ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)
#### Post date: [January 29, 2018, 6:56pm UTC](https://discuss.elastic.co/t/kibana-x-pack-machine-learning-jobs-list-could-not-be-retrieved/117501/8 "2018-01-29T18:56:38Z")

</div>

Yes you have a lot of shards, half of which are unassigned.

If you want to delete all the data and start again:

1. stop elasticsearch
2. rm -rf /path/to/elasticsearch/data
3. start elasticsearch

---

<div class="post-metadata">

### Author: ![thirusama](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@thirusama](https://discuss.elastic.co/u/thirusama)
#### Post date: [January 29, 2018, 8:55pm UTC](https://discuss.elastic.co/t/kibana-x-pack-machine-learning-jobs-list-could-not-be-retrieved/117501/9 "2018-01-29T20:55:21Z")

</div>

Thanks. For now this has fixed my issue.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [January 30, 2018, 12:22am UTC](https://discuss.elastic.co/t/kibana-x-pack-machine-learning-jobs-list-could-not-be-retrieved/117501/10 "2018-01-30T00:22:58Z")

</div>

You can also use `curl -XDELETE HOST:9200/*` to remove _all_ indices. It's a bit safer than removing things from the filesystem as well 🙂

---

<div class="post-metadata">

### Author: ![thirusama](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@thirusama](https://discuss.elastic.co/u/thirusama)
#### Post date: [January 30, 2018, 4:38pm UTC](https://discuss.elastic.co/t/kibana-x-pack-machine-learning-jobs-list-could-not-be-retrieved/117501/11 "2018-01-30T16:38:52Z")

</div>

Thanks @warkolm Good to know

---

<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: [February 27, 2018, 4:38pm UTC](https://discuss.elastic.co/t/kibana-x-pack-machine-learning-jobs-list-could-not-be-retrieved/117501/12 "2018-02-27T16:38:54Z")

</div>

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