jexp / neo4j-shell-tools

A bunch of import/export tools for the neo4j-shell
289 stars 55 forks source link

export-graphml with cypher hangs forever #83

Open rotten opened 8 years ago

rotten commented 8 years ago

I successfully used export-graphml without cypher a couple of weeks ago to dump a 40G (or so) neo4j database to graphml. (on a 32G system) It takes a while. It missed a few <key /> definitions, but they were easy to add back to the XML file afterwards.

I successfully used export-graphml with a match to export a subgraph on a smaller database (a few hundred thousand nodes and maybe 2M relationships). It starts writing the file within a couple of minutes.

However, when I try that same export-graphml command to export a subgraph from the bigger database, it hangs (presumably) forever. I let it run nearly 24 hours with nothing - no errors, no changes to console.log, messages.log, nor the screen. It doesn't even look like it is consuming any cpu (although the process is still there). It creates a file of size Zero as soon as I start it, but never writes anything.

FWIW, import-cypher -o immediately starts writing a csv and seems to work. I suspect export-cypher would as well, but I haven't tried that because it mangles the integer properties. (issue #80)

jexp commented 8 years ago

@rotten could you take a thread-dump (kill -3 or jstack ) to see where it actually hangs? I get to your other issue as soon as I find some time.

rotten commented 8 years ago

A thread dump of the shell or the database?

jexp commented 8 years ago

Possibly both as I don't know where the hanging actually occurs.

But if you run shell with "-path /path/to/graph.db" then only the shell.

rotten commented 8 years ago

I've been swamped since I reported this issue and haven't had a chance to experiment with the bigger database again. Meanwhile I have noticed that sometimes it is neo4j-shell that gets stuck. I've had this happen several times. When you try to connect with neo4j-shell, it just hangs indefinitely, even though otherwise the database appears to be functioning normally (and is mostly idle). If you bounce the database, neo4j-shell connects immediately. I'm wondering if my graphml export attempts were related. My bigger database is in such a state at the moment. I'll try getting stack traces of the plain neo4j-shell getting completely stuck and share those after its current round of data processing finishes. (It looks like it will take a couple more days to finish.)

jexp commented 8 years ago

@rotten did you try it with a shell that uses the on-disk files with -path data/graph.db ??

rotten commented 8 years ago

I hadn't tried it with that option. I was trying to connect via host/port. I just tried it, and it looks like I have to shut down the database server to use that option.

ERROR (-v for expanded information): Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, /data/neo4j_db/graph.db java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, /data/neo4j_db/graph.db at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:143) at org.neo4j.kernel.impl.factory.CommunityFacadeFactory.newFacade(CommunityFacadeFactory.java:43) at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:108) at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase(GraphDatabaseFactory.java:129) at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:117) at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:185) at org.neo4j.shell.kernel.GraphDatabaseShellServer.instantiateGraphDb(GraphDatabaseShellServer.java:210) at org.neo4j.shell.kernel.GraphDatabaseShellServer.(GraphDatabaseShellServer.java:73) at org.neo4j.shell.StartClient.getGraphDatabaseShellServer(StartClient.java:313) at org.neo4j.shell.StartClient.tryStartLocalServerAndClient(StartClient.java:289) at org.neo4j.shell.StartClient.startLocal(StartClient.java:277) at org.neo4j.shell.StartClient.start(StartClient.java:210) at org.neo4j.shell.StartClient.main(StartClient.java:145) Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter@19c281d5' was successfully initialized, but failed to start. Please see attached cause exception. at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:462) at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111) at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:139) ... 12 more Caused by: org.neo4j.kernel.StoreLockException: Store and its lock file has been locked by another process: /data/neo4j_db/graph.db/store_lock. Please ensure no other process is using this database, and that the directory is writable (required even for read-only access) at org.neo4j.kernel.StoreLocker.storeLockException(StoreLocker.java:93) at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:79) at org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:44) at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452) ... 14 more