Date   

Re: security vulnerability: janusgraph-full-1.0.0-rc1: in ./lib ( netty-all.4.1.58.Final) as well as ./lib/gremlin-console-3.6.1.jar & gremlin-driver.3.6.1.jar (netty-all.4.1.77.Final)

hadoopmarc@...
 

Hi Yingjie,

Still not clear to me.
  1. what do you mean with "they embed netty-all.4.1.77.Final.jar"? The gremlin jars only contain the code from Tinkerpop, no netty bytecode.
  2. the Cassandra lib directory need not be used, it is only included to run a local Cassandra instance for the bin/janusgraph.sh script. So, you can simply remove the cassandra directory and still use gremlin-console.
Also note that there is a separate thread for feedback on janusgraph-1.0.0-rc1, but it is OK to have the current discussion here to find out what the actual issue is.

Marc


On Wed, Jan 25, 2023 at 01:16 PM, Yingjie Li wrote:
they
embed netty-all.4.1.77.Final.jar


Re: security vulnerability: janusgraph-full-1.0.0-rc1: in ./lib ( netty-all.4.1.58.Final) as well as ./lib/gremlin-console-3.6.1.jar & gremlin-driver.3.6.1.jar (netty-all.4.1.77.Final)

Yingjie Li
 

Hello Marc,

Yes, they are in the ./lib directory of janusgraph-1.0.0-rc1 and they
embed netty-all.4.1.77.Final.jar, whose CVEs can be found in
https://mvnrepository.com/artifact/io.netty/netty-all/4.1.77.Final)
the latest version is 4.1.87. ./lib/ directory also comes with
netty.4.1.58.jar.Final,

Actually the all in one package janusgraph-full-1.0.0-rc1 that comes
with Cassandra 4.0.6, the netty-all version in both Janusgraph lib and
Cassandra lib is 4.1.58.jar , which has higher security risk of
CVSS 8.4 (sonatype-2021-0789). I was able to successfully replace the
one in Janusgraph lib with the latest 4.1.87 version. But replacing
the one in Cassandra lib throwed an exception and failed to start.

I also checked the latest Cassandra (4.1.0) and it still has the old
version jar (4.1.58). Just wondering whether anybody has some
experience in replacing this jar with the higher version in
Cassandra or gremlin console & driver 3.61.

Also any pointers to other user groups that might be able to help is
appreciated.

Thanks,
Yingjie

On Wed, Jan 25, 2023 at 2:06 AM <hadoopmarc@...> wrote:

Hi Yingjie,

Sorry, I do not understand. The gremlin-console-3.6.1.jar and gremlin-driver.3.6.1.jar are part of janusgraph-1.0.0-rc1.

Marc


Re: security vulnerability: janusgraph-full-1.0.0-rc1: in ./lib ( netty-all.4.1.58.Final) as well as ./lib/gremlin-console-3.6.1.jar & gremlin-driver.3.6.1.jar (netty-all.4.1.77.Final)

hadoopmarc@...
 

Hi Yingjie,

Sorry, I do not understand. The gremlin-console-3.6.1.jar and gremlin-driver.3.6.1.jar are part of janusgraph-1.0.0-rc1.

Marc


security vulnerability: janusgraph-full-1.0.0-rc1: in ./lib ( netty-all.4.1.58.Final) as well as ./lib/gremlin-console-3.6.1.jar & gremlin-driver.3.6.1.jar (netty-all.4.1.77.Final)

Yingjie Li
 

Hello all, 

There is high  security vulnerability  due netty-all jars  in  janusgraph-full-1.0.0-rc1 that we'd like upgrade to vesion > 4.1.82.Final.  For ./lib/netty-all-4.1.58.Final.jar, I have directly replace it with the latest version netty-all-4.1.87.Final.jar and it seems all good for my use. Any pointers of where to get the upgraded versions for the embedded  gremlin-console-3.6.1.jar and gremlin-driver.3.6.1.jar ? 

Thanks,

Yingjie


Re: JanusGraph all in one supporting of Elasticsearch 8

hadoopmarc@...
 
Edited

Support of elasticsearch-8.x is still work in progress, see: https://github.com/JanusGraph/janusgraph/discussions/3467


JanusGraph all in one supporting of Elasticsearch 8

Yingjie Li
 

Hello All,

