0

When running the following commands, an error is thrown by the add command. The rdf4j framework is used for communicating with a graphdb Knowledge Base:

 import org.eclipse.rdf4j.model.Model;

Model model;
//statements have been added to the model

 public RepositoryConnection connection;
 ...
 connection.add(model); <-- error is thrown

An error is thrown in add command

2022-01-24 09:46:02 [http-nio-8080-exec-5] ERROR restapi.SubmitRMService - unable to rollback transaction. HTTP error code 404
org.eclipse.rdf4j.repository.RepositoryException: unable to rollback transaction. HTTP error code 404
        at org.eclipse.rdf4j.http.client.RDF4JProtocolSession.rollbackTransaction(RDF4JProtocolSession.java:786)
        at org.eclipse.rdf4j.repository.http.HTTPRepositoryConnection.rollback(HTTPRepositoryConnection.java:354)
        at org.eclipse.rdf4j.repository.base.AbstractRepositoryConnection.conditionalRollback(AbstractRepositoryConnection.java:335)
        at org.eclipse.rdf4j.repository.base.AbstractRepositoryConnection.add(AbstractRepositoryConnection.java:379)

The code is running successfully in two other environments except one we are setting with kubernetes. We ensured that /opt/graphdb/home has write permissions.

Question: I just do not understand the 404 RepositoryException error. The code can successfully run queries before the .add(model), so the connection with the graphdb is ok.

zoe vas
  • 281
  • 9
  • 25
  • This sounds like something going wrong with the transaction handling, at either server or client end. Which version of the RDF4J libraries are you using at the client side, and which version of GraphDB are you running on the server? Also: is there anything showing in the GraphDB server logs? – Jeen Broekstra Feb 01 '22 at 06:46
  • did you start the transaction (connection.begin())? this 404 looks like there's no transaction or if there's a proxy in front of graphdb you might need graphdb-external-url config, see here https://graphdb.ontotext.com/documentation/free/configuring-graphdb.html#url-properties (you most likely need this for k8s as well) – yasko Feb 05 '22 at 15:02
  • Thanks for your hints, finally it was that the graphdb was not setup for https requests and it was not obvious in the logs – zoe vas Feb 19 '22 at 19:02

0 Answers0