orientechnologies / orientdb

OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries.
https://orientdb.dev
Apache License 2.0
4.73k stars 871 forks source link

"Vertex id can not be null" #9460

Closed johny65 closed 3 years ago

johny65 commented 3 years ago

OrientDB Version: 3.0.35

Java Version: OpenJDK version "11.0.9.1" 2020-11-04

OS: Ubuntu 20.10

Expected behavior

Call to OrientVertex::getEdges without exception.

Actual behavior

Sometimes calling to getEdges on a vertex throws an java.lang.IllegalArgumentException: Vertex id can not be null. If I retry the operation, the call is successful. I don't know in which conditions this happens, it's somewhat random.

The full stacktrace is the following:

java.lang.IllegalArgumentException: Vertex id can not be null
        at com.tinkerpop.blueprints.util.ExceptionFactory.vertexIdCanNotBeNull(ExceptionFactory.java:14)
        at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.getVertex(OrientBaseGraph.java:680)
        at com.tinkerpop.blueprints.impls.orient.OrientEdge.getVertex(OrientEdge.java:163)
        at com.tinkerpop.blueprints.impls.orient.OrientEdgeIterator.filter(OrientEdgeIterator.java:127)
        at com.tinkerpop.blueprints.impls.orient.OrientEdgeIterator.filter(OrientEdgeIterator.java:41)
        at com.orientechnologies.orient.core.iterator.OLazyWrapperIterator.hasNext(OLazyWrapperIterator.java:94)
        at com.orientechnologies.common.collection.OMultiCollectionIterator.getNextPartial(OMultiCollectionIterator.java:259)
        at com.orientechnologies.common.collection.OMultiCollectionIterator.hasNextInternal(OMultiCollectionIterator.java:88)
        at com.orientechnologies.common.collection.OMultiCollectionIterator.hasNext(OMultiCollectionIterator.java:78)

Steps to reproduce

I just have a for loop:

for (Edge edge : vertex.getEdges(otherVertex, direction, relation)) {
    ...
}
lvca commented 3 years ago

This is the case when otherVertex is null. How do you get otherVertex? Could you please check that it's not null?

johny65 commented 3 years ago

otherVertex is not null. I found that the problem occurs when the vertices in the database are inconsistent... the edge goes out from vertex but doesn't go in into otherVertex. I don't know why the database got inconsistent :/..