dotnet `Enumeration has not started. Call MoveNext` if I try to enumerate over a result

I recently try to use gremlin to created a graph and query this graph. Currently I get it working to push data into the graph. 🎉 But now my problem is to get data back from the graph. What is working is something like that:
/// g is <see cref="GraphTraversalSource"/>
var result = g.V().ToList().Select(v => $"Id: {v.Id}; Label: {v.Label};").ToList();
/// g is <see cref="GraphTraversalSource"/>
var result = g.V().ToList().Select(v => $"Id: {v.Id}; Label: {v.Label};").ToList();
This gives me a nice result over my imported data. Here is a short sample of it:
[
"Id: 0; Label: summaries;",
"Id: 128; Label: temps;",
"Id: 2; Label: summaries;",
"Id: 122; Label: temps;",
"Id: 124; Label: temps;",
"Id: 126; Label: temps;"
]
[
"Id: 0; Label: summaries;",
"Id: 128; Label: temps;",
"Id: 2; Label: summaries;",
"Id: 122; Label: temps;",
"Id: 124; Label: temps;",
"Id: 126; Label: temps;"
]
The problem is now if I try to filter the data I get errors, So for example I want to see all the things that have the label summaries I need todo something like that:
var summary = await g.V().Has("label", "summaries").Values<string>("label").Promise(t => t.Next());
var summary = await g.V().Has("label", "summaries").Values<string>("label").Promise(t => t.Next());
The problem is now that I get with this query the following error:
System.InvalidOperationException: Enumeration has not started. Call MoveNext.
at System.SZGenericArrayEnumerator`1.get_Current()
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 Program.<>c.<<Main>$>b__0_11#1(ITraversal`2 t)
at Gremlin.Net.Process.Traversal.DefaultTraversal`2.Promise[TReturn](Func`2 callback)
at Program.<>c__DisplayClass0_0.<<<Main>$>b__5>d.MoveNext()
System.InvalidOperationException: Enumeration has not started. Call MoveNext.
at System.SZGenericArrayEnumerator`1.get_Current()
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 Program.<>c.<<Main>$>b__0_11#1(ITraversal`2 t)
at Gremlin.Net.Process.Traversal.DefaultTraversal`2.Promise[TReturn](Func`2 callback)
at Program.<>c__DisplayClass0_0.<<<Main>$>b__5>d.MoveNext()
The stacktrace is a bit shortend so it fits in a post here.
This error is thrown inside the Promise by calling Next. But this error is for just not helpful. I'm also an beginner so I don't know what todo.
No description
Solution:
You're on .NET 8, right? This is unfortunately a known issue which will be fixed in the next release: https://issues.apache.org/jira/browse/TINKERPOP-3029 I'm afraid you'll probably have to use .NET 7 until the next release...
Jump to solution
4 Replies
Solution
Florian Hockmann
Florian Hockmann•10mo ago
You're on .NET 8, right? This is unfortunately a known issue which will be fixed in the next release: https://issues.apache.org/jira/browse/TINKERPOP-3029 I'm afraid you'll probably have to use .NET 7 until the next release
Paule96
Paule96OP•10mo ago
yes I'm. Thanks. for the tip. @Florian Hockmann Good that I know now where issues are tracked 😄 I'm searching for the issue tracker for days now ^^ @Florian Hockmann in the Jira Issue it only mentions that it will be fixed for version 3.7.x and 3.6.x. Are there plans to bring this fix to 3.4.x too? The problem is that cloud providers like Azure Cosmos only support the Gremlin.Net package until 3.4.x
Florian Hockmann
Florian Hockmann•10mo ago
Sorry, but the 3.4 line of releases has been out of support since early 2022, so 2 years already. You'll have to ask the CosmosDB team to support newer versions of TinkerPop Did you try Gremlin.Net 3.7.1 however with Cosmos DB? It's of course not officially supported, but it could still work I guess, at least if you configure Gremlin.Net to use GraphSON instead of GraphBinary
The problem is that cloud providers like
Are there any other cloud providers that only support such old versions? I at least only know of Azure
Paule96
Paule96OP•10mo ago
Yes I tried it with the newer version and as far as I tried it out right now it works. But also I'm just completely new to the graph business. So maybe I can write down some experience in 2 to 3 months. I tried your hot fix. So far it works for me with dotnet 8. So I will use for my playground the master branch of thinkerpop.
Want results from more Discord servers?
Add your server