Is there a prebuild package containing Elastic Search 8?  It seems like the latest JanusGraph 1.0.0 RC1 still contains Elasticsearch 7.17.5, which has 'License-Banned" policy violations from Nexus scan tool. 

Thanks
Yingjie


Re: Error when trying to read ElementMap from Edge in Gremlin.Net: The given key 'janusgraph.RelationIdentifier' was not present in the dictionary #gremlin-dotnet

Florian Hockmann
 

A better exception would really be a good idea. This is however an issue in TinkerPop and not JanusGraph as the Gremlin.Net driver belongs to TinkerPop.

 

I went ahead and created an issue for this in the TinkerPop project: https://issues.apache.org/jira/browse/TINKERPOP-2853

 

Registration for this Jira instance is closed unfortunately due to problems with spam so you would have to ask for an account to be created which is why I thought that it might be to easier if I just go ahead and create the issue myself.

 

But you can of course create a PR to improve this if you want. The repository is: https://github.com/apache/tinkerpop

 

 

Von: janusgraph-users@... <janusgraph-users@...> Im Auftrag von tormodhau@...
Gesendet: Dienstag, 10. Januar 2023 08:18
An: janusgraph-users@...
Betreff: Re: [janusgraph-users] Error when trying to read ElementMap from Edge in Gremlin.Net: The given key 'janusgraph.RelationIdentifier' was not present in the dictionary #gremlin-dotnet

 

Hi, Florian!

Thank you so much! I have found this repository during my research, but I didn't understand why it was needed at the time. It makes total sense now.

Now, the exception thrown might seem a little confusing. Do you think it would be viable to catch the  KeyNotFoundException  inside. TypeSerializerRegistry (or similar), and then give a better explanation? An exception saying e.g "Serializer for type ''janusgraph..xx' was not found. See documentation on custom serializers [...]" would be much more telling on where to look. 

Would you like me to add this as an issue in the Janusgraph repo?


Re: Error when trying to read ElementMap from Edge in Gremlin.Net: The given key 'janusgraph.RelationIdentifier' was not present in the dictionary #gremlin-dotnet

tormodhau@...
 

Hi, Florian!

Thank you so much! I have found this repository during my research, but I didn't understand why it was needed at the time. It makes total sense now.

Now, the exception thrown might seem a little confusing. Do you think it would be viable to catch the  KeyNotFoundException  inside. TypeSerializerRegistry (or similar), and then give a better explanation? An exception saying e.g "Serializer for type ''janusgraph..xx' was not found. See documentation on custom serializers [...]" would be much more telling on where to look. 

Would you like me to add this as an issue in the Janusgraph repo?


Re: Error when trying to read ElementMap from Edge in Gremlin.Net: The given key 'janusgraph.RelationIdentifier' was not present in the dictionary #gremlin-dotnet

Florian Hockmann
 

Hi,

 

`RelationIdentifier` is a type specific to JanusGraph which is why Gremlin.Net cannot know how to deserialize it. We have built a library that extends Gremlin.Net with JanusGraph specific types to solve this: https://github.com/JanusGraph/janusgraph-dotnet/

 

You can simply create a JanusGraphGraphSONMessageSerializer or a GraphBinaryMessageSerializer with the JanusGraphTypeSerializerRegistry.Instance and provide that to the constructor of GremlinClient.

 

Von: janusgraph-users@... <janusgraph-users@...> Im Auftrag von tormodhau@...
Gesendet: Montag, 9. Januar 2023 10:25
An: janusgraph-users@...
Betreff: [janusgraph-users] Error when trying to read ElementMap from Edge in Gremlin.Net: The given key 'janusgraph.RelationIdentifier' was not present in the dictionary #gremlin-dotnet

 

Hi!

When I try to read the ElementMap of an edge in Gremlin.Net:

        var edgeValues = g.E()

            .Has("Mrid", "..guid..")

            .ElementMap<object>()

            .Next();            // <---- Throws here


I get the following error:

       System.Collections.Generic.KeyNotFoundException : The given key 'janusgraph.RelationIdentifier' was not present in the dictionary.

Environment:

       JanusGraph, ElasticSearch, Cassandra (the official docker-compose running locally)
       Gremlin.Net 3.6.1
       Dotnet Core 6.4.0

