Re: 0.5.3 Upsert and RemoveRelation Issues

Boxuan Li


Thanks for reporting and investigating! To help us understand more about the context, would you mind sharing an isolated code snippet that is runnable and can reproduce the error? I was trying to reproduce issue but failed to do so.


On Aug 6, 2022, at 1:49 AM, sammy.jia via <> wrote:


I am using Java and JanusGraph 0.5.3, but I am having issues with a specific snippet of code. The code upserts a vertex and then adds a Cardinality.single property to the upserted vertex, even if the vertex already has the correct property value. The code snippet is provided at the bottom of this message.

The code works fine for inserted vertices, but it generates an IllegalArgumentException for updated vertices. The exception is being generated by's removeRelation method. After some debugging, I discovered that the exact same property step is being called twice for updated vertices. The first property method call uses removeRelation to delete the old property from the updated vertex. The second property method call then uses removeRelation to delete the exact same old property as the first method call (they share the same ID). Strangely, the old property still thinks it is in the 'loaded' state. Midway through removeRelation, the server realizes that that the property has already been deleted, updates the property's lifecycle to 'removed' at roughly, and throws an exception at

P.S. In this specific case, I was replacing a property with the exact same value. Eg. the updated vertex already has a property called "prop3" with the value "value3", but I am calling property("prop3", "value3") anyways without checking the vertex's state.

I have three main questions:
1. Why is the property step being called twice?
2. Does JanusGraph allow you to update a Cardinality.single property twice? 
3. Why does removeRelation generate a generic IllegalArgumentException when we delete something that has already been deleted? Shouldn't it just output a log and exit the method?


GraphTraversal<Vertex, Vertex> graphTraversal = null;

for (….) {

    if (graphTraversal == null) {

        graphTraversal = graphTraversalSource.V().has("prop1", "value1").fold()



                .property("prop1", "value1")

                .property("prop2", "value2"));


    } else {

        graphTraversal.V().hasLabel("label").has("prop1", "value1").fold()



                .property("prop1", "value1")

                .property("prop2", "value2"));

    }"prop3", "value3");  // this is somehow being called twice


Join to automatically receive all group messages.