Stephen Mallette created TINKERPOP-2647:
-------------------------------------------
Summary: :uninstall without first disabling a plugin will lead to
error on startup
Key: TINKERPOP-2647
URL: https://issues.apache.org/jira/browse/TINKERPOP-2647
Project: TinkerPop
Issue Type: Improvement
Components: console
Affects Versions: 3.4.12
Reporter: Stephen Mallette
In the Gremlin Console, if you add a plugin like:
{code}
gremlin> :install org.apache.tinkerpop spark-gremlin 3.6.0-SNAPSHOT
==>loaded: [org.apache.tinkerpop, spark-gremlin, 3.6.0-SNAPSHOT] - restart the
console to use [tinkerpop.spark]
gremlin> :plugin use tinkerpop.spark
==>tinkerpop.spark activated
{code}
and then you choose to remove it:
{code}
gremlin> :uninstall spark-gremlin
==>Uninstalled spark-gremlin - restart the console for removal to take effect
gremlin> :x
{code}
When you restart, the console will be in a bad state and produce this sort of
exception:
{code}
$ bin/gremlin.sh
\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
plugin activated: tinkerpop.spark
gremlin> :uninstall tinkerpop.spark
==>There is no module with the name tinkerpop.spark to remove -
/home/smallette/git/apache/tinkerpop/gremlin-console/target/apache-tinkerpop-gremlin-console-3.6.0-SNAPSHOT-standalone/ext/tinkerpop.spark
gremlin> :uninstall spark-gremlin
==>Uninstalled spark-gremlin - restart the console for removal to take effect
gremlin> :x
smallette@ubuntu-vm:~/git/apache/tinkerpop/gremlin-console/target/apache-tinkerpop-gremlin-console-3.6.0-SNAPSHOT-standalone$
bin/gremlin.sh
\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
Exception in thread "main" java.lang.NullPointerException: Cannot invoke method
activate() on null object
at
org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91)
at
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:43)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at
org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:34)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.apache.tinkerpop.gremlin.console.PluggedIn$activate.call(Unknown
Source)
at
org.apache.tinkerpop.gremlin.console.Console$_closure18.doCall(Console.groovy:149)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:101)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
at
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
at groovy.lang.Closure.call(Closure.java:405)
at groovy.lang.Closure.call(Closure.java:421)
at
org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2330)
at
org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2315)
at
org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2356)
at org.codehaus.groovy.runtime.dgm$186.invoke(Unknown Source)
at
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:244)
at
org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
at
org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:147)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:80)
at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:237)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:265)
at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:524)
{code}
The reason for this issue is that the plugin registration in
{{ext/plugins.txt}} file is not cleaned up and so the console tries to load it
on startup. Normally you would {{:plugin unuse tinkerpop:spark}} prior to the
{{:uninstall}} to make sure the cleanup worked properly.
To fix this problem, {{:uninstall}} should just remove the registration the
same way that {{:plugin unuse}} would.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)