Relative file paths not resolved correctly
Closed this issue · 1 comments
Winawer commented
Description
Attempting to load a schema through grakn console
using a file flag and relative path (e.g. -f ./path/to/schema/schema.gql
) on OS X fails. Using absolute paths succeeds.
Environment
- OS (where Grakn server runs): OS X 10.
- Grakn version (and platform): { e.g. Grakn Core 1.4, or Grakn KGMS 1.4.3 on Google Cloud }
- Grakn client: console
- Other environment details: N/A
Reproducible Steps
Steps to create the smallest reproducible scenario:
- Clean install of grakn using installation instructions for
brew
. grakn console version
= 1.0.0,grakn server version
= 1.5.7- Clone the examples:
git clone git@github.com:graknlabs/examples.git
- Attempt to load the phone calls schema:
cd examples
grakn console -k phone_calls -f ./schemas/phone-calls-schema.gql
This fails with a NoSuchFileException
. However, specifying the full path succeeds.
Expected Output
grakn console -k phone_calls -f /Users/XXX/YYY/examples/schemas/phone-calls-schema.gql
gives
Loading: /Users/XXX/YYY/examples/schemas/phone-calls-schema.gql
...
{}
Successful commit: phone-calls-schema.gql
Actual Output
grakn console -k phone_calls -f ./schemas/phone-calls-schema.gql
gives
...
java.nio.file.NoSuchFileException: ./schemas/phone-calls-schema.gql
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at java.nio.file.Files.newBufferedReader(Files.java:2784)
at java.nio.file.Files.readAllLines(Files.java:3202)
at grakn.core.console.ConsoleSession.readFile(ConsoleSession.java:166)
at grakn.core.console.ConsoleSession.load(ConsoleSession.java:109)
at grakn.core.console.GraknConsole.run(GraknConsole.java:104)
at grakn.core.console.GraknConsole.main(GraknConsole.java:140)
Additional information
I haven't tested this on any other set up or OS.
Winawer commented
Damn it, apologies, I meant to open this issue in grakn core, and I see there are similar issues over there; I'll close it off here.