# Impossible de collecter des données Elasticsearch No Shard Available Action Exception

**URL:** <https://discuss.elastic.co/t/impossible-de-collecter-des-donnees-elasticsearch-no-shard-available-action-exception/194254>\
**Category:** Discussions en français\
**Created:** [August 7, 2019, 2:07pm UTC](https://discuss.elastic.co/t/impossible-de-collecter-des-donnees-elasticsearch-no-shard-available-action-exception/194254 "2019-08-07T14:07:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ROok](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@ROok](https://discuss.elastic.co/u/ROok)\
**Post date:** [August 7, 2019, 2:07pm UTC](https://discuss.elastic.co/t/impossible-de-collecter-des-donnees-elasticsearch-no-shard-available-action-exception/194254/1 "2019-08-07T14:07:12Z")

</div>

Bonjour,  
En fait lorsque j'essaie de collecter des données sur logstash, ils arrivent pas sur elasticsearch et j'obtient l'erreur suivante dans elasticsearch.log :

[r.suppressed] [[mondomaine.fr](http://mondomaine.fr)] path: /.kibana/\_doc/space%3Adefault, params: {index=.kibana, id=space:default}  
org.elasticsearch.action.NoShardAvailableActionException: No shard available for [get [.kibana][\_doc][space:default]: routing [null]]

Alors que quand je fais un systemctl status elasticsearch il me montre pas d'erreur ni sur elasticsearch ni sur logstash . Sachant que j'arrivais bien à collecter des données.  
sur logstash j'obtient cela :

Sending Logstash logs to /var/log/logstash which is now configured via log4j2.properties  
[2019-08-07T15:32:02,489][WARN][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified  
[2019-08-07T15:32:02,611][INFO][logstash.runner] Starting Logstash {"logstash.version"=\>"7.1.1"}  
[2019-08-07T15:32:31,172][INFO][logstash.outputs.elasticsearch] Elasticsearch pool URLs updated {:changes=\>{:removed=\>, :added=\>[[http://localhost:9200/](http://localhost:9200/)]}}  
[2019-08-07T15:32:31,571][WARN][logstash.outputs.elasticsearch] Restored connection to ES instance {:url=\>"[http://localhost:9200/](http://localhost:9200/)"}  
[2019-08-07T15:32:31,854][INFO][logstash.outputs.elasticsearch] ES Output version determined {:es\_version=\>7}  
[2019-08-07T15:32:31,861][WARN][logstash.outputs.elasticsearch] Detected a 6.x and above cluster: the `type` event field won't be used to determine the document \_type {:es\_version=\>7}  
[2019-08-07T15:32:31,951][INFO][logstash.outputs.elasticsearch] New Elasticsearch output {:class=\>"LogStash::Outputs::ElasticSearch", :hosts=\>["[//localhost:9200](https://localhost:9200)"]}  
[2019-08-07T15:32:31,968][INFO][logstash.outputs.elasticsearch] Using default mapping template  
[2019-08-07T15:32:32,095][INFO][logstash.javapipeline] Starting pipeline {:pipeline\_id=\>"main", "pipeline.workers"=\>2, "pipeline.batch.size"=\>125, "pipeline.batch.delay"=\>50, "pipeline.max\_inflight"=\>250, :thread=\>"#\<Thread:0x5101b747 run\>"}  
[2019-08-07T15:32:32,326][INFO][logstash.outputs.elasticsearch] Attempting to install template {:manage\_template=\>{"index\_patterns"=\>"logstash-_", "version"=\>60001, "settings"=\>{"index.refresh\_interval"=\>"5s", "number\_of\_shards"=\>1}, "mappings"=\>{"dynamic\_templates"=\>[{"message\_field"=\>{"path\_match"=\>"message", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false}}}, {"string\_fields"=\>{"match"=\>"_", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false, "fields"=\>{"keyword"=\>{"type"=\>"keyword", "ignore\_above"=\>256}}}}}], "properties"=\>{"@timestamp"=\>{"type"=\>"date"}, "@version"=\>{"type"=\>"keyword"}, "geoip"=\>{"dynamic"=\>true, "properties"=\>{"ip"=\>{"type"=\>"ip"}, "location"=\>{"type"=\>"geo\_point"}, "latitude"=\>{"type"=\>"half\_float"}, "longitude"=\>{"type"=\>"half\_float"}}}}}}}  
[2019-08-07T15:32:33,235][INFO][logstash.inputs.file] No sincedb\_path set, generating one based on the "path" setting {:sincedb\_path=\>"/var/lib/logstash/plugins/inputs/file/.sincedb\_b48f39ed4259efb6b2b0c39cd2786443", :path=\>["/home/osadmin/test"]}  
[2019-08-07T15:32:33,292][INFO][logstash.javapipeline] Pipeline started {"pipeline.id"=\>"main"}  
[2019-08-07T15:32:33,512][INFO][filewatch.observingtail] START, creating Discoverer, Watch with file and sincedb collections  
[2019-08-07T15:32:33,621][INFO][logstash.agent] Pipelines running {:count=\>1, :running\_pipelines=\>[:main], :non\_running\_pipelines=\>}  
[2019-08-07T15:32:35,169][INFO][logstash.agent] Successfully started Logstash API endpoint {:port=\>9600}

J'aimerais bien comprendre d'où vient cette erreur et comment la corriger.

Je vous remercie par avance

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [August 7, 2019, 2:13pm UTC](https://discuss.elastic.co/t/impossible-de-collecter-des-donnees-elasticsearch-no-shard-available-action-exception/194254/2 "2019-08-07T14:13:31Z")

</div>

Peux tu partager les logs de la commande suivante

```
GET _cat/shards?v
our directement via http://localhost:9200/_cat/shards?v

```

Aussi cette commande

```
POST _cluster/allocation/explain 
{
  "index": ".kibana",
  "shard": 0,
  "primary": true
}
```

---

<div class="post-metadata">

**Author:** ![ROok](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@ROok](https://discuss.elastic.co/u/ROok)\
**Post date:** [August 7, 2019, 2:34pm UTC](https://discuss.elastic.co/t/impossible-de-collecter-des-donnees-elasticsearch-no-shard-available-action-exception/194254/3 "2019-08-07T14:34:19Z")

</div>

Salut Yassine ,  
Merci pour le retour

Donc voici le resultat des commandes  
http:/localhost:9200/\_cat/shards?v

index shard prirep state docs store ip node  
.monitoring-es-7-2019.08.07 0 p STARTED 140101 123.7mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
filebeat-7.1.1-2019.07.26 0 p STARTED 853 4.4mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
filebeat-7.1.1-2019.07.26 0 r UNASSIGNED  
.monitoring-kibana-7-2019.08.06 0 p STARTED 8639 1.9mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
.monitoring-kibana-7-2019.08.01 0 p STARTED 8639 2mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
.monitoring-es-7-2019.08.04 0 p STARTED 251350 123.3mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
.monitoring-kibana-7-2019.08.02 0 p STARTED 8639 2mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
.monitoring-es-7-2019.08.05 0 p STARTED 267186 145.6mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
.kibana\_task\_manager 0 p STARTED 2 46.4kb localhost [elk.labgei.fr](http://elk.labgei.fr)  
.monitoring-es-7-2019.08.01 0 p STARTED 234074 137.8mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
.monitoring-kibana-7-2019.08.05 0 p STARTED 8635 1.9mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
.monitoring-es-7-2019.08.06 0 p STARTED 260908 130.6mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
filebeat-7.1.1-2019.07.17 0 p STARTED 288789 151.6mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
filebeat-7.1.1-2019.07.17 0 r UNASSIGNED  
.monitoring-kibana-7-2019.08.07 0 p STARTED 5129 1.9mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
kibana\_sample\_data\_flights 0 p STARTED 13059 6.5mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
.monitoring-es-7-2019.08.03 0 p STARTED 251320 123.6mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
.monitoring-kibana-7-2019.08.03 0 p STARTED 8639 1.9mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
filebeat-7.1.1-2019.07.31 0 p STARTED 1 55.8kb localhost [elk.labgei.fr](http://elk.labgei.fr)  
filebeat-7.1.1-2019.07.31 0 r UNASSIGNED  
filebeat-7.1.1-2019.07.18 0 p STARTED 378585 196.1mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
filebeat-7.1.1-2019.07.18 0 r UNASSIGNED  
.monitoring-es-7-2019.08.02 0 p STARTED 250655 125.9mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
.kibana\_1 0 p STARTED 69 115.9kb localhost [elk.labgei.fr](http://elk.labgei.fr)  
.monitoring-kibana-7-2019.08.04 0 p STARTED 8638 1.9mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
filebeat-7.1.1-2019.07.30 0 p STARTED 1626 1.1mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
filebeat-7.1.1-2019.07.30 0 r UNASSIGNED  
filebeat-7.1.1-2019.07.25 0 p STARTED 1747 1.6mb localhost [elk.labgei.fr](http://elk.labgei.fr)  
filebeat-7.1.1-2019.07.25 0 r UNASSIGNED

Pour la commande POST \_cluster/allocation/explain

{"index":"filebeat-7.1.1-2019.07.26","shard":0,"primary":false,"current\_state":"unassigned","unassigned\_info":{"reason":"CLUSTER\_RECOVERED","at":"2019-08-07T08:08:27.490Z","last\_allocation\_status":"no\_attempt"},"can\_allocate":"no","allocate\_explanation":"cannot allocate because allocation is not permitted to any of the nodes","node\_allocation\_decisions":[{"node\_id":"wt1E07FYQ9KryRA0gBhnxA","node\_name":"[elk.labgei.fr](http://elk.labgei.fr)","transport\_address":"localhost:9300","node\_attributes":{"ml.machine\_memory":"3973926912","xpack.installed":"true","ml.max\_open\_jobs":"20"},"node\_decision":"no","deciders":[{"decider":"same\_shard","decision":"NO","explanation":"the shard cannot be allocated to the same node on which a copy of the shard already exists [[filebeat-7.1.1-2019.07.26][0], node[wt1E07FYQ9KryRA0gBhnxA], [P], s[STARTED], a[id=oG6Z52rETN62gp2QG640Zg]]"}]}]}curl: (3) [globbing] unmatched brace at pos 2  
curl: (6) Could not resolve host: index; Name or service not known  
curl: (6) Could not resolve host: .kibana,; Name or service not known  
bash: shard:: command not found  
bash: primary:: command not found

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [August 7, 2019, 3:09pm UTC](https://discuss.elastic.co/t/impossible-de-collecter-des-donnees-elasticsearch-no-shard-available-action-exception/194254/4 "2019-08-07T15:09:10Z")

</div>

Peux-tu décrire votre cluster (combien de noeuds, shards, replicas, ...) ?

---

<div class="post-metadata">

**Author:** ![ROok](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@ROok](https://discuss.elastic.co/u/ROok)\
**Post date:** [August 8, 2019, 7:24am UTC](https://discuss.elastic.co/t/impossible-de-collecter-des-donnees-elasticsearch-no-shard-available-action-exception/194254/5 "2019-08-08T07:24:49Z")

</div>

Voici la description du cluster

{  
"cluster\_name" : "elasticsearch",  
"status" : "yellow",  
"timed\_out" : false,  
"number\_of\_nodes" : 1,  
"number\_of\_data\_nodes" : 1,  
"active\_primary\_shards" : 23,  
"active\_shards" : 23,  
"relocating\_shards" : 0,  
"initializing\_shards" : 0,  
"unassigned\_shards" : 6,  
"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" : 79.3103448275862  
}

C'est cela que j'obtient aussi sur elasticsearch.log si ça peu être utile

[2019-08-07T10:08:28,706][WARN][r.suppressed] [[elk.labgei.fr](http://elk.labgei.fr)] path: /.kibana/\_doc/space%3Adefault, params: {index=.kibana, id=space:default}  
org.elasticsearch.action.NoShardAvailableActionException: No shard available for [get [.kibana][\_doc][space:default]: routing [null]]  
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.perform(TransportSingleShardAction.java:233) ~[elasticsearch-7.1.1.jar:7.1.1]  
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$AsyncSingleAction.start(TransportSingleShardAction.java:210) ~[elasticsearch-7.1.1.jar:7.1.1]  
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction.doExecute(TransportSingleShardAction.java:103) ~[elasticsearch-7.1.1.jar:7.1.1]  
at org.elasticsearch.action.support.single.shard.TransportSingleShardAction.doExecute(TransportSingleShardAction.java:62) ~[elasticsearch-7.1.1.jar:7.1.1]  
at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:145) ~[elasticsearch-7.1.1.jar:7.1.1]  
at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.apply(SecurityActionFilter.java:123) ~[?:?]  
at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:143) ~[elasticsearch-7.1.1.jar:7.1.1]

Merci !

---

<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:** [September 5, 2019, 7:24am UTC](https://discuss.elastic.co/t/impossible-de-collecter-des-donnees-elasticsearch-no-shard-available-action-exception/194254/6 "2019-09-05T07:24:53Z")

</div>

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