Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service.bat fails if ES_HOME contains whitespaces and parentheses #3906

Closed
salyh opened this Issue Oct 14, 2013 · 4 comments

Comments

Projects
None yet
2 participants
@salyh
Copy link
Contributor

salyh commented Oct 14, 2013

Executing service.bat on windows 7 x64 in a directory like
C:\Program Files (x86)
fails due to "syntaktisch an dieser Stelle nicht verarbeitbar" (in englisch somewhat like: bad syntax or syntactically not processible). Seems to be a problem with double quote handling/escaping.

@costin

This comment has been minimized.

Copy link
Member

costin commented Oct 14, 2013

Hi,

Not sure whether you've checked master or 0.90 branch but this has been fixed some time ago through #3725. Can you please confirm?

@costin costin closed this Oct 14, 2013

@salyh

This comment has been minimized.

Copy link
Contributor Author

salyh commented Oct 14, 2013

i have checked master (https://github.com/elasticsearch/elasticsearch/blob/master/bin/service.bat) and
sorry, but i cannot confirm, its not working for me :-(

i always get a error like:
C:\test fol.der (86)\another nasty na..me (55)\elasticsearch-master\elasticsearch-master\bin>service.bat
\elasticsearch-master\elasticsearch-master\bin\elasticsearch-service-x86.exe was
unexpected at this time.

during my tests i have found a few other issues, please see salyh@591b8df

That is working for me.

My test setup is win7, with jdk7 64 bit and jre7 32 bit
JAVA_HOME is C:\Program Files (x86)\Java\jre7
ES_HOME is C:\test fol.der (86)\another nasty na..me (55)\elasticsearch-master\elasticsearch-master

costin added a commit that referenced this issue Oct 14, 2013

improve escaping of user paths
remove usage of if and () blocks as they clashed with user paths containing ()
postpone quotation of variables to prevent double escaping ("")
fix #3906

costin added a commit that referenced this issue Oct 14, 2013

improve escaping of user paths
remove usage of if and () blocks as they clashed with user paths containing ()
postpone quotation of variables to prevent double escaping ("")
fix #3906

(cherry picked from commit 1cc095e)
@costin

This comment has been minimized.

Copy link
Member

costin commented Oct 14, 2013

Hi @salyh
Can you please try out the latest master/0.90? I've been able to replicate and fix the problem you had which was caused by the ")" which tripped the internal IFs.
I've 'refactored' the batch file so the IFs arenot more lenient and the escaping of user vars is not needed any more. This results in consistent behaviour between implicit and defined values (as the user does not use ").
Long story short, it should work now with the nested path above - please let me know if that's not the case.

Thanks!

@salyh

This comment has been minimized.

Copy link
Contributor Author

salyh commented Oct 15, 2013

i can confirm that master is now working ...

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

improve escaping of user paths
remove usage of if and () blocks as they clashed with user paths containing ()
postpone quotation of variables to prevent double escaping ("")
fix elastic#3906
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.