Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Unable to migrate to TH 4.0.5 #1785

Closed
mamoedo opened this issue Feb 9, 2021 · 4 comments
Closed

[Bug] Unable to migrate to TH 4.0.5 #1785

mamoedo opened this issue Feb 9, 2021 · 4 comments
Assignees
Labels
Milestone

Comments

@mamoedo
Copy link

mamoedo commented Feb 9, 2021

Request Type

Bug

Work Environment

Question Answer
OS version (server) Debian
TheHive version / git hash 4.0.5
Package Type Binary

Problem Description

Cannot migrate from TH3 to TH4.0.5. New exceptions are shown.

Steps to Reproduce

cd /opt/thehive/bin && cp /opt/thehive/conf/logback-migration.xml /etc/thehive/ && ./migrate --output /etc/thehive/application.conf --main-organisation Main-Org --es-index the_hive --es-uri http://192.167.0.20:19200 &> /tmp/migration.txt &

Possible Solutions

I don't know the possible solutions. It may be related to this issues opened in previous versions #1682

Complementary information

Some cases are migrated in between this 2 following logs:

[error] uncaught error, not retrying
java.lang.NullPointerException: null
[error] Exception raised, rollback (null)
[error] Action creation failure: java.lang.NullPointerException
[error] uncaught error, not retrying
java.lang.NullPointerException: null
[error] Exception raised, rollback (null)
[error] Action creation failure: java.lang.NullPointerException
[error] Exception raised, rollback (null)
[error] Job creation failure: java.lang.NullPointerException
[error] uncaught error, not retrying
java.lang.NullPointerException: null
        at org.janusgraph.graphdb.types.VertexLabelVertex.isPartitioned(VertexLabelVertex.java:41)
        at org.janusgraph.graphdb.database.idassigner.VertexIDAssigner.getVertexIDType(VertexIDAssigner.java:363)
        at org.janusgraph.graphdb.database.idassigner.VertexIDAssigner.assignID(VertexIDAssigner.java:153)
        at org.janusgraph.graphdb.database.StandardJanusGraph.assignID(StandardJanusGraph.java:474)
        at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addVertex(StandardJanusGraphTx.java:514)
        at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addVertex(StandardJanusGraphTx.java:532)
        at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addVertex(StandardJanusGraphTx.java:528)
        at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addVertex(StandardJanusGraphTx.java:98)
        at org.thp.thehive.connector.cortex.models.Job$$anon$7.create(Job.scala:22)
        at org.thp.thehive.connector.cortex.models.Job$$anon$7.create(Job.scala:22)

After this log, migration is stopped:

[error] uncaught error, not retrying
java.lang.IllegalStateException: Cannot access element because its enclosing transaction is closed and unbound
        at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.getNextTx(StandardJanusGraphTx.java:305)
        at org.janusgraph.graphdb.vertices.AbstractVertex.it(AbstractVertex.java:53)
        at org.janusgraph.graphdb.vertices.AbstractVertex.it(AbstractVertex.java:37)
        at org.janusgraph.graphdb.internal.AbstractElement.isRemoved(AbstractElement.java:141)
        at java.util.ArrayList.removeIf(ArrayList.java:1413)
        at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.getVertices(StandardJanusGraphTx.java:426)
        at org.janusgraph.graphdb.tinkerpop.JanusGraphBlueprintsTransaction.vertices(JanusGraphBlueprintsTransaction.java:138)
        at org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep.lambda$new$0(GraphStep.java:69)
        at org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep.processNextStart(GraphStep.java:157)
        at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:143)
