2

I'm using gremlinpython version 3.3.2 and AWS NEPTUNE.
I try to drop all the edges (tried the vertices too) and it fails everytime.
g.E().drop().iterate()
Gives me:

gremlin_python.driver.protocol.GremlinServerError: 597: Exception processing a script on request [RequestMessage{, requestId=ae49cbb7-e034-4e56-ac76-b62310f753c2, op='bytecode', processor='traversal', args={gremlin=[[], [V(), drop()]], aliases={g=g}}}].

Did anyone already successfuly remove all vertices/edges of a graph in AWS Neptune?

EDIT: Dropping a specific ID works:
g.E(id).drop().iterate()

EDIT2:
Here is a backtrace done using gremlin console:

gremlin> g.E().count().next()

==>740839
gremlin> g.E().drop().iterate()
A timeout occurred within the script during evaluation of [RequestMessage{, requestId=24c3d14c-c8be-4ed9-a297-3fd2b38ace9a, op='eval', > processor='', args={gremlin=g.E().drop().iterate(), bindings={}, batchSize=64}}] - consider increasing the timeout
Type ':help' or ':h' for help.
Display stack trace? [yN]y
org.apache.tinkerpop.gremlin.jsr223.console.RemoteException: A timeout occurred within the script during evaluation of [RequestMessage{, > requestId=24c3d14c-c8be-4ed9-a297-3fd2b38ace9a, op='eval', processor='', args={gremlin=g.E().drop().iterate(), bindings={}, > batchSize=64}}] - consider increasing the timeout
at org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:178)
at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:99)
at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:95)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:130)
at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:89)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at org.apache.tinkerpop.gremlin.console.Console.(Console.groovy:146)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:453)
gremlin>

I would say it's a timeout problem, right?

VivienG
  • 2,143
  • 3
  • 24
  • 43
  • Not sure why this question is pickup up all the downvotes and a close flag. It's pretty clear if you know gremlinpython, though i don't know why you'd get that specific error for that particular traversal. I don't see anything invalid about it. Did you try to issue the same script from the Gremlin Console to see if that works? – stephen mallette Apr 17 '18 at 12:42
  • Thanks for the comment @stephenmallette, I will try to access a Gremlin Console but as it's managed product not sure I can. Keep you in touch – VivienG Apr 17 '18 at 12:48
  • 1
    you can https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-console.html – stephen mallette Apr 17 '18 at 12:53
  • I manage to get a backtrace! – VivienG Apr 17 '18 at 13:13
  • yes - if you are deleting a lot of vertices then you could run into that problem. i'm not sure what the recommended way is to clear a database with neptune. you should check into that - there may be a more efficient approach. – stephen mallette Apr 17 '18 at 13:18
  • The proposed version is to use `drop()`, I'm changing the timeout in Neptune configuration system from 2 minutes to 5 minutes. Can you tell me how can I know what error `597` is? (The first error in the question). – VivienG Apr 17 '18 at 13:22
  • the error 597 is a script exception - as it says in the text of the error. it should be thrown when the Gremlin you send isn't understood by the server, but you look like you have valid Gremlin there, so as I said earlier I'm not sure why Neptune would be rejecting that. – stephen mallette Apr 17 '18 at 13:39
  • Even with a 5 minutes timeout it fails to drop. Strange behaviour. – VivienG Apr 17 '18 at 13:40
  • `g.E().drop()`? – John Jones Jun 07 '18 at 16:05

1 Answers1

2

OK so after some exchange with @stephen mallette in comment of the question and AWS support I finally found where the problem lies.
As it still a preview NEPTUNE still suffer some smalls issues and drop() is one.
A workaround, given by the support is to perform drop() in batches via parallel connections:

g.V().limit(1000).drop()

So dropping table is hitting a timeout right now, even with a 5 minutes timeout and 700.000 edges.
I will update this answer on NEPTUNE's release.

VivienG
  • 2,143
  • 3
  • 24
  • 43
  • You shouldn't need the batched delete anymore. g.V().drop().iterate() should work fine now. – The-Big-K Oct 24 '18 at 06:38
  • 'shouldn't' but when: `gremlin> g.V().drop().iterate() {"requestId":"50d97889-208b-463f-9c9c-8e89f9df1f65","code":"InternalFailureException","detailedMessage":"An unexpected error has occurred in Neptune."} Type ':help' or ':h' for help. Display stack trace? [yN]y org.apache.tinkerpop.gremlin.jsr223.console.RemoteException: {"requestId":"50d97889-208b-463f-9c9c-8e89f9df1f65","code":"InternalFailureException","detailedMessage":"An unexpected error has occurred in Neptune."} at org.apache.tinkerpop.gremlin.console.jsr223.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:185)` – Scott Aug 22 '19 at 20:04
  • batching in groups of 100k seems to work, fine: `gremlin> g.V().limit(100000).drop().iterate()` – Scott Aug 22 '19 at 20:06