I came in to a situation in which I have to run a bash script lets say testbash.sh has the following lines:
#!/bin/bash
dse gremlin-console -i test.groovy
test.groovy file contains:
:remote config alias g cord.g
schema.describe()
The output of bash script testbash.sh is below
Error in /home/nithin/test.groovy at [2: schema.describe()] - No such property: schema for class: groovysh_evaluate.
Any clue will be greatly appreciated.
I can't seem to recreate your problem (at least on the latest version of 5.1.x). To troubleshoot, I think that you should first start dse gremlin-console
without the -i
and paste the commands from the script into the console and make sure that they return properly. If you get the same error, then you know that you can start looking into the problem from there without worrying about -i
at all. Is cord.g
initialized with a graph for a schema to be present?
If the commands work fine, then there must be something wrong with the console bootstrap that initializes it to work with the server on startup. The bootstrap script should be present in your DSE installation and is called dse-init.groovy
. I would try pasting you commands into the bottom of that script and seeing if that solves your problem. If it does, then perhaps you have an older version of DSE because I do recall some changes in recent months for -i
and -e
handling that perhaps are related. I think that editing dse-init.groovy
could be a reasonable workaround for you if you aren't able to upgrade for some reason.