[error] Exception raised, rollback (Cannot access element because its enclosing transaction is closed and unbound)
[error] Alert/Observable creation failure: java.lang.IllegalStateException: Cannot access element because its enclosing transaction is closed and unbound
[error] uncaught error, not retrying
org.janusgraph.core.JanusGraphException: ID block allocation on partition(13)-namespace(0) failed with an exception in 358.0 ms
        at org.janusgraph.graphdb.database.idassigner.StandardIDPool.waitForIDBlockGetter(StandardIDPool.java:143)
        at org.janusgraph.graphdb.database.idassigner.StandardIDPool.nextBlock(StandardIDPool.java:182)
        at org.janusgraph.graphdb.database.idassigner.StandardIDPool.nextID(StandardIDPool.java:208)
        at org.janusgraph.graphdb.database.idassigner.VertexIDAssigner.assignID(VertexIDAssigner.java:333)
        at org.janusgraph.graphdb.database.idassigner.VertexIDAssigner.assignID(VertexIDAssigner.java:182)
        at org.janusgraph.graphdb.database.idassigner.VertexIDAssigner.assignID(VertexIDAssigner.java:153)
        at org.janusgraph.graphdb.database.StandardJanusGraph.assignID(StandardJanusGraph.java:474)
        at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addVertex(StandardJanusGraphTx.java:514)
        at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addVertex(StandardJanusGraphTx.java:532)
        at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addVertex(StandardJanusGraphTx.java:528)
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Store cannot be found: janusgraph_ids
        at java.util.concurrent.FutureTask.report(FutureTask.java:122)
        at java.util.concurrent.FutureTask.get(FutureTask.java:206)
        at org.janusgraph.graphdb.database.idassigner.StandardIDPool.waitForIDBlockGetter(StandardIDPool.java:139)
        at org.janusgraph.graphdb.database.idassigner.StandardIDPool.nextBlock(StandardIDPool.java:182)
        at org.janusgraph.graphdb.database.idassigner.StandardIDPool.nextID(StandardIDPool.java:208)
        at org.janusgraph.graphdb.database.idassigner.VertexIDAssigner.assignID(VertexIDAssigner.java:333)
        at org.janusgraph.graphdb.database.idassigner.VertexIDAssigner.assignID(VertexIDAssigner.java:182)
        at org.janusgraph.graphdb.database.idassigner.VertexIDAssigner.assignID(VertexIDAssigner.java:153)
        at org.janusgraph.graphdb.database.StandardJanusGraph.assignID(StandardJanusGraph.java:474)
        at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.addVertex(StandardJanusGraphTx.java:514)
Caused by: java.lang.IllegalStateException: Store cannot be found: janusgraph_ids
        at org.janusgraph.diskstorage.cql.CQLStoreManager.lambda$null$23(CQLStoreManager.java:504)
        at io.vavr.control.Option.getOrElseThrow(Option.java:319)
        at org.janusgraph.diskstorage.cql.CQLStoreManager.lambda$mutateManyUnlogged$30(CQLStoreManager.java:504)
        at io.vavr.collection.Iterator$34.hasNext(Iterator.java:1503)
        at io.vavr.collection.Traversable.foldLeft(Traversable.java:471)
        at io.vavr.concurrent.Future.sequence(Future.java:549)
        at org.janusgraph.diskstorage.cql.CQLStoreManager.mutateManyUnlogged(CQLStoreManager.java:499)
        at org.janusgraph.diskstorage.cql.CQLStoreManager.mutateMany(CQLStoreManager.java:457)
        at org.janusgraph.diskstorage.cql.CQLKeyColumnValueStore.mutate(CQLKeyColumnValueStore.java:383)
        at org.janusgraph.diskstorage.idmanagement.ConsistentKeyIDAuthority.lambda$getIDBlock$3(ConsistentKeyIDAuthority.java:317)
[error] Exception raised, rollback (ID block allocation on partition(13)-namespace(0) failed with an exception in 358.0 ms)
[error] Alert/Observable creation failure: org.janusgraph.core.JanusGraphException: ID block allocation on partition(13)-namespace(0) failed with an exception in 358.0 ms

@mamoedo
Copy link
Author

mamoedo commented Mar 5, 2021

@nadouani @To-om will this issue be checked out before TH 4.1.0 release?

@nadouani
Copy link
Contributor

nadouani commented Mar 8, 2021

Hello @nadouani we will take a look

@To-om
Copy link
Contributor

To-om commented Mar 8, 2021

Hi,
The schema of your database hasn't been correctly set up. Did you start migration with an existing TH4 DB ?

@To-om To-om added this to the 4.1.0 milestone Mar 8, 2021
@mamoedo
Copy link
Author

mamoedo commented Mar 8, 2021

@To-om I always start the migration without a database and I let the migration tool create it. It usually works if only 1 index is migrated, but it fails if more than 1 index are migrated (I think #1682 issue is key to this problem)

To-om added a commit that referenced this issue Mar 9, 2021
@To-om To-om closed this as completed Mar 9, 2021
To-om added a commit that referenced this issue Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants