# Yet another "No Nodes Alive Exception" discussion

**URL:** https://discuss.elastic.co/t/yet-another-no-nodes-alive-exception-discussion/339024
**Category:** Elasticsearch
**Tags:** docker
**Created:** [July 24, 2023, 1:40am UTC](https://discuss.elastic.co/t/yet-another-no-nodes-alive-exception-discussion/339024 "2023-07-24T01:40:06Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ahriss](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Ahriss](https://discuss.elastic.co/u/Ahriss)
#### Post date: [July 24, 2023, 1:40am UTC](https://discuss.elastic.co/t/yet-another-no-nodes-alive-exception-discussion/339024/1 "2023-07-24T01:40:06Z")

</div>

Hello there! I'm new here, and I've come here for help. As the name implies, I'm getting a "No nodes alive" error in a simple, single node elasticsearch php application. I have researched the issue for hours, it apparently has something to do with using the wrong host, but I have tried every solution I have seen on the net and none works. So I give up, and leave it to far smarter people. Here's the code...  
Init.php:

```auto
<?php
require_once __DIR__. '/vendor/autoload.php';
use Elasticsearch\ClientBuilder;
$es = Clientbuilder::create()->setHosts(['http://es01:9200'])->build();

```

Relevant docker compose bits:

```auto
 es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.17.10
    container_name: es01
    environment:
      - node.name=es01
      - xpack.security.enabled=false
      - discovery.type=single-node
      - bootstrap.memory_lock=true
    ports:
      - "127.0.0.1:9200:9200"
    networks:
      - elastic

   kib01:
    image: docker.elastic.co/kibana/kibana:7.17.10
    container_name: kib01
    ports:
      - "127.0.0.1:5601:5601"
    volumes:
      - ./www:/usr/share/tcc/kibana.yml
    environment:
      ELASTICSEARCH_HOSTS: http://es01:9200
    depends_on: 
      - es01 
    networks:
      - elastic

```

As you can see, not a complex use, but I tend to always run into the most extreme, obscure and obnoxious versions of every error ever. In the client builder, I have attempted localhost, 127.0.0.1 and es01, with and without http. I also only get the error when I actually attempt to perform a search, not when loading the page.

So, could anyone please help me sort this thing out?

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [July 24, 2023, 2:13am UTC](https://discuss.elastic.co/t/yet-another-no-nodes-alive-exception-discussion/339024/2 "2023-07-24T02:13:16Z")

</div>

Where is your PHP application running? It is running on another container on the same network?

What do you have you elasticsearch logs?

This seems more a docker issue than a Elasticsearch issue.

---

<div class="post-metadata">

### Author: ![Ahriss](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Ahriss](https://discuss.elastic.co/u/Ahriss)
#### Post date: [July 24, 2023, 2:53am UTC](https://discuss.elastic.co/t/yet-another-no-nodes-alive-exception-discussion/339024/3 "2023-07-24T02:53:49Z")

</div>

And now I get to feel silly! I had forgotten to include nginx on the network when I was shifting things around to correct another error. Thank you very much for the help, I was looking entirely in the wrong place due to all the other pages on the net pointing me elsewhere.

---

<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: [August 21, 2023, 2:54am UTC](https://discuss.elastic.co/t/yet-another-no-nodes-alive-exception-discussion/339024/4 "2023-08-21T02:54:18Z")

</div>

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