Unable to run variable assignment in remote mode

15 views
Skip to first unread message

Jeff Zhang

unread,
Nov 14, 2024, 3:58:20 AM11/14/24
to Gremlin-users
Hi, 

I'd like to play with janusgraph via remote mode. But it looks like I am unable to execute assignment statement in remote mode as following, is there any difference between remote mode and non-remote mode? Thanks

gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182] - type ':remote console' to return to local mode
gremlin> g
==>graphtraversalsource[standardjanusgraph[berkeleyje:/var/lib/janusgraph/data], standard]
gremlin> a =  10
==>10
gremlin> a
No such property: a for class: Script98
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin>

Ken Hu

unread,
Nov 15, 2024, 1:40:50 AM11/15/24
to Gremlin-users
This is probably due to how sessionless requests work again GremlinServer-based servers in 3.7.x. See https://tinkerpop.apache.org/docs/current/reference/#considering-state for more information about sessions.

One workaround would be to use a session like https://tinkerpop.apache.org/docs/current/reference/#console-sessions. So starting your remote console session with a command like ":remote connect tinkerpop.server conf/remote.yaml session".

If you want to elevate all your variables into global variables for the entire lifetime of the server, you could enable the interpreterMode option on your server. This isn't that useful in most cases so I would try with sessions first.

Jeff Zhang

unread,
Nov 18, 2024, 5:47:31 AM11/18/24
to Gremlin-users
Thanks Ken, session mode works.
Reply all
Reply to author
Forward
0 new messages