You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/11/20 20:32:00 UTC

[jira] [Commented] (TINKERPOP-1811) Improve error reporting for serialization errors between gremlin-python and gremlin-server

    [ https://issues.apache.org/jira/browse/TINKERPOP-1811?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16259791#comment-16259791 ] 

ASF GitHub Bot commented on TINKERPOP-1811:
-------------------------------------------

GitHub user spmallette opened a pull request:

    https://github.com/apache/tinkerpop/pull/753

    TINKERPOP-1811 Fixed bytecode deserialization error messaging

    As the original issue description suggests the error message wasn't very helpful. Seems there was a mistype in the log message that prevented a better output and also some error handling that wasn't quite being dealt with properly.
    
    Error now presents as:
    
    ```text
    gremlin> bytecode = g.V().asAdmin().bytecode
    ==>[[], [V()]]
    gremlin> bytecode.addStep("broken")
    gremlin> bytecode
    ==>[[], [V(), broken()]]
    gremlin> conn.submit(bytecode).next()
    org.apache.tinkerpop.gremlin.driver.exception.ResponseException: Could not locate method: DefaultGraphTraversal.broken([])
    Type ':help' or ':h' for help.
    Display stack trace? [yN]n
    ```
    
    On the server you now get this:
    
    ```text
    [ERROR] TraversalOpProcessor - Could not deserialize the Traversal instance
    java.lang.IllegalStateException: Could not locate method: DefaultGraphTraversal.broken([])
    	at org.apache.tinkerpop.gremlin.jsr223.JavaTranslator.invokeMethod(JavaTranslator.java:180)
    	at org.apache.tinkerpop.gremlin.jsr223.JavaTranslator.translate(JavaTranslator.java:91)
    	at org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor.iterateBytecodeTraversal(TraversalOpProcessor.java:367)
    ```
    
    builds with `mvn clean install && mvn verify -pl gremlin-server -DskipIntegrationTests=false`
    
    VOTE +1

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/tinkerpop TINKERPOP-1811

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/753.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #753
    
----
commit 95a6ea3f56db83449b62475045d08fc9452467e0
Author: Stephen Mallette <sp...@genoprime.com>
Date:   2017-11-20T20:26:53Z

    TINKERPOP-1811 Fixed bytecode deserialization error messaging
    
    As the original issue description suggests the error message wasn't very helpful. Seems there was a mistype in the log message that prevented a better output and also some error handling that wasn't quite being dealt with properly.

----


> Improve error reporting for serialization errors between gremlin-python and gremlin-server
> ------------------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-1811
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1811
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: python, server
>    Affects Versions: 3.2.6
>            Reporter: Hugo Arts
>            Priority: Minor
>
> We ran into an issue while attempting to add a PartitionStrategy to our traversals. This is a small example of a traversal I tried:
> {code:none}
> remote = DriverRemoteConnection('ws://localhost:8182/gremlin', 'DSE_GRAPH_QUICKSTART.g')
> strategy = PartitionStrategy('community_id', '2097442560', 2097442560)
> g = Graph().traversal().withRemote(remote).withStrategies(strategy)
> print(g.V().toList())
> {code}
> The third argument of PartitionStrategy should be a list. However, the traversal strategies in gremlin-python do not do any kind of argument/type checking, and any mistake you make results in the following error from gremlin server:
> {noformat}
> ERROR [gremlin-server-worker-1] 2017-10-25 10:15:53,285 GREMLIN TraversalOpProcessor.java:365 - Could not deserialize the Traversal instance
> {noformat}
> I've omitted the [full traceback|https://gist.github.com/anonymous/2ad6541d0169256afb1a23fbdc376009] for brevity. There is not much indication as to what has gone wrong. gremlin-python gives this error:
> {noformat}
> gremlin_python.driver.protocol.GremlinServerError: 599: None
> {noformat}
> Which is also unhelpful. We were eventually able to figure out what we were doing wrong, but it would be very nice to have either some input validation on the gremlin-python side, or have gremlin-server be more specific about the nature of the deserialisation error (or both).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)