kuzudb / explorer

Browser-based user interface for Kùzu graph database
https://hub.docker.com/r/kuzudb/explorer
MIT License
34 stars 5 forks source link

How is source file located? #65

Closed hs41-18 closed 10 months ago

hs41-18 commented 10 months ago

Hi. As title says I have tried putting the source .csv into the database folder but still getting an error message:

The evaluation of this cell failed with the following error:
Binder exception: No file found that matches the pattern: xxx.csv.

any thoughts on how to resolve this?

thanks

mewim commented 10 months ago

Hi @hs41-18,

The /database directory is for mounting the database files of Kùzu (the directory created by Kùzu automatically when you create a new database) rather than raw data files you would like to work with. To make your CSV files accessible, you could mount it at /data instead. Also, note that you still need the prefix directory for accessing the directory you mount when loading the files. If you mount your directory as /data, you need to use the path /data/xxx.csv to access the file instead of just xxx.csv.

hs41-18 commented 10 months ago

hi @mewim I guess /data is just an arbitrary name you are using? if not, could you please tell me where to find that folder? I've tried putting the CSV into a subfolder, still getting an error.

mewim commented 10 months ago

The /data in the Docker container is not completely arbitrary as we create the directory and set its permissions when building the Docker image (https://github.com/kuzudb/explorer/blob/6d8e5aa361e7d81e3064827924f70d62f1a7144c/Dockerfile#L21C1-L21C1). Do you mind sharing your docker run command so I can have a better idea about how you mount your data files?

hs41-18 commented 10 months ago

just this

docker run -p 8000:8000 \ -v /absolute/path/to/database:/database \ --rm kuzudb/explorer:latest

mewim commented 10 months ago

You should mount your data directory separately from your database directory. I.e.,

docker run -p 8000:8000
-v /absolute/path/to/database:/database
-v /absolute/path/to/directory/with/your/csvs:/data
--rm kuzudb/explorer:latest

Then, your csvs will be accessible under /data instead the Docker container.

hs41-18 commented 10 months ago

do I need to set permissions explicitely or explorer handling it for me?

tried mounting /data separately not worked, with this it didn't work either -u $(id -u):$(id -g) \

mewim commented 10 months ago

It depends on the the permission of your directory, the user you are using, and if you are using docker or Podman. What’s the error you encountered when you mount the data files separately?

hs41-18 commented 10 months ago

I am with an admin user running docker. Got the same error as above:

 The evaluation of this cell failed with the following error:
Binder exception: No file found that matches the pattern: xxx.csv.

Binder exception: No file found that matches the pattern: data/xxx.csv.
mewim commented 10 months ago

Can you do this to help troubleshooting? After you start the container, first run docker ps to get the container id, then run docker exec -it container-id /bin/bash to get shell access. In the shell, run cd /data and ls -al to check if your files present and have the correct permission?

mewim commented 10 months ago

Also, from the error message, it seems you used data/xxx.csv, but it should be /data/xxx.csv with slash at the beginning.

hs41-18 commented 10 months ago

Also, from the error message, it seems you used data/xxx.csv, but it should be /data/xxx.csv with slash at the beginning.

yes indeed, that was the stupid mistake :) I can see the data files from container files and have access