Neo4j Bug in Tinkerpop3

136 de afișări
Accesați primul mesaj necitit

potera...@gmail.com

necitită,
18 mar. 2015, 10:42:0618.03.2015
– gremli...@googlegroups.com
Hi Guys,

I think I've found a bug in the Neo4j implementation for T3.

Please run the following test:
    
    @Test
    public void neo4jPropertyBug2(){
    Configuration config = new BaseConfiguration();
    config.addProperty("gremlin.neo4j.metaProperties", true);
        config.addProperty("gremlin.neo4j.multiProperties", true);
        config.addProperty("gremlin.neo4j.directory", "neo4jdbBug");
        
        Neo4jGraph neo4jGraph = Neo4jGraph.open(config); 
        
        Vertex v = neo4jGraph.addVertex("prop", "abc");
        VertexProperty<String> prop = v.property("prop");
        assertTrue(Property.empty().equals(prop.property("some-missing-meta-prop")));
    }


I would normally expect the above test to pass. However, it fails with the following stack trace:

java.lang.NullPointerException
at com.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty.property(Neo4jVertexProperty.java:121)
at com.itc.graph.structure.Neo4jTest.neo4jPropertyBug(Neo4jTest.java:29)

Please have a look at method Neo4jVertexProperty.property:

    public <U> Property<U> property(final String key) {
        if (!this.vertex.graph.supportsMetaProperties)
            throw VertexProperty.Exceptions.metaPropertiesNotSupported();

        this.vertex.graph.tx().readWrite();
        try {
            if (this.node.hasProperty(key))
                return new Neo4jProperty<>(this, key, (U) this.node.getProperty(key));
            else
                return Property.empty();
        } catch (IllegalStateException | NotFoundException ex) {
            throw Element.Exceptions.elementAlreadyRemoved(this.getClass(), this.id());
        }
    }

It calls this.node.hasProperty(key), and since this.node is null (no meta-property added on the vertex property yet), it raises a NullPointerException.
I suppose the above code should do something like:

         if (isNode() && this.node.hasProperty(key)) { ....


Cheers,
Cosmin.

Stephen Mallette

necitită,
20 mar. 2015, 07:12:5220.03.2015
– gremli...@googlegroups.com
Thanks for finding this.  It identified a bug as well as a hole in our test suite.  It has been corrected as you suggested:




--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/87cab8db-64e0-4d27-bbfb-9f1232c62584%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mesajul a fost șters

potera...@gmail.com

necitită,
24 mar. 2015, 12:17:4224.03.2015
– gremli...@googlegroups.com
Hi Stephen,

Thanks for fixing it.

Cheers,
Cosmin

drVillo

necitită,
7 iul. 2016, 06:20:3007.07.2016
– Gremlin-users
Bumping up this thread. I'm encountering a similar issue when attempting to use subgraph() on Neo4j (the same statement works using the Tinkergraph).

This happens running gremlin-console-3.2.0-incubating, which from what I see uses the fix above.

Thanks
F

Trace below
----------------

gremlin> g.V(33772442).valueMap()
==>[profileId:[101276158], siteId:[10]]
gremlin> sg = g.V(33772442).outE().subgraph('sg').cap('sg').next()
Properties on a vertex property is not supported
Display stack trace? [yN] y
java.lang.UnsupportedOperationException: Properties on a vertex property is not supported
at org.apache.tinkerpop.gremlin.structure.VertexProperty$Exceptions.metaPropertiesNotSupported(VertexProperty.java:103)
at org.apache.tinkerpop.gremlin.neo4j.structure.trait.NoMultiNoMetaNeo4jTrait.getProperties(NoMultiNoMetaNeo4jTrait.java:146)
at org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertexProperty.properties(Neo4jVertexProperty.java:97)
at org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SubgraphStep.lambda$getOrCreate$2(SubgraphStep.java:102)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SubgraphStep.getOrCreate(SubgraphStep.java:100)
at org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SubgraphStep.addEdgeToSubgraph(SubgraphStep.java:111)
at org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SubgraphStep.sideEffect(SubgraphStep.java:64)
at org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectStep.processNextStart(SideEffectStep.java:39)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.hasNext(AbstractStep.java:140)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.ExpandableStepIterator.hasNext(ExpandableStepIterator.java:42)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.SupplyingBarrierStep.processAllStarts(SupplyingBarrierStep.java:83)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.SupplyingBarrierStep.processNextStart(SupplyingBarrierStep.java:70)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:126)
at org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep.next(AbstractStep.java:37)
at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.next(DefaultTraversal.java:156)
...

