tinkerpop3 icon indicating copy to clipboard operation
tinkerpop3 copied to clipboard

Plugin installation in gremlin console not works

Open generall opened this issue 8 years ago • 20 comments

gremlin> :install com.blazegraph blazegraph-gremlin 1.0.0
==>Conflicting module versions. Module [groovy-xml is loaded in version 2.4.6 and you are trying to load version 2.4.1

generall avatar Jun 25 '16 12:06 generall

+1

gremlin> :install com.blazegraph blazegraph-gremlin 1.0.0
==>Conflicting module versions. Module [groovy-xml is loaded in version 2.4.7 and you are trying to load version 2.4.1

bdecarne avatar Nov 16 '16 18:11 bdecarne

+1

rulai-huajunzeng avatar Jan 25 '17 00:01 rulai-huajunzeng

+1 Is there any workaround for this?

chetanism avatar Feb 09 '17 08:02 chetanism

Ok, found this warning on gremlin-documentation

Plugins must be compatible with the version of the Gremlin Console (or Gremlin Server) being used. Attempts to use incompatible versions cannot be guaranteed to work. Moreover, be prepared for dependency conflicts in third-party plugins, that may only be resolved via manual jar removal from the ext/{plugin} directory.

After you have installed the plugin and see the error, exit gremlin-console. To fix the problem:

  1. browse to [gremlin-console-path]/ext/blazegraph-gremlin/plugin (in file browser or another shell)
  2. Try running gremlin-console, for each jar it throws an error, remove it from the plugin directory from step 1.
  3. Keep repeating step 2, till it finally runs!

chetanism avatar Feb 09 '17 09:02 chetanism

The fix is the following:

     rm -vf ${GREMLIN3_HOME}/lib/groovy-swing-2.4.*.jar
     rm -vf ${GREMLIN3_HOME}/lib/groovy-jsr223-2.4.*-indy.jar
     rm -vf ${GREMLIN3_HOME}/lib/groovy-xml-2.4.*.jar

Also, you should have .groovy/grapeConfig.xml in your home with something like:

<ivysettings>
  <settings defaultResolver="downloadGrapes"/>
  <resolvers>
    <chain name="downloadGrapes">
      <filesystem name="cachedGrapes">
        <ivy pattern="${user.home}/.groovy/grapes/[organisation]/[module]/ivy-[revision].xml"/>
        <artifact pattern="${user.home}/.groovy/grapes/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
      </filesystem>
      <ibiblio name="local" root="file:${user.home}/.m2/repository/" m2compatible="true"/>
      <ibiblio name="codehaus" root="http://repository.codehaus.org/" m2compatible="true"/>
      <ibiblio name="central" root="http://central.maven.org/maven2/" m2compatible="true"/>
      <ibiblio name="jitpack" root="https://jitpack.io" m2compatible="true"/>
      <ibiblio name="java.net2" root="http://download.java.net/maven/2/" m2compatible="true"/>
     </chain>
  </resolvers>
</ivysettings>

And you should use the last (3.2.4) version of gremlin

curl -L -o /tmp/gremlin.zip \
    http://mirror.nohup.it/apache/tinkerpop/3.2.4/apache-tinkerpop-gremlin-console-3.2.4-bin.zip && \
    unzip /tmp/gremlin.zip -d /opt/ && \
    rm /tmp/gremlin.zip && \
    ln -s /opt/apache-tinkerpop-gremlin-console-3.2.4 ${GREMLIN3_HOME}

kuzeko avatar Feb 23 '17 08:02 kuzeko

Hi greenguy33, I'm sorry to hear that! First note that what we are discussing here is a workaround, until the libs are updated in the repo.

Anyway, I have a docker image, that I just rebuilt, which executes the steps (below more details) and I can confirm that it works. Maybe you had other dependencies involved?

My dockerfile does the following:

 RUN   ${GREMLIN3_HOME}/bin/gremlin.sh -e /tmp/install-blazegraph.groovy &&
            rm -vf ${GREMLIN3_HOME}/lib/groovy-swing-2.4.*.jar &&
            rm -vf ${GREMLIN3_HOME}/lib/groovy-jsr223-2.4.*-indy.jar &&   
            rm -vf ${GREMLIN3_HOME}/lib/groovy-xml-2.4.*.jar &&     
            ${GREMLIN3_HOME}/bin/gremlin.sh -e /tmp/activate-blazegraph.groovy

The content of /tmp/install-blazegraph.groovy is only:

  :install com.blazegraph blazegraph-gremlin 1.0.0

and the content of /tmp/activate-blazegraph.groovy is just

 :plugin use tinkerpop.blazegraph
 :plugin use tinkerpop.sugar

I hope this helps

kuzeko avatar Mar 03 '17 16:03 kuzeko

Hi kuzeko, you will notice that I deleted my comment. This is because I tried your method a second time and on the second attempt it worked. I am not sure why the first time my console was broken and the second time it worked.

greenguy33 avatar Mar 03 '17 16:03 greenguy33

Ok, good to know! 👍

kuzeko avatar Mar 03 '17 16:03 kuzeko

@kuzeko Actually it didn't quite work...after I removed those three files and ran :install com.blazegraph blazegraph-gremlin 1.0.0 in Gremlin Console I got this error:

==>No signature of method: org.apache.tinkerpop.gremlin.groovy.util.DependencyGrabber.copyDependenciesToPath() is applicable for argument types: (org.apache.tinkerpop.gremlin.groovy.util.Artifact) values: [org.apache.tinkerpop.gremlin.groovy.util.Artifact@ee7a6491] Possible solutions: copyDependenciesToPath(org.apache.tinkerpop.gremlin.groovy.plugin.Artifact)

greenguy33 avatar Mar 03 '17 16:03 greenguy33

As I said, I just re-run my makefiles, and everything checks out. So I would ask you to check the following: Do you have the .groovy/grapeConfig.xml in your home with the above content? Did you download a fresh version of apache-tinkerpop-gremlin-console-3.2.4-bin.zip ? Also run install just before removing, and use the /bin/gremlin.sh -e command not the interactive console for installing.

kuzeko avatar Mar 03 '17 16:03 kuzeko

I did the following steps and was able to have the blazegraph plugin show up in my :plugin list:

  1. Added the line "ibiblio name="local" root="file:${user.home}/.m2/repository/" m2compatible="true"/" to my graphConfig.xml
  2. Downloaded a fresh version of Gremlin Console
  3. Removed the 3 files that you mentioned to remove
  4. Created tmp/install-blazegraph.groovy containing just the text :install com.blazegraph blazegraph-gremlin 1.0.0
  5. Ran (from windows): gremlin.bat -e tmp/install-blazegraph.groovy
  6. Opened gremlin console and ran from inside the console :plugin use tinkerpop.blazegraph
  7. Restarted the console.

Thanks for your help! Seems to be working great now.

greenguy33 avatar Mar 03 '17 17:03 greenguy33

@greenguy33 I followed your steps, but it doesn't work. My gremlin-console is version 3.3.1

jianfa avatar Jan 10 '18 23:01 jianfa

@jianfa Sorry to hear that. My team gave up on trying to use Gremlin with Blazegraph long ago. Ran into all sorts of problems like this throughout and eventually decided it wasn't worth it.

greenguy33 avatar Jan 11 '18 15:01 greenguy33

@greenguy33 Thank you for your response. Are you still using TinkerPop? My team is trying to compare the performance of BlazeGraph to JanusGraph. Maybe you have the experience in both BlazeGraph and JanusGraph. Do you have any suggestion for a newbie? Thanks.

jianfa avatar Jan 11 '18 15:01 jianfa

@jianfa I actually have not heard of JanusGraph. My team was interested in putting together an application for storing/manipulating RDF data, and we initially explored Blazegraph. However we have moved on to using Ontotext Graph DB, which has met our needs better. It does not support TinkerPop, so we are using dynamically generated SPARQL instead. Sorry I can't be of more help.

greenguy33 avatar Jan 11 '18 15:01 greenguy33

@greenguy33 Thank you for the helpful information.

jianfa avatar Jan 11 '18 16:01 jianfa

Hi @jianfa , it depends if you need to deal with SPARQL or not. I've run extensive experiments for the NON-SPARQL part, but if you need to go through SPARQL then you should not use tinkerpop/gremlin at all.

kuzeko avatar Jan 11 '18 16:01 kuzeko

Can we install plugin without firing gremlin console ?

In other words.. i would like to automate plugin installation instead of manually typing :install and things like that..

prashanthmadi avatar Apr 16 '18 22:04 prashanthmadi

You can run the gremlin console like a command, I have it working in a docker file without being interactive.

You pass it a command, or a file to run

kuzeko avatar Apr 18 '18 12:04 kuzeko

Thanks @kuzeko . I was able to do this using -e option but it doesn't print output on console :(

echo ":install org.apache.tinkerpop spark-gremlin 3.4.0-SNAPSHOT" > init.groovy echo ":plugin use tinkerpop.spark" >> init.groovy bin/gremlin.sh -e init.groovy


It works for now but i have no way to debug if things go wrong.

prashanthmadi avatar Apr 19 '18 15:04 prashanthmadi