-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Another fix for handling of paths on Windows #22132
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
Another fix for handling of paths on Windows #22132
Conversation
This commit fixes the handling of spaces in Windows paths. The current mechanism works fine in a path that contains a single space, but fails on a path that contains multiple spaces. With this commit, that is no longer the case. Relates #21921
A previous fix for the handling of paths on Windows related to paths containing multiple spaces introduced a issue where if JAVA_HOME ends with a backslash, then Elasticsearch will refuse to start. This is not a critical bug as a workaround exists (remove the trailing backslash), but should be fixed nevertheless. This commit addresses this situation while not regressing the previous fix.
3c071fb to
647ebb1
Compare
|
When I read this it seems the issue is not closed and included in a release package but when I download the elasticsearch zip from here https://www.elastic.co/downloads/elasticsearch it's already included. Did something went wrong? This fix in not working for me. I tested the version 5.1.1 on windows 7 (x64) and windows server 2012 R2 (x64) standard and had the same issue every time. The quote around the %JAVA_HOME% and %JAVA% variables are not placed correctly which prevent the scripts to start the node and to detect the JVM version which always default the service installation to the x86 version. My JAVA_HOME variable is set with the value: C:\Program Files\Java\jdk1.8.0_111 ######Result of the elasticsearch.bat execution before the fix: ######Result of the elasticsearch-service.bat execution before the fix: To fix the problem I had to do the following changes:
Here are the files with the fixes: elasticsearch-service.bat.txt Hope it helps. |
|
This PR will address that. |
|
yes sorry like I answer on the other PR I miss read the commits all is fine. Thanks again and keep the good work I can't stop loving elasticsearch :) |
It's me that should be sorry for introducing one bug while fixing another. I am sorry about that.
Music to my ears; you're welcome. |
|
Windows escaping is so weird. :) LGTM |
A previous fix for the handling of paths on Windows related to paths containing multiple spaces introduced a issue where if JAVA_HOME ends with a backslash, then Elasticsearch will refuse to start. This is not a critical bug as a workaround exists (remove the trailing backslash), but should be fixed nevertheless. This commit addresses this situation while not regressing the previous fix. Relates #22132
A previous fix for the handling of paths on Windows related to paths containing multiple spaces introduced a issue where if JAVA_HOME ends with a backslash, then Elasticsearch will refuse to start. This is not a critical bug as a workaround exists (remove the trailing backslash), but should be fixed nevertheless. This commit addresses this situation while not regressing the previous fix. Relates #22132
|
Thanks @rjernst. |
|
Thanks for this fix! I solved the problem locally by rewriting… …to… …but @rjernst’s proposal works fine, and it includes the services batch script. |


A previous fix for the handling of paths on Windows related to paths
containing multiple spaces introduced a issue where if JAVA_HOME ends
with a backslash, then Elasticsearch will refuse to start. This is not a
critical bug as a workaround exists (remove the trailing backslash), but
should be fixed nevertheless. This commit addresses this situation while
not regressing the previous fix.
Relates #21921