Stephen Mallette

necitită,
7 iul. 2016, 06:50:5107.07.2016
– Gremlin-users
This looks like a different error to me (unrelated to the original thread). I just might see the problem, but not completely sure about it. Could you please create a more complete, simple example, with some basic sample data that replicates the problem? If I had a nice console session to work with I think it could be solved pretty quickly....maybe even create an issue in JIRA to track it given that this does look like a bug: https://issues.apache.org/jira/browse/TINKERPOP/



--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

drVillo

necitită,
7 iul. 2016, 08:38:2207.07.2016
– Gremlin-users
Agreed. I've been able to reproduce it with a test graph and created this ticket: https://issues.apache.org/jira/browse/TINKERPOP-1359

I like the idea of extracting subgraphs from the full database _a lot_. This will make analysis a lot more manageable for our BI team. Just so I know, how is your release schedule looking like?
Thanks!
F

Stephen Mallette

necitită,
8 iul. 2016, 06:32:3208.07.2016
– Gremlin-users
thanks for doing that. we are currently preparing for a release of 3.1.3 and 3.2.1 - we typically freeze code changes for a week before release and focus on test and documentation and that should start at the end of the day today. after that the community votes to release - so i would expect us to have those out the week of July 18th. 

i will try to figure out what's wrong with your bug so that the fix can go in to this release cycle.

drVillo

necitită,
8 iul. 2016, 07:52:3408.07.2016
– Gremlin-users
thank you, appreciated:)
F

drVillo

necitită,
11 iul. 2016, 15:27:2011.07.2016
– Gremlin-users
Sorry to be a pain but I've pulled master in order to play with this change but I can't get the neo4j plugin installed... See below (executed from ./tinkerpop/gremlin-console/target/apache-gremlin-console-3.2.1-SNAPSHOT-standalone/bin

gremlin> :install org.apache.tinkerpop neo4j-gremlin 3.2.1-SNAPSHOT
log4j:WARN No appenders could be found for logger (org.apache.tinkerpop.gremlin.groovy.util.DependencyGrabber).
log4j:WARN Please initialize the log4j system properly.
==>Conflicting module versions. Module [groovy-swing is loaded in version 2.4.7 and you are trying to load version 2.4.6

I couldn't find a reference to 2.4.6 in the project's pom though.
Cheers

Stephen Mallette

necitită,
11 iul. 2016, 15:33:3211.07.2016
– Gremlin-users
we just bumped to groovy 2.4.7 in the last week or so. not sure how you're building/installing but you gotta make sure all those versions line up. looks like you have some old jars hanging around. 

Robert Dale

necitită,
11 iul. 2016, 16:53:3911.07.2016
– gremli...@googlegroups.com
First, I recommend removing your grapes cache. On linux, rm -rf
~/.groovy/grapes
I actually ran into a problem with downloading scala-reflect and had
to clear my maven cache for it: rm -rf
~/.m2/repository/org/scala-lang/scala-reflect

If you have master checked out, this will recompile all necessary deps
with the correct groovy version and should get you going:

mvn clean install -Dmaven.test.skip=true -pl
gremlin-console,gremlin-core,gremlin-driver,gremlin-groovy,gremlin-groovy-test,gremlin-server,gremlin-shaded,gremlin-test,neo4j-gremlin,tinkergraph-gremlin

unzip gremlin-console/target/apache-gremlin-console-3.2.1-SNAPSHOT-distribution.zip
cd apache-gremlin-console-3.2.1-SNAPSHOT/
./bin/gremlin.sh
:install org.apache.tinkerpop neo4j-gremlin 3.2.1-SNAPSHOT
(restart console)
:plugin use tinkerpop.neo4j
> https://groups.google.com/d/msgid/gremlin-users/CAA-H4399zrM%2BQ2kE0tOFgin7PKjPfSnEdDtorrdiP-5-mikM_A%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Robert Dale

drVillo

necitită,
11 iul. 2016, 17:05:0711.07.2016
– Gremlin-users
Cleaning up ~/.groovy/grapes did the trick, thanks!

Stephen Mallette

necitită,
11 iul. 2016, 17:28:5011.07.2016
– Gremlin-users
pesky grapes.....

note you can build with: 

mvn clean install -DcleanGrapes 

if you have a standard .groovy grapes dir


Răspundeți tuturor
Răspundeți autorului
Redirecționați
0 mesaje noi