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

[cli]: Trailing slash in Kùzu db path causes IO exception #3363

Closed
prrao87 opened this issue Apr 23, 2024 · 1 comment · Fixed by #3369
Closed

[cli]: Trailing slash in Kùzu db path causes IO exception #3363

prrao87 opened this issue Apr 23, 2024 · 1 comment · Fixed by #3369
Assignees
Labels
bug Something isn't working cli

Comments

@prrao87
Copy link
Member

prrao87 commented Apr 23, 2024

When creating/connecting to a Kùzu database in the CLI, adding a trailing slash in the path to the DB causes an IO exception (it shouldn't, the path is valid).

Example for creating a local DB called testdb

.$ /kuzu_shell ./testdb/ 
Opened the database at path: ./testdb/ in read-write mode.
Enter ":help" for usage hints.
IO exception: Failed to create directory ./testdb/ due to: IO exception: Directory ./testdb/ cannot be created. Check if it exists and remove it.

Expected behaviour is that the DB directory is created without errors.

@prrao87 prrao87 added the cli label Apr 23, 2024
@prrao87 prrao87 added the bug Something isn't working label Apr 23, 2024
@prrao87 prrao87 changed the title [cli]: Trailing slash in connecting to Kùzu database does not work [cli]: Trailing slash in connecting to Kùzu database causes IO exception Apr 23, 2024
@prrao87 prrao87 changed the title [cli]: Trailing slash in connecting to Kùzu database causes IO exception [cli]: Trailing slash in Kùzu db path causes IO exception Apr 23, 2024
@acquamarin
Copy link
Collaborator

I think it is a bug in libc++ as described here: llvm/llvm-project#60634
Reason:
std::filesystem::create_directories("./testdb/ ") returns a failure, even when succeeding.
From strace, I can see the lib implem considers ./testdb/ to be different than ./testdb (2 mkdir, 2 stat).
It does mkdir("./testdb/"), which passes, then mkdir("./testdb") which failed (directory exists).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants