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

.bat and .sh Execution Fail When Run From a Path That Contains Spaces #2251

Open
bassem-mf opened this issue Nov 15, 2020 · 1 comment · May be fixed by #4167
Open

.bat and .sh Execution Fail When Run From a Path That Contains Spaces #2251

bassem-mf opened this issue Nov 15, 2020 · 1 comment · May be fixed by #4167

Comments

@bassem-mf
Copy link

The .bat and .sh files under the "janusgraph-0.5.2/bin" folder give errors when you try to run them from a path that contains spaces. For example "C:\Program Files\janusgraph-0.5.2"

Here is the Linux shell output:

bassem@Bassem-Laptop:/mnt/c/Program Files/janusgraph-0.5.2/bin$ ./gremlin.sh
./gremlin.sh: line 39: cd: too many arguments
bassem@Bassem-Laptop:/mnt/c/Program Files/janusgraph-0.5.2/bin$ ./gremlin-server.sh
./gremlin-server.sh: line 32: cd: too many arguments
./gremlin-server.sh: line 43: cd: too many arguments
./gremlin-server.sh: line 48: cd: too many arguments
./gremlin-server.sh: line 53: cd: too many arguments
find: ‘/mnt/c/Program’: No such file or directory
find: ‘Files/janusgraph-0.5.2/bin’: No such file or directory
find: ‘/mnt/c/Program’: No such file or directory
find: ‘Files/janusgraph-0.5.2/bin’: No such file or directory
find: ‘/mnt/c/Program’: No such file or directory
find: ‘Files/janusgraph-0.5.2/bin’: No such file or directory
find: ‘/mnt/c/Program’: No such file or directory
find: ‘Files/janusgraph-0.5.2/bin’: No such file or directory
./gremlin-server.sh: line 80: cd: too many arguments
WARNING: Tried /mnt/c/Program Files/janusgraph-0.5.2/bin/gremlin-server.yaml and /mnt/c/Program Files/janusgraph-0.5.2/bin//mnt/c/Program Files/janusgraph-0.5.2/bin/gremlin-server.yaml. Neither were readable.
Error opening zip file or JAR manifest missing : /mnt/c/Program
Error occurred during initialization of VM
agent library failed to init: instrument

And here is the Windows Command Prompt output

C:\Program Files\janusgraph-0.5.2\bin>gremlin.bat
Error: Could not find or load main class Files\janusgraph-0.5.2\ext

C:\Program Files\janusgraph-0.5.2\bin>gremlin-server.bat
Error: Could not find or load main class Files\janusgraph-0.5.2\logs

Please include configurations and logs if available.

For confirmed bugs, please report:

  • Version: 0.5.2
  • Storage Backend: Any
  • Mixed Index Backend: Any
  • Mailing list Thread URL: https://groups.google.com/g/janusgraph-users/c/kzat1tbotCM/m/gIuCCw1vCAAJ
  • Steps to Reproduce: Place the "janusgraph-0.5.2" folder in a path that contains spaces and try to run "gremlin.sh" and "gremlin-server.sh" from Linux and "gremlin.bat" and "gremlin-server.bat" from Windows.
@Veera-began
Copy link

Hi All,
Issues is caused at many places due to spaces in the path. Especially with CD -P command is not talking the complete path, its taking the path left side of the space. This is happening in all the spaces.
Actual code:

Set $CFG to $BIN/../conf

cd -P $BIN/../conf
by keeping quotes the whole path will not cause the issue like below

Set $CFG to $BIN/../conf

cd -P "$BIN/../conf"

PR: #4167

Veera-began added a commit to Veera-began/janusgraph that referenced this issue Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants