Ticket #787 (closed Defect: worksforme)

Opened 7 years ago

Last modified 6 years ago

dm44-wikidata: upgrading database failed due to strange error in an imperative migration

Reported by: Malte Owned by: Malte
Priority: Major Milestone:
Component: 3rd Party Plugins Version: 4.4
Keywords: Cc: jri
Complexity: 3 Area:
Module:

Description

I came across a strange error when trying to migrate my dm44-snapshot database with wikidata-search 0.0.3 contents to the 4.4 release and wikidata-search 0.0.4

SEVERE: Handling PLUGIN_ACTIVATED event from "de.deepamehta.accesscontrol" for plugin "DeepaMehta 4 Wikidata Search" failed
java.lang.RuntimeException: Activation of plugin "DeepaMehta 4 Wikidata Search" failed
	at de.deepamehta.core.impl.PluginImpl.activate(PluginImpl.java:485)
	at de.deepamehta.core.impl.PluginManager.activatePlugin(PluginManager.java:64)
	at de.deepamehta.core.impl.PluginImpl.checkRequirementsForActivation(PluginImpl.java:451)
	at de.deepamehta.core.impl.PluginImpl.handleEvent(PluginImpl.java:884)
	at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415)
	at org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks$1.run(SyncDeliverTasks.java:145)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Installing plugin "DeepaMehta 4 Wikidata Search" in the database failed
	at de.deepamehta.core.impl.PluginImpl.installPluginInDB(PluginImpl.java:524)
	at de.deepamehta.core.impl.PluginImpl.activate(PluginImpl.java:472)
	... 10 more
Caused by: java.lang.RuntimeException: Running migration 10 of plugin "DeepaMehta 4 Wikidata Search" failed
	at de.deepamehta.core.impl.MigrationManager.runMigration(MigrationManager.java:144)
	at de.deepamehta.core.impl.MigrationManager.runPluginMigration(MigrationManager.java:89)
	at de.deepamehta.core.impl.MigrationManager.runPluginMigrations(MigrationManager.java:57)
	at de.deepamehta.core.impl.PluginImpl.installPluginInDB(PluginImpl.java:511)
	... 11 more
Caused by: java.lang.RuntimeException: Creating association failed (association (id=-1, uri="", typeUri="dm4.core.sequence", value="", childTopics={},
        association role (roleTypeUri="dm4.core.predecessor", playerId=3662),
        association role (roleTypeUri="dm4.core.successor", playerId=226331)))
	at de.deepamehta.core.impl.EmbeddedService.createAssociation(EmbeddedService.java:260)
	at de.deepamehta.core.impl.EmbeddedService.createAssociation(EmbeddedService.java:575)
	at de.deepamehta.core.impl.TypeStorageImpl.storeSequenceSegment(TypeStorageImpl.java:507)
	at de.deepamehta.core.impl.TypeStorageImpl.appendToSequence(TypeStorageImpl.java:496)
	at de.deepamehta.core.impl.AttachedType.addAssocDef(AttachedType.java:164)
	at org.deepamehta.plugins.wikidata.migrations.Migration10.run(Migration10.java:52)
	at de.deepamehta.core.impl.MigrationManager.runMigration(MigrationManager.java:136)
	... 14 more
Caused by: java.lang.IllegalStateException: Node[3662] has been deleted in this tx
	at org.neo4j.kernel.impl.core.LockReleaser$CowEntityElement.assertNotDeleted(LockReleaser.java:133)
	at org.neo4j.kernel.impl.core.LockReleaser$CowEntityElement.getPropertyAddMap(LockReleaser.java:126)
	at org.neo4j.kernel.impl.core.LockReleaser$CowNodeElement.getPropertyAddMap(LockReleaser.java:143)
	at org.neo4j.kernel.impl.core.LockReleaser.getCowPropertyAddMap(LockReleaser.java:545)
	at org.neo4j.kernel.impl.core.NodeManager.getCowPropertyAddMap(NodeManager.java:1089)
	at org.neo4j.kernel.impl.core.Primitive.getProperty(Primitive.java:150)
	at org.neo4j.kernel.impl.core.NodeImpl.getProperty(NodeImpl.java:52)
	at org.neo4j.kernel.impl.core.NodeProxy.getProperty(NodeProxy.java:155)
	at de.deepamehta.storage.neo4j.NodeType.of(NodeType.java:45)
	at de.deepamehta.storage.neo4j.Neo4jStorage.checkType(Neo4jStorage.java:1014)
	at de.deepamehta.storage.neo4j.Neo4jStorage.fetchAssociationNode(Neo4jStorage.java:992)
	at de.deepamehta.storage.neo4j.Neo4jStorage.fetchPlayerNode(Neo4jStorage.java:913)
	at de.deepamehta.storage.neo4j.Neo4jStorage.storePlayerRelationship(Neo4jStorage.java:901)
	at de.deepamehta.storage.neo4j.Neo4jStorage.storeAssociation(Neo4jStorage.java:265)
	at de.deepamehta.core.impl.StorageDecorator.storeAssociation(StorageDecorator.java:264)
	at de.deepamehta.core.impl.EmbeddedService.associationFactory(EmbeddedService.java:690)
	at de.deepamehta.core.impl.EmbeddedService.createAssociation(EmbeddedService.java:256)
	... 20 more

See lines 50 and 52 in https://github.com/mukil/dm4-wikidata/blob/master/src/main/java/org/deepamehta/plugins/wikidata/migrations/Migration10.java

When performing a clean-install of the wikidata 0.0.4 release this error did not occur. Any deeper ideas on what this log output suggests? Adding and deleting assocDefs involving the same type not supported within 1 TX? But if so, why does this code runs without an error when a clean install is performed? Probably a severe bug by me but i anyway wanted to ask for your help.

Change History

comment:1 Changed 7 years ago by jri

At first sight I can't see a problem with your code.
To further investigate this I need to know the exact conditions.
How would the exact procedure look like to reproduce the error?

comment:2 Changed 7 years ago by jri

Meanwhile I encountered a similar Neo4j exception (Node[...] not found) while running a migration of my own plugin.
However i can't reproduce it (the next time it runs it works) and thus it is hard to track.
Can you confirm that your exception is not reproducable as well?
Perhaps you pointed to a deeper problem here.

comment:3 Changed 6 years ago by jri

  • Status changed from new to closed
  • Resolution set to worksforme
Note: See TracTickets for help on using tickets.