# System.Net.WebException on ping for system user

**URL:** <https://discuss.elastic.co/t/system-net-webexception-on-ping-for-system-user/21777>\
**Category:** Elasticsearch\
**Created:** [January 22, 2015, 3:09pm UTC](https://discuss.elastic.co/t/system-net-webexception-on-ping-for-system-user/21777 "2015-01-22T15:09:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TJ\_Kolev](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@TJ\_Kolev](https://discuss.elastic.co/u/TJ_Kolev)\
**Post date:** [January 22, 2015, 3:09pm UTC](https://discuss.elastic.co/t/system-net-webexception-on-ping-for-system-user/21777/1 "2015-01-22T15:09:39Z")

</div>

Greetings,

I have a little service that pushes logs to Elasticsearch (1.4.2), and I am  
now using the [Elasticsearch.net](http://Elasticsearch.net) client (1.3.1). This is all running on my  
dev machine - 64 bit Windows 2008 R2, .Net 4.5. However, strange thing is  
happening depending on which user the service executes under:

- It works fine when running as my domain user (company/me).
- It fails the exception below, when running as a local user  
(./service\_user), which is the way I want it to run.
- It fails the same way when running as the Local System user.

Is a "Ping" just a HEAD request? That is what I am led to believe by having  
fiddler running. In which case when it does not work, there's no HEAD  
request made at all. So it is not a timeout issue on the response. (On a  
side note - does the client call a HEAD before any other request? Perhaps  
that's too much?)

In the previous version of my little service I was using an Elasticsearch  
client that I wrote. It also uses HttpWebRequest to do its thing. But it  
works fine under ./service\_user or any other user.

Any ideas of what am I missing?

Thank you.  
tjk 🙂

======

2015-01-21 21:08:17,443 [5] ERROR - Failed to update index template  
'wk-rule' with exception.  
Elasticsearch.Net.Exceptions.PingException: Pinging [http://MyLocalBox:9200/](http://MyLocalBox:9200/)  
caused an exception ---\> System.Exception: ping returned no status code  
---\> System.Net.WebException: The operation has timed out  
at System.Net.HttpWebRequest.GetResponse()  
at  
Elasticsearch.Net.Connection.HttpConnection.DoSynchronousRequest(HttpWebRequest  
request, Byte[] data, IRequestConfiguration requestSpecificConfig) in  
c:\code\elasticsearch-net\src\[Elasticsearch.Net](http://Elasticsearch.Net)\Connection\HttpConnection.cs:line  
240  
--- End of inner exception stack trace ---  
at  
Elasticsearch.Net.Connection.Transport.Elasticsearch.Net.Connection.ITransportDelegator.Ping(ITransportRequestState  
requestState) in  
c:\code\elasticsearch-net\src\[Elasticsearch.Net](http://Elasticsearch.Net)\Connection\Transport.cs:line  
94  
--- End of inner exception stack trace ---  
at  
Elasticsearch.Net.Connection.Transport.Elasticsearch.Net.Connection.ITransportDelegator.Ping(ITransportRequestState  
requestState) in  
c:\code\elasticsearch-net\src\[Elasticsearch.Net](http://Elasticsearch.Net)\Connection\Transport.cs:line  
110  
at  
Elasticsearch.Net.Connection.RequestHandlers.RequestHandler.SelectNextNode[T](TransportRequestState`1 requestState) in c:\code\elasticsearch-net\src\Elasticsearch.Net\Connection\RequestHandlers\RequestHandler.cs:line 47 at Elasticsearch.Net.Connection.RequestHandlers.RequestHandler.CoordinateRequest[T](TransportRequestState`1  
requestState, Int32 maxRetries, Int32 retried, Boolean& aliveResponse) in  
c:\code\elasticsearch-net\src\[Elasticsearch.Net](http://Elasticsearch.Net)\Connection\RequestHandlers\RequestHandler.cs:line  
118  
at  
Elasticsearch.Net.Connection.RequestHandlers.RequestHandler.DoRequest[T](TransportRequestState`1 requestState) in c:\code\elasticsearch-net\src\Elasticsearch.Net\Connection\RequestHandlers\RequestHandler.cs:line 174 at Elasticsearch.Net.Connection.RequestHandlers.RequestHandler.Request[T](TransportRequestState`1  
requestState, Object data) in  
c:\code\elasticsearch-net\src\[Elasticsearch.Net](http://Elasticsearch.Net)\Connection\RequestHandlers\RequestHandler.cs:line  
34  
at Elasticsearch.Net.Connection.Transport.DoRequest[T](String method,  
String path, Object data, IRequestParameters requestParameters) in  
c:\code\elasticsearch-net\src\[Elasticsearch.Net](http://Elasticsearch.Net)\Connection\Transport.cs:line  
324  
at  
Elasticsearch.Net.ElasticsearchClient.IndicesPutTemplateForAll[T](String  
name, Object body, Func`2 requestParameters) in  
c:\code\elasticsearch-net\src\[Elasticsearch.Net](http://Elasticsearch.Net)\ElasticsearchClient.Generated.cs:line  
19737  
at AtlasLogService.IndexMaintainer.EnsureIndexTemplate(MQMessageConfig  
mqConfig) in  
c:\svn\atlas\trunk\internal\AtlasLoggingES\AtlasLogService\IndexMaintainer.cs:line  
56  
at AtlasLogService.IndexMaintainer.RunIndexMaintenance() in  
c:\svn\atlas\trunk\internal\AtlasLoggingES\AtlasLogService\IndexMaintainer.cs:line  
29

--  
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/9d301eb4-db25-4c01-b39d-bc3a7ba09d77%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9d301eb4-db25-4c01-b39d-bc3a7ba09d77%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![TJ\_Kolev](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@TJ\_Kolev](https://discuss.elastic.co/u/TJ_Kolev)\
**Post date:** [January 22, 2015, 8:45pm UTC](https://discuss.elastic.co/t/system-net-webexception-on-ping-for-system-user/21777/2 "2015-01-22T20:45:42Z")

</div>

Funny story.

Before I posted I suspected, my timeout was on the low end. I believe the  
default is 200 ms. I increased it to 500, then to 2000, without any effect.  
After the post I did additional experiments and it turned out it was indeed  
the timeout, with a twist. When running as the local service\_user, the  
first request takes 13 - 14 seconds. When running as the domain user it  
takes about 10 - 13 ms. So somehow my local user has issues with DNS or  
something. The requests are made to [http://MyLocalBox:9200](http://MyLocalBox:9200). If I change  
that to [http://localhost:9200](http://localhost:9200) the requests for the service\_user work as  
expected - as fast as any. But even if I use the IP address - the first  
request is back to 14 seconds.

tjk 🙂

--  
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/7cf9f198-af58-408d-9d87-309d088a8234%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7cf9f198-af58-408d-9d87-309d088a8234%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:37am UTC](https://discuss.elastic.co/t/system-net-webexception-on-ping-for-system-user/21777/3 "2017-07-06T00:37:09Z")

</div>


