# What is HEAD request about?

**URL:** <https://discuss.elastic.co/t/what-is-head-request-about/45377>\
**Category:** Elasticsearch\
**Created:** [March 24, 2016, 5:37pm UTC](https://discuss.elastic.co/t/what-is-head-request-about/45377 "2016-03-24T17:37:02Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![es\_noob](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@es\_noob](https://discuss.elastic.co/u/es_noob)\
**Post date:** [March 24, 2016, 5:37pm UTC](https://discuss.elastic.co/t/what-is-head-request-about/45377/1 "2016-03-24T17:37:02Z")

</div>

Hi! I ran into two questions during indexing.

1. I saw a lot of HEAD request with 404 Not Found. I tried to find what HEAD request is about, but couldn't ☹

2. The cluster health is in yellow - although all three nodes work actively.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)\
**Post date:** [March 24, 2016, 5:56pm UTC](https://discuss.elastic.co/t/what-is-head-request-about/45377/2 "2016-03-24T17:56:53Z")

</div>

1. Where do you see these requests? on which URL?
2. Yellow means that not all shards have been started. Have a look at  
`/_cat/shards` ( [https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html) ) to see which shards are causing issues.

---

<div class="post-metadata">

**Author:** ![es\_noob](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@es\_noob](https://discuss.elastic.co/u/es_noob)\
**Post date:** [March 24, 2016, 6:04pm UTC](https://discuss.elastic.co/t/what-is-head-request-about/45377/3 "2016-03-24T18:04:05Z")

</div>

Hi Yannick,

For 1) I see those in elasticsearch log (in server).  
2) would it be the same case when one of the nodes (I have three) is randomly shown unhealthy ?

---

<div class="post-metadata">

**Author:** ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)\
**Post date:** [March 24, 2016, 6:12pm UTC](https://discuss.elastic.co/t/what-is-head-request-about/45377/4 "2016-03-24T18:12:59Z")

</div>

1. The HEAD requests are initiated either by a user or an application. Please give the full log lines. [https://en.wikipedia.org/wiki/Hypertext\_Transfer\_Protocol#Request\_methods](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods)
2. I don't know what you mean by that. Please post your output for `/_cluster/health?pretty`

---

<div class="post-metadata">

**Author:** ![es\_noob](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@es\_noob](https://discuss.elastic.co/u/es_noob)\
**Post date:** [March 24, 2016, 6:27pm UTC](https://discuss.elastic.co/t/what-is-head-request-about/45377/5 "2016-03-24T18:27:20Z")

</div>

1. Sorry I had to delete the actual names ☹  
[2016-03-24 17:59:42,900][INFO][request] [] HEAD /abc/ab/11111 - 404 NOT\_FOUND 0 0  
[2016-03-24 17:59:42,900][INFO][request\_json] {"time":"2016-03-24T17:59:42.900Z","starttime":"2016-03-24T17:59:42.900Z","localaddr":"12.12.1.31","localport":9200,"remoteaddr":"12.12.1.31","remoteport":23644,"scheme":"http","method":"HEAD","path":"/abc/ab/11111","querystr":"-","code":404,"status":"NOT\_FOUND","size":0,"duration":0,"year":"2016","month":"03","day":"24","hour":"17","minute":"59","dow":"Thu","cluster":""}

1. 

{  
cluster\_name: "",  
status: "yellow",  
timed\_out: false,  
number\_of\_nodes: 2,  
number\_of\_data\_nodes: 2,  
active\_primary\_shards: 18,  
active\_shards: 36,  
relocating\_shards: 0,  
initializing\_shards: 0,  
unassigned\_shards: 18  
}

The number of unassigned\_shards is 18 because one of the nodes fails alternatively between nodes. Like Node1 was gone for a while then Node1 got back without me doing anything and at the same time Node2 was gone..

---

<div class="post-metadata">

**Author:** ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)\
**Post date:** [March 24, 2016, 6:37pm UTC](https://discuss.elastic.co/t/what-is-head-request-about/45377/6 "2016-03-24T18:37:37Z")

</div>

1. With "remoteaddr":"12.12.1.31" you can see that an application is issuing a HEAD request to a document in your cluster from that IP address. Do you have an application running that is accessing your cluster?

2. Seems like you have `index.number_of_replicas` set to 2 (which means that you have 3 copies of each shard). As only 2 nodes are in the cluster, a third of the shards cannot be allocated. Why are nodes failing? You have to look into the logs.

---

<div class="post-metadata">

**Author:** ![es\_noob](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@es\_noob](https://discuss.elastic.co/u/es_noob)\
**Post date:** [March 24, 2016, 6:55pm UTC](https://discuss.elastic.co/t/what-is-head-request-about/45377/7 "2016-03-24T18:55:40Z")

</div>

1. yeah.. actually, my original question was what HEAD request is about. 🙂 for example, we know PUT is to update, GET to search/get, POST to add/save, but I have not seen HEAD request until today.

2. back to my original question this as well... there are three actively alive nodes, which are still indexing the given documents, but the cluster keeps saying only two of them are healthy, and the unhealthy node changes continuously.

---

<div class="post-metadata">

**Author:** ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)\
**Post date:** [March 24, 2016, 6:58pm UTC](https://discuss.elastic.co/t/what-is-head-request-about/45377/8 "2016-03-24T18:58:00Z")

</div>

1. I linked you to Wikipedia which has the explanation. Do you want me to copy-paste the text here? 🙂 Googling might also help. HEAD requests are nothing Elasticsearch-specific.
2. I asked you to look into the logs. If you don't provide any other information, I cannot help you.

---

<div class="post-metadata">

**Author:** ![es\_noob](https://avatars.discourse-cdn.com/v4/letter/e/48db29/32.png) [@es\_noob](https://discuss.elastic.co/u/es_noob)\
**Post date:** [March 24, 2016, 7:03pm UTC](https://discuss.elastic.co/t/what-is-head-request-about/45377/9 "2016-03-24T19:03:22Z")

</div>

Oh my bad! I'm sorry for missing the wikipedia link 😅

As for the second, maybe I should wait until indexing is done and see what happens.. I only see 200s except the HEAD 404s in all three nodes.

Thank you for your help! (I should've said this earlier)

---

<div class="post-metadata">

**Author:** ![ywelsch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ywelsch/32/7751_2.png) [@ywelsch](https://discuss.elastic.co/u/ywelsch)\
**Post date:** [March 24, 2016, 7:27pm UTC](https://discuss.elastic.co/t/what-is-head-request-about/45377/10 "2016-03-24T19:27:24Z")

</div>

> [@wonnie](#):
>
> Thank you for your help

You're welcome.

---

<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:** [March 24, 2016, 8:47pm UTC](https://discuss.elastic.co/t/what-is-head-request-about/45377/11 "2016-03-24T20:47:09Z")

</div>

A HEAD request in ES is used to determine if a document exists or not, so a 200 means the doc exists while a 404 means it doesn't.

---

<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 5, 2017, 11:05pm UTC](https://discuss.elastic.co/t/what-is-head-request-about/45377/12 "2017-07-05T23:05:21Z")

</div>


