0

I using dockerized version of Blazegraph (https://hub.docker.com/r/nawer/blazegraph) and I am trying to import a large file to Blazegraph. It gave me a warning "File too large, enter the path to file" with an example (/path/to/Thesaurus.owl). So I described the path as follows in the update part.

/home/erwarth/Downloads/Thesaurus.OWL/Thesaurus.owl

However when I submit the data I am receiving the following error

Caused by: java.io.FileNotFoundException: /home/erwarth/Downloads/Thesaurus.OWL/Thesaurus.owl (No such file or directory)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.(FileInputStream.java:138)
    at java.io.FileInputStream.(FileInputStream.java:93)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
    at com.bigdata.rdf.sail.webapp.InsertServlet$InsertWithURLsTask.call(InsertServlet.java:561)
    at com.bigdata.rdf.sail.webapp.InsertServlet$InsertWithURLsTask.call(InsertServlet.java:417)
    at com.bigdata.rdf.task.ApiTaskForIndexManager.call(ApiTaskForIndexManager.java:68)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    ... 1 more

Does anybody have an idea?

Erwarth
  • 547
  • 6
  • 18
  • Are you mounting your home directory in a volume as a path in the container? - your container is not able to read your home dir (/home/erwarth/) if isn't previously mounted.. thats why process running in the container can't find the file – Hernan Garcia Jun 20 '23 at 15:30

1 Answers1

0

The error message you're seeing, java.io.FileNotFoundException: /home/erwarth/Downloads/Thesaurus.OWL/Thesaurus.owl (No such file or directory), indicates that Blazegraph, running within the Docker container, is unable to locate the file at the given path.

This is likely due to Docker's architecture, where each Docker container maintains its own separate file system. Therefore, a file path like /home/erwarth/Downloads/Thesaurus.OWL/Thesaurus.owl within a Docker container doesn't refer to the host system's file system (where the file actually is), but instead to the Docker container's own file system.

To solve this issue, you'll need to bind mount the host directory (where your file is located) into the Docker container during its initialization. The following is an example of how you can achieve this:

docker run -d -v /home/erwarth/Downloads/Thesaurus.OWL:/data -p 9999:9999 nawer/blazegraph

The -v /home/erwarth/Downloads/Thesaurus.OWL:/data portion of this command tells Docker to bind mount the /home/erwarth/Downloads/Thesaurus.OWL directory from your host machine into a directory named /data within the Docker container.

After executing the above command, when you try to upload the file in Blazegraph, you should use the following path:

/data/Thesaurus.owl

The file should be accessible to Blazegraph now, as /data/Thesaurus.owl is a valid path within the Docker container.

Please replace /home/erwarth/Downloads/Thesaurus.OWL with the correct path to the directory on your host machine where your OWL file is located.

Dan
  • 15
  • 1
  • 5
  • 1
    Dear Dan, thanks for your extensive answer! What you explained there makes sense to me and I followed your suggestions. I created even a new container to make sure everything is correct trying 2 different directories. docker run --name newBlaze -d -v /home/erwarth:/data -p 9999:9999 nawer/blazegraph and then putting /data/Thesaurus.owl as the new path. However, I am still receiving the same error this time (Caused by: java.io.FileNotFoundException: /data/Thesaurus.owl (No such file or directory). Do you have any other suggestions? – Erwarth Jun 21 '23 at 09:24
  • Check permissions on your file and directory using ls -l in your terminal. Start your Docker container and access its shell: docker exec -it newBlaze bash Inside the container, navigate to /data and check if the file is present: cd /data ls -l Make sure you're entering the exact, case-sensitive file name in Blazegraph. If issues persist, consider restarting the Docker daemon. Hope this helps! – Dan Jun 22 '23 at 17:52