# Re: failed to get node info...transport.NoNodeAvailableException

**URL:** <https://discuss.elastic.co/t/re-failed-to-get-node-info-transport-nonodeavailableexception/15952>\
**Category:** Elasticsearch\
**Created:** [February 21, 2014, 1:39pm UTC](https://discuss.elastic.co/t/re-failed-to-get-node-info-transport-nonodeavailableexception/15952 "2014-02-21T13:39:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 21, 2014, 1:39pm UTC](https://discuss.elastic.co/t/re-failed-to-get-node-info-transport-nonodeavailableexception/15952/1 "2014-02-21T13:39:30Z")

</div>

Dis you set a cluster name?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 21 févr. 2014 à 11:49, "Marwa.g" [marwa.ghabri@esprit.tn](mailto:marwa.ghabri@esprit.tn) a écrit :

> Hi,  
> I'm trying to index and search pdf document...I'm using elasticsearch 1.0.0 and elasticsearch-mapper-attachments 2.0.0.RC1 ... I get always these exceptions org.elasticsearch.client.transport.NoNodeAvailableException: No node available[org.elasticsearch.client.transport] [Spidercide] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]
> 
> this is my code :
> 
> import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;  
> import org.elasticsearch.action.index.IndexResponse;  
> import org.elasticsearch.action.search.SearchResponse;  
> import org.elasticsearch.client.Client;  
> import org.elasticsearch.client.action.search.SearchRequestBuilder;  
> import org.elasticsearch.client.transport.TransportClient;  
> import org.elasticsearch.common.logging.ESLogger;  
> import org.elasticsearch.common.logging.Loggers;  
> import org.elasticsearch.common.settings.ImmutableSettings;  
> import org.elasticsearch.common.transport.InetSocketTransportAddress;  
> import org.elasticsearch.common.xcontent.XContentBuilder;  
> import org.elasticsearch.index.query.QueryBuilder;  
> import org.elasticsearch.index.query.QueryBuilders;  
> import org.elasticsearch.node.Node;  
> import org.testng.annotations.BeforeClass;  
> import org.testng.annotations.Test;
> 
> import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;  
> import static org.hamcrest.MatcherAssert.assertThat;  
> import static org.hamcrest.Matchers.\*;
> 
> public class AttachmentTest {
> 
> private Node node;  
> Client client;  
> ESLogger log = Loggers.getLogger(AttachmentTest.class);
> 
> @BeforeClass  
> public void setupNode() {
> 
> ```
> client = new TransportClient().addTransportAddress(new InetSocketTransportAddress("localhost", 9300)); 
> 
> ```
> 
> }
> 
> @Test  
> public void mapperAttachmentTest() throws Exception {  
> String idxName = "test";  
> String idxType = "attachment";  
> XContentBuilder map = jsonBuilder().startObject()  
> .startObject(idxType)  
> .startObject("properties")  
> .startObject("file")  
> .field("type", "attachment")  
> .startObject("fields")  
> .startObject("title")  
> .field("store", "yes")  
> .endObject()  
> .startObject("file")  
> .field("term\_vector","with\_positions\_offsets")  
> .field("store","yes")  
> .endObject()  
> .endObject()  
> .endObject()  
> .endObject()  
> .endObject();  
> try {  
> client.admin().indices().prepareDelete(idxName).execute().actionGet();  
> } catch (Exception ex) {}
> 
> ```
> log.info("create index and mapping"); 
> CreateIndexResponse resp = client.admin().indices().prepareCreate(idxName).setSettings( 
> ImmutableSettings.settingsBuilder() 
> .put("number_of_shards", 1) 
> .put("index.numberOfReplicas", 1)) 
> .addMapping("attachment", map).execute().actionGet(); 
> 
> String pdfPath = ClassLoader.getSystemResource("isl99201.pdf").getPath(); 
> 
> String data64 = org.elasticsearch.common.Base64.encodeFromFile(pdfPath); 
> 
> log.info("Indexing"); 
> XContentBuilder source = jsonBuilder().startObject() 
> .field("file", data64).endObject(); 
> 
> IndexResponse idxResp = client.prepareIndex().setIndex(idxName).setType(idxType).setId("80") 
> .setSource(source).setRefresh(true).execute().actionGet(); 
> 
> String queryString = "amplifier"; 
> 
> log.info("Searching by "+queryString); 
> QueryBuilder query = QueryBuilders.queryString(queryString); 
> 
> SearchRequestBuilder searchBuilder = client.prepareSearch().setQuery(query) 
> .addField("title") 
> .addHighlightedField("file"); 
> 
> SearchResponse search = searchBuilder.execute().actionGet(); 
> assertThat(search.hits().totalHits(), equalTo(1L)); 
> assertThat(search.hits().hits().length, equalTo(1)); 
> assertThat(search.hits().getAt(0).highlightFields().get("file"), notNullValue()); 
> assertThat(search.hits().getAt(0).highlightFields().get("file").toString(), containsString("<em>Amplifier</em>")); 
> 
> client.close(); 
> 
> ```
> 
> }  
> }
> 
> and this is what I get:
> 
> unning net.hashcode.esattach.AttachmentTest  
> Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNGMapConfigurator@589f2cff  
> [2014-02-21 11:05:58,484][WARN][org.elasticsearch.client.transport] [Spidercide] failed to get node info for [#transport#-1][inet[localhost/127.0.0.1:9300]]  
> org.elasticsearch.transport.NodeDisconnectedException: [inet[localhost/127.0.0.1:9300]][/cluster/nodes/info] disconnected  
> [2014-02-21 11:05:58,635][INFO][org.elasticsearch.net.hashcode.esattach.AttachmentTest] create index and mapping  
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.111 sec \<\<\< FAILURE!  
> mapperAttachmentTest(net.hashcode.esattach.AttachmentTest) Time elapsed: 0.123 sec \<\<\< FAILURE!  
> org.elasticsearch.client.transport.NoNodeAvailableException: No node available  
> at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:170)  
> at org.elasticsearch.client.transport.support.InternalTransportIndicesAdminClient.create(InternalTransportIndicesAdminClient.java:252)  
> at org.elasticsearch.client.action.admin.indices.create.CreateIndexRequestBuilder.doExecute(CreateIndexRequestBuilder.java:158)  
> at org.elasticsearch.client.action.admin.indices.support.BaseIndicesRequestBuilder.execute(BaseIndicesRequestBuilder.java:52)  
> at org.elasticsearch.client.action.admin.indices.support.BaseIndicesRequestBuilder.execute(BaseIndicesRequestBuilder.java:47)  
> at net.hashcode.esattach.AttachmentTest.mapperAttachmentTest(AttachmentTest.java:64)
> 
> Results :
> 
> Failed tests: mapperAttachmentTest(net.hashcode.esattach.AttachmentTest): No node available
> 
> ## please could you help me
> 
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b18cf109-5e69-4883-9703-696a7e85518f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b18cf109-5e69-4883-9703-696a7e85518f%40googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/D080B826-7869-4484-80FA-29CDCE252BDA%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/D080B826-7869-4484-80FA-29CDCE252BDA%40pilato.fr).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [February 21, 2014, 1:42pm UTC](https://discuss.elastic.co/t/re-failed-to-get-node-info-transport-nonodeavailableexception/15952/2 "2014-02-21T13:42:36Z")

</div>

Is it possible that your Elasticsearch Java client is a different version  
from your Elasticsearch server?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/b001a75f-3def-4f1d-8c44-3024534e8277%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b001a75f-3def-4f1d-8c44-3024534e8277%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![marwa\_g](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@marwa\_g](https://discuss.elastic.co/u/marwa_g)\
**Post date:** [February 21, 2014, 2:03pm UTC](https://discuss.elastic.co/t/re-failed-to-get-node-info-transport-nonodeavailableexception/15952/3 "2014-02-21T14:03:35Z")

</div>

Thank you ... I resolved the problem ...I had a mistake in dependency version (pom.xml)

---

<div class="post-metadata">

**Author:** ![marwa\_g](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@marwa\_g](https://discuss.elastic.co/u/marwa_g)\
**Post date:** [February 21, 2014, 2:05pm UTC](https://discuss.elastic.co/t/re-failed-to-get-node-info-transport-nonodeavailableexception/15952/4 "2014-02-21T14:05:08Z")

</div>

Thank you ... I resolved the problem ...I had a mistake in dependency  
version (pom.xml)

> 

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/155f6c3e-1683-401d-aaf7-8929dc3e2af4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/155f6c3e-1683-401d-aaf7-8929dc3e2af4%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 1:48am UTC](https://discuss.elastic.co/t/re-failed-to-get-node-info-transport-nonodeavailableexception/15952/5 "2017-07-06T01:48:18Z")

</div>


