You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An ambiguous error message【Vertex with given id already exists:xxx】 #3013
When I insert this data repeatedly, it prompts me: Vertex with given id already exists: 256, actually myID is 1, I think this hint is ambiguous, and it interferes with debugging by myID
long vertexId = ((StandardJanusGraph) graph).getIDManager().toVertexId(1L);
g.addV().property(T.id, vertexId).next();
g.tx().commit();
...
at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addVertex(StandardJanusGraphTx.java:584)
...
Line 582 tells you that the vertexId belongs to NormalVertex, and if it can be converted to myID instead of vertexId when prompted by line 584
582 Preconditions.checkArgument(vertexId == null || IDManager.VertexIDType.NormalVertex.is(vertexId), "Not a valid vertex id: %s", vertexId);
583 Preconditions.checkArgument(vertexId == null || ((InternalVertexLabel)label).hasDefaultConfiguration(), "Cannot only use default vertex labels: %s",label);
584 Preconditions.checkArgument(vertexId == null || !config.hasVerifyExternalVertexExistence() || !containsVertex(vertexId), "Vertex with given id already exists: %s", vertexId);
Thanks to the development team for their contribution!
@ZhangErling Thank you for your report! I agree the error message is somewhat confusing. On one hand, the error message is completely right in the sense that 256 is indeed provided by you. On the other hand, you probably won't realize that you converted vertexId from 1 to 256 using the ((StandardJanusGraph) graph).getIDManager().toVertexId(1L); technique.
From a technical perspective, there is no way for the program to know that 256 was transformed from 1 because you did the transformation explicitly. I think a nice resolution would be to document the behavior to avoid any confusion.
Activity
li-boxuan commentedon Apr 17, 2022
@ZhangErling Thank you for your report! I agree the error message is somewhat confusing. On one hand, the error message is completely right in the sense that
256is indeed provided by you. On the other hand, you probably won't realize that you convertedvertexIdfrom1to256using the((StandardJanusGraph) graph).getIDManager().toVertexId(1L);technique.From a technical perspective, there is no way for the program to know that
256was transformed from1because you did the transformation explicitly. I think a nice resolution would be to document the behavior to avoid any confusion.AzazelSensei commentedon Sep 22, 2026
Opened #4962 — the custom vertex id page now says the duplicate-id error prints the transformed id, not the original.