xifeng created TINKERPOP-2218:
---------------------------------

             Summary: failed static type checking when gremlin server use 
security sandbox
                 Key: TINKERPOP-2218
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2218
             Project: TinkerPop
          Issue Type: Bug
          Components: server
    Affects Versions: 3.3.0
            Reporter: xifeng


Request like "graph_test = 
XXXGraph.open('movie').traversal();graph_test.V('46')"  return error  
"org.apache.tinkerpop.gremlin.driver.exception.ResponseException: startup 
failed:\nScript17.groovy: 1: [Static type checking] - Cannot find matching 
method java.lang.Object#V(java.lang.String). Please check if the declared type 
is right and if the method exists.\n @ line 1, column 48.\n 
aph.open('movie').traversal();graph_70.V\n ^\n\n1 error\n",". It seems as if 
the variable 'graph_test' lost its type(change to Object).

my gremlin-server.yaml is as follows:

_scriptEngines: {_
 _gremlin-groovy: {_
 _plugins: \{ 
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},_
 _com.xx.xx.xx.jsr223.xxGraphGremlinPlugin: {},_
 _org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},_
 _org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin: 
\{enableThreadInterrupt: true, compilation: COMPILE_STATIC, extensions: 
org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.FileSandboxExtension},_
 _org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: \{classImports: 
[java.lang.Math], methodImports: [java.lang.Math#*]},_
 _org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: \{files: 
[scripts/generate-eywagraph.groovy]}}}}_

 

my sandbox.yaml is the same as tinkerpop document 3.3.0 posted.

 

In addition,request 
"{color:#14892c}g.V().repeat(timeLimit(2).both().groupCount('m')).times(16).cap('m').order(local).by(values,decr).next().size(){color}"
 return error 
{color:#d04437}"org.apache.tinkerpop.gremlin.driver.exception.ResponseException:
 startup failed:\nScript22.groovy: 1: [Static type checking] - Cannot find 
matching method java.lang.Object#size(). Please check if the declared type is 
right and if the method exists.\n @ line 1, column 1.\n 
g.V().repeat(timeLimit(2).both().groupCount('m')).times(16).cap('m').order(local).by(values,decr).next().size()\n
 ^\n\n1 error\n","{color}

 request like "{color:#14892c}results = 
['blah',3]\ng.V().out('rate').fill(results){color}" return error 
{color:#d04437}"org.apache.tinkerpop.gremlin.driver.exception.ResponseException:
 startup failed:\nScript25.groovy: 2: [Static type checking] - Cannot find 
matching method 
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal#fill(java.lang.Object).
 Please check if the declared type is right and if the method exists.\n @ line 
2, column 1.\n g.V().out('rate').fill(results)\n ^\n\n1 error\n",{color}

request like 
"{color:#14892c}g.V().where(__.out('rate').count().is(gte(30))).values('userid'){color}"
 return error 
{color:#d04437}"org.apache.tinkerpop.gremlin.driver.exception.ResponseException:
 startup failed:\nScript4.groovy: 1: [Static type checking] - Cannot call 
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal 
<org.apache.tinkerpop.gremlin.structure.Vertex, 
java.lang.Long>#is(org.apache.tinkerpop.gremlin.process.traversal.P 
<java.lang.Long>) with arguments 
[org.apache.tinkerpop.gremlin.process.traversal.P <java.lang.Integer>] \n @ 
line 1, column 13.\n 
g.V().where(__.out('rate').count().is(gte(30))).values('userid')\n 
^\n\nScript4.groovy: 1: [Static type checking] - Cannot find matching method 
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal#where(java.lang.Object).
 Please check if the declared type is right and if the method exists.\n @ line 
1, column 1.\n 
g.V().where(__.out('rate').count().is(gte(30))).values('userid')\n ^\n\n2 
errors\n".{color}

Any help will be appreciated!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to