Full example (unit test with xUnit):
       
    [Fact]

    public void AddingEdgeBetweenTwoVertexes()

    {

        // Start a Janusgraph + Cassandra + ElasticSearch environment with docker compose:

        var gremlinServer = new GremlinServer("localhost", 8182);

        var gremlinClient = new GremlinClient(gremlinServer);

        var remoteConnection = new DriverRemoteConnection(gremlinClient, "g");

        var g = AnonymousTraversalSource.Traversal().WithRemote(remoteConnection);

        g.V().Drop().Iterate();

        g.E().Drop().Iterate();

 

        var firstMrid = Guid.NewGuid();

        g.AddV("V1")

            .Property("Mrid", firstMrid)

            .Iterate();

 

        var secondMrid = Guid.NewGuid();

        g.AddV("V2")

            .Property("Mrid", secondMrid)

            .Iterate();

 

        var edgeMrid = Guid.NewGuid();

        g.AddE("E1")

            .Property("Mrid", edgeMrid)

            .Property("Name", "Hello Edge")

            .From(__.V().Has("Mrid", firstMrid))

            .To(__.V().Has("Mrid", secondMrid))

            .Iterate();

 

        // Verify that two vertices and one edge is added

        Assert.Equal(1, g.E().Count().Next());

        Assert.Equal(2, g.V().Count().Next());

 

        var edgeValues = g.E()

            .Has("Mrid", edgeMrid)

            .ElementMap<object>()

            .Next();            // <---- Throws here

 

        Assert.Equal("Hello Edge", edgeValues["Name"]);

    }


