apache / apache/drill

Drill cannot startup if java path contains whitespace

Open
#2,231 6 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
2k
Forks
990
Avg merge
1d 8h
Merged PRs (30d)
5

Description

**Describe the bug**
My JAVA_PATH set to "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home",
when run `./drillbit.sh start`, drill cannot startup and report error:
` /Users/Chester/Gwssi/ApacheDrill/apache-drill-1.19.0-SNAPSHOT/bin/runbit: line 109: /Library/Internet: No such file or directory`
`/Users/Chester/Gwssi/ApacheDrill/apache-drill-1.19.0-SNAPSHOT/bin/runbit: line 109: exec: /Library/Internet: cannot execute: No such file or directory`

**To Reproduce**
Steps to reproduce the behavior:
1. set JAVA_PATH to a jdk path which contains whitespace:
`export JAVA_PATH=/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home`
2. startup drill:
`./bin/drillbit.sh start`
3. See error in log file:
`log/drillbit.out`

**Expected behavior**
Drill cannot startup normally.

**Screenshots**
![image](https://user-images.githubusercontent.com/15710469/118493228-77805600-b753-11eb-89f0-0bc677cf0f74.png)
![image](https://user-images.githubusercontent.com/15710469/118493303-8a932600-b753-11eb-8cf6-418bcd3e23e0.png)

**Desktop (please complete the following information):**
- MacOS Big Sur 11.2.3

**Additional context**
print the command of line 109 in `/bin/runbit`:
`echo exec $BITCMD`

See the print result in `log/drillbit.out`:
![image](https://user-images.githubusercontent.com/15710469/118494219-8582a680-b754-11eb-8957-3f52a6a2de61.png)
The whitespace in java path doesn't come up with a backslash escape, so that `exec` cannot find the correct java path.
After I set the java path to a jdk without white space, like:
`/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home`
Drill startup process back to normal.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with bin/runbit at line 109 and inspect how BITCMD is echoed and executed. Reproduce the failure with JAVA_PATH set to the whitespace-containing path and ./bin/drillbit.sh start, then verify that Drill starts normally and log/drillbit.out shows the correct command handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, shell
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.