SemanticComputing / fuseki-docker

Apache Jena Fuseki with SeCo extensions
MIT License
33 stars 14 forks source link

Not managing to launch a backup from command line using HTTP Administration protocol #28

Closed rjalexa closed 1 day ago

rjalexa commented 1 month ago

Dear friends, I am running your 5.0.0 container image on a Linux server with the following docker compose configuration:

services:
  mema_fuseki:
    image: secoresearch/fuseki:5.0.0
    container_name: mema_fuseki
    ports:
      - "3030:3030"
    volumes:
      - /home/mema/fuseki-base:/fuseki-base
    environment:
      - ADMIN_PASSWORD=myverysecretpass
      - ENABLE_UPDATE=true
      - ENABLE_DATA_WRITE=true
      - ENABLE_UPLOAD=true
      - JVM_ARGS=-Xmx8G
    restart: unless-stopped
    networks:
      - mema_network

and the server works well as seen:

mema@newisa:~/mema_docker_compose$ docker compose ps | grep secoresearch
mema_fuseki                       secoresearch/fuseki:5.0.0                         "/docker-entrypoint.…"   mema_fuseki   18 minutes ago   Up 18 minutes          0.0.0.0:3030->3030/tcp, :::3030->3030/tcp

I can now connect on port 3030 of this host and get the web interface working perfectly and from it I can successfully launch a backup.

But I wish to launch such backups from a shell script using the Fuseki HTTP Administration Protocol as per the page and so have tried with the following command line: curl -u admin:myverysecretpass -X POST http://localhost:3030/$/backup/mema_v6 but much to my surprise while looking at the logs: docker compose logs -f mema_fuseki nothing shows up. If I issue the command:

curl  http://localhost:3030/$/ping
2024-07-16T13:52:56.643+00:00

as you can see the response is there but still nothing shows in the logs.

Can you please help me understand how to launch a backup via the command line?

What can I check? Thank you very much for your great image.

yoge1 commented 1 month ago

Hmm, that's interesting. If the backup can be launched successfully from the web interface, it should work with the curl method, as well.

When you launch the backup from the web interface, do you see something in the logs (docker compose logs -f mema_fuseki), i.e. are you certain that the backup is being generated?

How did you create the dataset mema_v6?

I tested your docker compose configuration with the following workflow (on mac/arm64):

  1. Create docker-compose.yml file by copy-pasting you configuration above (I changed the volume host path). I had to add the network configuration to the end of the file:
    networks:
    mema_network:
  2. Copy assembler.ttl to the volume's path configuration/assembler.ttl
  3. Run docker compose up
  4. Create a new dataset mema_v6 via the web interface

Now, I am able to launch the backup successfully either from the web interface or with the curl method.

Running from the command line:

$ curl -u admin:myverysecretpass -X POST http://localhost:3030/$/backup/mema_v6
{ 
  "taskId" : "1" ,
  "requestId" : 6
}

In the docker compose / Fuseki logs I get:

mema_fuseki  | 15:02:32 INFO  Admin           :: [6] Backup dataset /mema_v6
mema_fuseki  | 15:02:32 INFO  Server          :: Task : 1 : Backup
mema_fuseki  | 15:02:32 INFO  Server          :: [Task 1] starts : Backup
mema_fuseki  | 15:02:32 INFO  Backup          :: [6] >>>> Start backup /mema_v6 -> /fuseki-base/backups/mema_v6_2024-08-12_15-02-32
mema_fuseki  | 15:02:32 INFO  Backup          :: [6] <<<< Finish backup /mema_v6 -> /fuseki-base/backups/mema_v6_2024-08-12_15-02-32
mema_fuseki  | 15:02:32 INFO  Server          :: [Task 1] finishes : Backup
yoge1 commented 1 day ago

I'm closing the issue; please do re-open it if still relevant.