Full error:


     [xUnit.net 00:00:02.06]     tests.Graph.GremlinExplorationTest.AddingEdgeBetweenTwoVertexes_ [FAIL]

  Failed tests.Graph.GremlinExplorationTest.AddingEdgeBetweenTwoVertexes_ [465 ms]

  Error Message:

   System.Collections.Generic.KeyNotFoundException : The given key 'janusgraph.RelationIdentifier' was not present in the dictionary.

  Stack Trace:

     at System.Collections.Generic.Dictionary`2.get_Item(TKey key)

   at Gremlin.Net.Structure.IO.GraphBinary.TypeSerializerRegistry.GetSerializerForCustomType(String typeName)

   at Gremlin.Net.Structure.IO.GraphBinary.GraphBinaryReader.ReadAsync(Stream stream)

   at Gremlin.Net.Structure.IO.GraphBinary.Types.MapSerializer`2.ReadValueAsync(Stream stream, GraphBinaryReader reader)

   at Gremlin.Net.Structure.IO.GraphBinary.Types.SimpleTypeSerializer`1.ReadValueAsync(Stream stream, GraphBinaryReader reader, Boolean nullable)

   at Gremlin.Net.Structure.IO.GraphBinary.Types.SimpleTypeSerializer`1.ReadAsync(Stream stream, GraphBinaryReader reader)

   at Gremlin.Net.Structure.IO.GraphBinary.GraphBinaryReader.ReadAsync(Stream stream)

   at Gremlin.Net.Structure.IO.GraphBinary.Types.TraverserSerializer.ReadValueAsync(Stream stream, GraphBinaryReader reader)

   at Gremlin.Net.Structure.IO.GraphBinary.Types.SimpleTypeSerializer`1.ReadValueAsync(Stream stream, GraphBinaryReader reader, Boolean nullable)

   at Gremlin.Net.Structure.IO.GraphBinary.Types.SimpleTypeSerializer`1.ReadAsync(Stream stream, GraphBinaryReader reader)

   at Gremlin.Net.Structure.IO.GraphBinary.GraphBinaryReader.ReadAsync(Stream stream)

   at Gremlin.Net.Structure.IO.GraphBinary.Types.ListSerializer`1.ReadValueAsync(Stream stream, GraphBinaryReader reader)

   at Gremlin.Net.Structure.IO.GraphBinary.Types.SimpleTypeSerializer`1.ReadValueAsync(Stream stream, GraphBinaryReader reader, Boolean nullable)

   at Gremlin.Net.Structure.IO.GraphBinary.Types.SimpleTypeSerializer`1.ReadAsync(Stream stream, GraphBinaryReader reader)

   at Gremlin.Net.Structure.IO.GraphBinary.GraphBinaryReader.ReadAsync(Stream stream)

   at Gremlin.Net.Structure.IO.GraphBinary.ResponseMessageSerializer.ReadValueAsync(MemoryStream stream, GraphBinaryReader reader)

   at Gremlin.Net.Structure.IO.GraphBinary.GraphBinaryMessageSerializer.DeserializeMessageAsync(Byte[] message)

   at Gremlin.Net.Driver.Connection.HandleReceivedAsync(Byte[] received)

   at Gremlin.Net.Driver.Connection.ReceiveMessagesAsync()

   at Gremlin.Net.Driver.ProxyConnection.SubmitAsync[T](RequestMessage requestMessage)

   at Gremlin.Net.Driver.GremlinClient.SubmitAsync[T](RequestMessage requestMessage)

   at Gremlin.Net.Driver.Remote.DriverRemoteConnection.SubmitBytecodeAsync(Guid requestid, Bytecode bytecode)

   at Gremlin.Net.Driver.Remote.DriverRemoteConnection.SubmitAsync[S,E](Bytecode bytecode)

   at Gremlin.Net.Process.Remote.RemoteStrategy.ApplyAsync[S,E](ITraversal`2 traversal)

   at Gremlin.Net.Process.Utils.WaitUnwrap(Task task)

   at Gremlin.Net.Process.Remote.RemoteStrategy.Apply[S,E](ITraversal`2 traversal)

   at Gremlin.Net.Process.Traversal.DefaultTraversal`2.ApplyStrategies()

   at Gremlin.Net.Process.Traversal.DefaultTraversal`2.GetTraverserEnumerator()

   at Gremlin.Net.Process.Traversal.DefaultTraversal`2.get_TraverserEnumerator()

   at Gremlin.Net.Process.Traversal.DefaultTraversal`2.MoveNextInternal()

   at Gremlin.Net.Process.Traversal.DefaultTraversal`2.MoveNext()

   at Gremlin.Net.Process.Traversal.DefaultTraversal`2.Next()

   at tests.Graph.GremlinExplorationTest.AddingEdgeBetweenTwoVertexes_() in /Users/tormodhaugene/customers/volue/spark-grid/tests/Graph/GremlinExplorationTest.cs:line 130

   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)

   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)



Does anyone know what this error means or how to avoid it? I am at a loss on how to debug it.

- Tormod


Error when trying to read ElementMap from Edge in Gremlin.Net: The given key 'janusgraph.RelationIdentifier' was not present in the dictionary #gremlin-dotnet

tormodhau@...
 

Hi!

When I try to read the ElementMap of an edge in Gremlin.Net:

        var edgeValues = g.E()
            .Has("Mrid", "..guid..")
            .ElementMap<object>()
            .Next();            // <---- Throws here

I get the following error:

       System.Collections.Generic.KeyNotFoundException : The given key 'janusgraph.RelationIdentifier' was not present in the dictionary.

Environment:

       JanusGraph, ElasticSearch, Cassandra (the official docker-compose running locally)
       Gremlin.Net 3.6.1
       Dotnet Core 6.4.0

Full example (unit test with xUnit):
       
    [Fact]
    public void AddingEdgeBetweenTwoVertexes()
    {
        // Start a Janusgraph + Cassandra + ElasticSearch environment with docker compose:
        // https://github.com/JanusGraph/janusgraph-docker/blob/master/docker-compose-cql-es.yml
        var gremlinServer = new GremlinServer("localhost", 8182);
        var gremlinClient = new GremlinClient(gremlinServer);
        var remoteConnection = new DriverRemoteConnection(gremlinClient, "g");
        var g = AnonymousTraversalSource.Traversal().WithRemote(remoteConnection);
        g.V().Drop().Iterate();
        g.E().Drop().Iterate();
 
        var firstMrid = Guid.NewGuid();
        g.AddV("V1")
            .Property("Mrid", firstMrid)
            .Iterate();
 
        var secondMrid = Guid.NewGuid();
        g.AddV("V2")
            .Property("Mrid", secondMrid)
            .Iterate();
 
        var edgeMrid = Guid.NewGuid();
        g.AddE("E1")
            .Property("Mrid", edgeMrid)
            .Property("Name", "Hello Edge")
            .From(__.V().Has("Mrid", firstMrid))
            .To(__.V().Has("Mrid", secondMrid))
            .Iterate();
 
        // Verify that two vertices and one edge is added
        Assert.Equal(1, g.E().Count().Next());
        Assert.Equal(2, g.V().Count().Next());
 
        var edgeValues = g.E()
            .Has("Mrid", edgeMrid)
            .ElementMap<object>()
            .Next();            // <---- Throws here
 
        Assert.Equal("Hello Edge", edgeValues["Name"]);
    }

Full error:


     [xUnit.net 00:00:02.06]     tests.Graph.GremlinExplorationTest.AddingEdgeBetweenTwoVertexes_ [FAIL]
  Failed tests.Graph.GremlinExplorationTest.AddingEdgeBetweenTwoVertexes_ [465 ms]
  Error Message:
   System.Collections.Generic.KeyNotFoundException : The given key 'janusgraph.RelationIdentifier' was not present in the dictionary.
  Stack Trace:
     at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Gremlin.Net.Structure.IO.GraphBinary.TypeSerializerRegistry.GetSerializerForCustomType(String typeName)
   at Gremlin.Net.Structure.IO.GraphBinary.GraphBinaryReader.ReadAsync(Stream stream)
   at Gremlin.Net.Structure.IO.GraphBinary.Types.MapSerializer`2.ReadValueAsync(Stream stream, GraphBinaryReader reader)
   at Gremlin.Net.Structure.IO.GraphBinary.Types.SimpleTypeSerializer`1.ReadValueAsync(Stream stream, GraphBinaryReader reader, Boolean nullable)
   at Gremlin.Net.Structure.IO.GraphBinary.Types.SimpleTypeSerializer`1.ReadAsync(Stream stream, GraphBinaryReader reader)
   at Gremlin.Net.Structure.IO.GraphBinary.GraphBinaryReader.ReadAsync(Stream stream)
   at Gremlin.Net.Structure.IO.GraphBinary.Types.TraverserSerializer.ReadValueAsync(Stream stream, GraphBinaryReader reader)
   at Gremlin.Net.Structure.IO.GraphBinary.Types.SimpleTypeSerializer`1.ReadValueAsync(Stream stream, GraphBinaryReader reader, Boolean nullable)
   at Gremlin.Net.Structure.IO.GraphBinary.Types.SimpleTypeSerializer`1.ReadAsync(Stream stream, GraphBinaryReader reader)
   at Gremlin.Net.Structure.IO.GraphBinary.GraphBinaryReader.ReadAsync(Stream stream)
   at Gremlin.Net.Structure.IO.GraphBinary.Types.ListSerializer`1.ReadValueAsync(Stream stream, GraphBinaryReader reader)
   at Gremlin.Net.Structure.IO.GraphBinary.Types.SimpleTypeSerializer`1.ReadValueAsync(Stream stream, GraphBinaryReader reader, Boolean nullable)
   at Gremlin.Net.Structure.IO.GraphBinary.Types.SimpleTypeSerializer`1.ReadAsync(Stream stream, GraphBinaryReader reader)
   at Gremlin.Net.Structure.IO.GraphBinary.GraphBinaryReader.ReadAsync(Stream stream)
   at Gremlin.Net.Structure.IO.GraphBinary.ResponseMessageSerializer.ReadValueAsync(MemoryStream stream, GraphBinaryReader reader)
   at Gremlin.Net.Structure.IO.GraphBinary.GraphBinaryMessageSerializer.DeserializeMessageAsync(Byte[] message)
   at Gremlin.Net.Driver.Connection.HandleReceivedAsync(Byte[] received)
   at Gremlin.Net.Driver.Connection.ReceiveMessagesAsync()
   at Gremlin.Net.Driver.ProxyConnection.SubmitAsync[T](RequestMessage requestMessage)
   at Gremlin.Net.Driver.GremlinClient.SubmitAsync[T](RequestMessage requestMessage)
   at Gremlin.Net.Driver.Remote.DriverRemoteConnection.SubmitBytecodeAsync(Guid requestid, Bytecode bytecode)
   at Gremlin.Net.Driver.Remote.DriverRemoteConnection.SubmitAsync[S,E](Bytecode bytecode)
   at Gremlin.Net.Process.Remote.RemoteStrategy.ApplyAsync[S,E](ITraversal`2 traversal)
   at Gremlin.Net.Process.Utils.WaitUnwrap(Task task)
   at Gremlin.Net.Process.Remote.RemoteStrategy.Apply[S,E](ITraversal`2 traversal)
   at Gremlin.Net.Process.Traversal.DefaultTraversal`2.ApplyStrategies()
   at Gremlin.Net.Process.Traversal.DefaultTraversal`2.GetTraverserEnumerator()
   at Gremlin.Net.Process.Traversal.DefaultTraversal`2.get_TraverserEnumerator()
   at Gremlin.Net.Process.Traversal.DefaultTraversal`2.MoveNextInternal()
   at Gremlin.Net.Process.Traversal.DefaultTraversal`2.MoveNext()
   at Gremlin.Net.Process.Traversal.DefaultTraversal`2.Next()
   at tests.Graph.GremlinExplorationTest.AddingEdgeBetweenTwoVertexes_() in /Users/tormodhaugene/customers/volue/spark-grid/tests/Graph/GremlinExplorationTest.cs:line 130
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)


Does anyone know what this error means or how to avoid it? I am at a loss on how to debug it.

- Tormod


Re: Automatically configure graph indexes on JanusGraph creation or startup - Gremlin.Net

Florian Hockmann
 

Hi,

 

the management API is Java-only. But yes, you can configure JanusGraph Server to execute a Groovy script at startup and that Groovy script can then use the management API to configure indices. The default config file for JanusGraph Server already executes a Groovy script `scripts/empty-sample.groovy`: https://github.com/JanusGraph/janusgraph/blob/55a8423b7279ca13d8c258c3f6710897079128dd/janusgraph-dist/src/assembly/static/conf/gremlin-server/gremlin-server.yaml#L29

 

If you want to use the management API from your .NET application, then you can also send a Groovy script with the Gremlin.Net driver to the server. Sending scripts is explained in the TinkerPop reference docs: https://tinkerpop.apache.org/docs/current/reference/#gremlin-dotnet-scripts

 

Future versions of JanusGraph will make this more convenient for non-Java applications as we want to add a GRPC based management API.

 

Von: janusgraph-users@... <janusgraph-users@...> Im Auftrag von tormodhau@...
Gesendet: Donnerstag, 22. Dezember 2022 10:44
An: janusgraph-users@...
Betreff: [janusgraph-users] Automatically configure graph indexes on JanusGraph creation or startup - Gremlin.Net

 

Hi!

I am currently using JanusGraph together with Gremlin.Net, and need to set up a Composite Indexes for my database. From what I understand this is typically done through the Management API provided by JanusGraphFactory. Since the my codebase is .Net, using the Embedded JVM version of JanusGraphFactory is not possible. Also, I would not want to create indexes manually through the Gremlin Console  as the application needs to be automatically provisioned and configured in a cloud environment.

What is the best way to configure indexes for JanusGraph? Are there any configuration properties I have overlooked, or would it perhaps be possible to run a Groovy script with the necessary management commands on server startup?

Kind regards,
Tormod

#gremlin.net


Automatically configure graph indexes on JanusGraph creation or startup - Gremlin.Net

tormodhau@...
 

Hi!

I am currently using JanusGraph together with Gremlin.Net, and need to set up a Composite Indexes for my database. From what I understand this is typically done through the Management API provided by JanusGraphFactory. Since the my codebase is .Net, using the Embedded JVM version of JanusGraphFactory is not possible. Also, I would not want to create indexes manually through the Gremlin Console  as the application needs to be automatically provisioned and configured in a cloud environment.

What is the best way to configure indexes for JanusGraph? Are there any configuration properties I have overlooked, or would it perhaps be possible to run a Groovy script with the necessary management commands on server startup?

Kind regards,
Tormod

#gremlin.net


Re: exit the initilization groovy if graph exist

hadoopmarc@...
 
Edited


exit the initilization groovy if graph exist

Yingjie Li
 

Hello, 


I am using Janusgraph. 


In my graph initialization groovy script, I would like to do a simple check, if the graph already exists, exit the script, else continue with the rest of the initialization.


when I run below code,  it complains that 

groovysh_parse: 1: unexpected token: else @ line 1, column 1.

   else {


Also, is there a command equivalent to System.exit(0)? The return command does not work seems like.


In addition, any good reference on gremlin-groovy would be appreciated.


Thanks,

Yingjie




//Create a sessioned connection to the Gremlin Server

:remote connect tinkerpop.server conf/remote.yaml session

:remote console


//define graph name

graph_name = "graph1"


//check whether graph exists


if (ConfiguredGraphFactory.getGraphNames().contains("graph_name")) {

println "graph already exists"

return

}


else {

map = new HashMap();

map.put("storage.backend", "cql");

map.put("storage.hostname", "127.0.0.1")

map.put("index.search.backend", "elasticsearch")

map.put("index.search.hostname", "127.0.0.1")

....

map.put("graph.graphname", graph_name)

ConfiguredGraphFactory.createConfiguration(new MapConfiguration(map))

....


graph = ConfiguredGraphFactory.open(graph_name)


//Create graph schema

//Close all transactions

graph.getOpenTransactions().forEach { tx -> tx.rollback() }


mgmt = graph.openManagement()

mgmt.getOpenInstances().forEach {

if (it.reverse().take(1) != ")") {

mgmt.forceCloseInstance(it)

}

}

....

pk_id = mgmt.makePropertyKey('id').dataType(String.class).cardinality(org.janusgraph.core.Cardinality.LIST).make()

pk_name = mgmt.makePropertyKey('name').dataType(String.class).cardinality(org.janusgraph.core.Cardinality.LIST).make()

....

mgmt.commit()

ConfiguredGraphFactory.close(graph_name)

}




[ANNOUNCE] JanusGraph 1.0.0 RC1

Florian Hockmann
 

The JanusGraph Technical Steering Committee is excited to announce JanusGraph 1.0.0 RC1, the first release candidate of the upcoming 1.0.0 release.

JanusGraph is an Apache TinkerPop enabled property graph database with support for a variety of storage and indexing backends. Thank you to all of the contributors.

 

We encourage everyone to try out this release candidate in your test environments and provide us feedback. You can simply reply to this thread with any feedback you have. Note that this is a release candidate and not a final release. Some changes should be expected between this and the final release of 1.0.0.

Notable new features in this release include:

  • Upgrade to TinkerPop 3.6.1: #3208
  • Support for Cassandra 4: #2325
  • (Official) support for Java 11: #2161
  • Cache performance improvements: #3185 and #871
  • Upgrade to Log4j2: #2890
  • Use mixed indices for numeric aggregations (min(), max(), mean(), sum()): #3202
  • Support TEXTSTRING mapping in Solr: #328
  • New graph API to evaluate Gremlin scripts if JanusGraph is used embedded: #3149
  • ConfiguredGraphFactory can now create different indexes for different graphs in Elasticsearch: #3338
  • Add management API to remove ghost vertices: #2910
  • Add possibility to remove stale composite index entries: #3022
  • Improved support for Geoshapes in GraphBinary: #2856
  • Remove dependency on cassandra-all: #3245
  • Support TTL for CQL backend on Amazon Managed KeySpace: #3325
  • Lots of updates for other dependencies

The release artifacts can be found at this location:
   
https://github.com/JanusGraph/janusgraph/releases/tag/v1.0.0-rc1

A full binary distribution is provided for user convenience:
        
https://github.com/JanusGraph/janusgraph/releases/download/v1.0.0-rc1/janusgraph-full-1.0.0-rc1.zip

 

A truncated binary distribution is provided:
        
https://github.com/JanusGraph/janusgraph/releases/download/v1.0.0-rc1/janusgraph1.0.0-rc1.zip

The online docs can be found here:
   
https://docs.janusgraph.org/master/

 

The resolved issues and commits included in this release candidate can be found here:

    https://github.com/JanusGraph/janusgraph/pulls?q=closed%3A%3C2022-12-08+milestone%3A%22Release+v1.0.0%22

Thank you very much,

Florian Hockmann

 


Re: While committing graph getting exception, caused by: org.janusgraph.diskstorage.locking.consistentkey.ExpiredLockException: Expired lock on KeyColumn

hadoopmarc@...
 

Also discussed here:
https://github.com/JanusGraph/janusgraph/discussions/3359


While committing graph getting exception, caused by: org.janusgraph.diskstorage.locking.consistentkey.ExpiredLockException: Expired lock on KeyColumn

sumandas.workplace@...
 

Janusgraph Version : 0.6.0
Backend: Cassandra
Index: ElasticSearch
I have made many mutations on the graph, mostly soft deleting the vertices(Using it inside Apache Atlas). Then I tried to commit the graph and faced this exception,

org.janusgraph.diskstorage.locking.consistentkey.ExpiredLockException: Expired lock on KeyColumn [k=0x0x011689A034623463616665322D613739612D343666332D386531632D6436643165323562383664B1, c=0x0x00]: lock timestamp 2022-12-02T07:48:53.522Z Micros is older than storage.lock.expiry-time=PT5M
    at org.janusgraph.diskstorage.locking.consistentkey.ConsistentKeyLocker.checkSingleLock(ConsistentKeyLocker.java:472)
    at org.janusgraph.diskstorage.locking.consistentkey.ConsistentKeyLocker.checkSingleLock(ConsistentKeyLocker.java:131)
    at org.janusgraph.diskstorage.locking.AbstractLocker.checkLocks(AbstractLocker.java:348)
    at org.janusgraph.diskstorage.locking.consistentkey.ExpectedValueCheckingTransaction.checkAllLocks(ExpectedValueCheckingTransaction.java:178)
    at org.janusgraph.diskstorage.locking.consistentkey.ExpectedValueCheckingTransaction.prepareForMutations(ExpectedValueCheckingTransaction.java:157)
    at org.janusgraph.diskstorage.locking.consistentkey.ExpectedValueCheckingStoreManager.mutateMany(ExpectedValueCheckingStoreManager.java:77)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction$1.call(CacheTransaction.java:99)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction$1.call(CacheTransaction.java:96)
    at org.janusgraph.diskstorage.util.BackendOperation.executeDirect(BackendOperation.java:66)
    at org.janusgraph.diskstorage.util.BackendOperation.execute(BackendOperation.java:52)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction.persist(CacheTransaction.java:96)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction.flushInternal(CacheTransaction.java:147)
    at org.janusgraph.diskstorage.keycolumnvalue.cache.CacheTransaction.commit(CacheTransaction.java:210)
    at org.janusgraph.diskstorage.BackendTransaction.commitStorage(BackendTransaction.java:136)
    at org.janusgraph.graphdb.database.StandardJanusGraph.commit(StandardJanusGraph.java:790)
    at org.janusgraph.graphdb.transaction.StandardJanusGraphTx.commit(StandardJanusGraphTx.java:1521)
    at org.janusgraph.graphdb.tinkerpop.JanusGraphBlueprintsGraph$GraphTransaction.doCommit(JanusGraphBlueprintsGraph.java:322)
    at org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction.commit(AbstractTransaction.java:104)
    at org.janusgraph.graphdb.tinkerpop.JanusGraphBlueprintsGraph$GraphTransaction.commit(JanusGraphBlueprintsGraph.java:300)
    at org.apache.atlas.repository.graphdb.janus.AtlasJanusGraph.commit(AtlasJanusGraph.java:265)
    at org.apache.atlas.GraphTransactionInterceptor.doCommit(GraphTransactionInterceptor.java:186)
    at org.apache.atlas.GraphTransactionInterceptor.doCommitOrRollback(GraphTransactionInterceptor.java:181)
    at org.apache.atlas.GraphTransactionInterceptor.invoke(GraphTransactionInterceptor.java:120)


Don't know why I'm facing this error. Any way to solve this?


Re: What Unit of Measurement Do the Time-Related JMX Metrics Use?

hadoopmarc@...
 

Thanks for reporting back!


Re: What Unit of Measurement Do the Time-Related JMX Metrics Use?

sammy.jia@...
 

To answer my own question, JanusGraph's time-related metrics are internally recorded in nanoseconds and exported in milliseconds.

It is worthy to note that the majority of Gremlin's time-related metrics are also exported in milliseconds. One exception to this rule is "metrics_org_apache_tinkerpop_gremlin_server_GremlinServer_gremlin_groovy_sessionless_class_cache_average_load_penalty_Value", which is exported in nanoseconds.


Re: Issue Setting up ConfiguredGraphFactory

hadoopmarc@...
 
Edited

Hi Paul,

If you want a session that keeps state of assigned variables on the remote, you have to specify this on connection setup, see the first gremlin line in the example from the ref docs: https://docs.janusgraph.org/operations/configured-graph-factory/#examples

Of course, this keeps resources occupied on the server, that is why this is not the default setting.

Happy graphing,  Marc

1 - 20 of 6678