System.Net.WebException on ping for system user

Greetings,

I have a little service that pushes logs to Elasticsearch (1.4.2), and I am
now using the 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 :slight_smile:

======

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/
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\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\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\Connection\Transport.cs:line
110
at
Elasticsearch.Net.Connection.RequestHandlers.RequestHandler.SelectNextNode[T](TransportRequestState1 requestState) in c:\code\elasticsearch-net\src\Elasticsearch.Net\Connection\RequestHandlers\RequestHandler.cs:line 47 at Elasticsearch.Net.Connection.RequestHandlers.RequestHandler.CoordinateRequest[T](TransportRequestState1
requestState, Int32 maxRetries, Int32 retried, Boolean& aliveResponse) in
c:\code\elasticsearch-net\src\Elasticsearch.Net\Connection\RequestHandlers\RequestHandler.cs:line
118
at
Elasticsearch.Net.Connection.RequestHandlers.RequestHandler.DoRequest[T](TransportRequestState1 requestState) in c:\code\elasticsearch-net\src\Elasticsearch.Net\Connection\RequestHandlers\RequestHandler.cs:line 174 at Elasticsearch.Net.Connection.RequestHandlers.RequestHandler.Request[T](TransportRequestState1
requestState, Object data) in
c:\code\elasticsearch-net\src\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\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\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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/9d301eb4-db25-4c01-b39d-bc3a7ba09d77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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. If I change
that to 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 :slight_smile:

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/7cf9f198-af58-408d-9d87-309d088a8234%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.