Elastic Search 5.5.1 does not start

(Jospaul) #1

The elastic search do not start in Windows with the below exception -

An exception occurred while trying to start elasticsearch.: System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.Combine(String path1, String path2, String path3)
at Elastic.ProcessHosts.Elasticsearch.Process.ElasticsearchProcess..ctor(IObservableProcess process, IConsoleOutHandler consoleOutHandler, IFileSystem fileSystem, ElasticsearchEnvironmentConfiguration env, JavaConfiguration java, ManualResetEvent completedHandle, IEnumerable`1 args)
at Elastic.ProcessHosts.Elasticsearch.Service.ElasticsearchService.StartInteractive(ManualResetEvent handle)
at Elastic.ProcessHosts.Service.Service.Run()
at Elastic.ProcessHosts.Elasticsearch.Program.Main(String[] args)

C:\Program Files\Elastic\Elasticsearch\bin>java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) Client VM (build 25.144-b01, mixed mode)

I have installed the latest java version, does it need the 64-bit version?

(Shane Connelly) #2

Generally, yes, you should be using a 64-bit java. The implicit 32-bit support is going away soon: https://github.com/elastic/elasticsearch/pull/25435

But it looks like this is an error with the path. How did you install Elasticsearch? Did you use the MSI installer?

(Jospaul) #3

Yes I used the MSI installer.

I did try with 64-bit Java as well, but got the same error.

(Shane Connelly) #4

Can you share your install log from the MSI as well?

(Jospaul) #5

Please find the MSI install log - https://drive.google.com/file/d/0B_9rlWj_s7dZdTdNdHJKRHZhTGM/view?usp=drivesdk

(Martijn Laarman) #6

If you run elasticsearch.exe --debug-env what does it print on the command line?

(Jospaul) #7

ES_HOME (in order of precedence)

  • HomeDirectoryProcessVariable = C:\Program Files\Elastic\Elasticsearch\
  • HomeDirectoryUserVariable =
  • HomeDirectoryMachineVariable = C:\Program Files\Elastic\Elasticsearch\
  • From executable location = C:\Program Files\Elastic\Elasticsearch
    ES_CONFIG (in order of precedence)
  • ConfigDirectoryProcessVariable = C:\ProgramData\Elastic\Elasticsearch\config
  • ConfigDirectoryUserVariable =
  • ConfigDirectoryMachineVariable = C:\ProgramData\Elastic\Elasticsearch\config
  • Fallback to ES_HOME = C:\Program Files\Elastic\Elasticsearch\config


Java paths

  • current = C:\Program Files (x86)\Java\jre1.8.0_141\bin\java.exe
    Java Candidates (in order of precedence)
  • JavaHomeProcessVariable = C:\Program Files (x86)\Java\jre1.8.0_141
  • JavaHomeUserVariable =
  • JavaHomeMachineVariable = C:\Program Files (x86)\Java\jre1.8.0_141
  • JdkRegistry64 = C:\Program Files\Java\jdk1.8.0_144
  • JreRegistry64 = C:\Program Files\Java\jre1.8.0_144
  • JdkRegistry32 = C:\Program Files (x86)\Java\jdk1.8.0_144
  • JreRegistry32 = C:\Program Files (x86)\Java\jre1.8.0_144
    Java checks
  • Using32BitJava = False
  • JAVA_HOME as machine and user variable = False

(Russ Cam) #8

@Jospaul how are you starting the elasticsearch executable, could you show the command you're using here?

(Jospaul) #9


I had to restart my system and since then I am not receiving any error, but not getting the details as mentioned in the startup kit as well.

(Russ Cam) #10

hmm, this is a little weird.

The error happens because the java candidate path has illegal characters in it, when building a path to bin\java.exe executable. Is it possible that the java candidate path included the enclosing double quotes e.g. "C:\Program Files (x86)\Java\jre1.8.0_141"?

I've submitted a PR to echo out the java candidate path in the event of an exception: https://github.com/elastic/windows-installers/pull/71

(Jospaul) #11

I currently have taken a clone from the master for the windows-installer and then tried to install using the build.bat. However, that fails with a huge amount of failures . The error log starts with -

Project file contains ToolsVersion="14.0". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0".

I have tried using the msi installer, however now it doesn't give any error but does not install.

(Jospaul) #12

Hello all,

After several days of installing and uninstalling elasticsearch using msi and otherwise, i think i finally resolved the issue. It seems to be caused due to access issues, when I ran the command prompt as administrator, the cluster got started.

Thanks @forloop, @shanec and @Martijn_Laarman for your responses.

I probably will have to come back several times to this forum for further issues that I may face.


(Shane Connelly) #13

Thanks for the response @Jospaul. If you happen to have more details on the access details, let us know so we can look at making sure others don't run into it. And absolutely come back with any other questions or suggestions on how it could be better.

(Jospaul) #14

Unfortunately, I do not have the screenshot of the exact error i received. However, here are few more details -

  • I was getting an error as illegal characters in path the first time I tried installing. Not sure whether the error was caused because it did not have enough access permissions.
  • The major cause of confusion was that after I restarted my machine, there was no error when i try to startup elasticsearch, there was just a blank space and then the prompt was displayed.
  • I got an access related error when i tried to launch the application using the zip folder and not the MSI installer. There were messages that said that the path for some applications (if i am not wrong it was the Java folder location) were not accessible.

My suggestion would be to have some sort of logging for the startup of elasticsearch which is configurable, so that it prints everything that it is trying to access or do during the launch. This logging could be turned off later for those users who don't want to see them at a later point of time.

I shall try to recreate the error message and post it.

(Jospaul) #15

Please find below the error i got when I tried to start elasticsearch using the bat file, without starting the console in admin mode -

2017-08-25 12:15:43,124 main ERROR RollingFileManager (C:\Program Files\elasticsearch-5.5.2\logs\elasticsearch.log) java.io.FileNotFoundException: C:\Program Files\elasticsearch-5.
lasticsearch.log (Access is denied)


(system) #16

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