Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malformed id in g.V().hasId() #18

Open
vitalych opened this issue Apr 17, 2020 · 10 comments
Open

Malformed id in g.V().hasId() #18

vitalych opened this issue Apr 17, 2020 · 10 comments

Comments

@vitalych
Copy link

Using the given example and the default janusgraph docker image, I get the following error:

$ docker run -it -p 8182:8182 janusgraph/janusgraph

$ ./vertex-edge-example -h ws://127.0.0.1:8182
2020-04-17T20:01:06.525+0200    FATAL   vertex-edge-example/main.go:89  Error while querying for outer edges    {"error": "{\"type\":\"NETWORK_ERROR\"},{\"status code\":\"597\"},{\"error\":\"SCRIPT EVALUATION ERROR\"},{\"original error\":\"startup failed:\nScript7.groovy: 1: unexpected token: : @ line 1, column 22.\n   g.V().hasId(map[@type:g:Int64 @value:4144]).outE()\n                        ^\n\n1 error\n\"}"}
@caffix
Copy link

caffix commented Apr 21, 2020

This library is incredible, but unfortunately, I am experiencing the same problem as @vitalych

@slooker
Copy link

slooker commented May 6, 2020

I also have the same problem. It looks like ID() doesn't actually return what it's supposed to. Here's a simple example:

package main

import (
	"github.com/northwesternmutual/grammes"

	"fmt"
	"log"
)

func main() {
	client, err := grammes.DialWithWebSocket("ws://127.0.0.1:8182")

	// Adding two testing vertices.
	vertex1, err := client.AddVertex("person1", "name", "damien")
	if err != nil {
		log.Fatal("Failed to add vertex: ", err)
	}

	fmt.Println("ID: ", vertex1.ID())
}

This prints out ID: map[@type:g:Int64 @value:40161]

@damienfamed75
Copy link
Contributor

@vitalych @caffix @slooker please try using v1.1.2 and come back with your results.

@caffix
Copy link

caffix commented May 6, 2020

I went back to that version after our last conversation and was successful. Thank you!

Are you still planning for a release that can handle all the various Gremlin servers/services?

@damienfamed75
Copy link
Contributor

@caffix yes I've been playing around for a design of Grammes v2 that should solve this issue

@caffix
Copy link

caffix commented May 6, 2020

Great! I appreciate the excellent library and your assistance

@slooker
Copy link

slooker commented May 26, 2020

Any idea when Grammes v2 may be coming out? I can't use 1.1.2 because it doesn't support Neptune, and I'm having to do a lot of workarounds for 1.2.0 since ID() doesn't seem to work correctly.

@rogaha
Copy link

rogaha commented Jul 30, 2020

same here

@jhole89
Copy link

jhole89 commented Sep 23, 2020

@damienfamed75 I'm also having the same issue and was reviewing #16 however wondered if yourself or @aciduck could clear a question up for me. Why did #16 change the VertexID from a struct that would map out the ID value correctly, to an interface?

The only docs I can find around ID differences is from https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-differences.html#w3aac12c20c10c15c25

Neptune Gremlin Vertex and Edge IDs must be of type String.

It doesn't say so but based on the changes in #16 does this mean that Neptune returns the id part as {"@type":"g:Vertex","@value":{"id": "some-string"}} instead of "{"@type":"g:Vertex","@value":{"id":{"@type":"g:String","@value": "some-string"}}} ?

I assume if this is not the case and Neptune returns the second Gremlin complaint response then its just a simple case of reverting #16 and changing the Value types from Int64 to interface rather than removing the entire struct?

@rwsegura
Copy link

rwsegura commented Jan 8, 2021

I have a pull request that will make v1.2.0 work with local gremlin and aws neptune:

#40

Edit: to add some insight @jhole89 I attempted to do as such in my own fork to test and that was now the case Neptune returns
{"@type":"g:Vertex","@value":{"id": "some-string"}} it seems.

My change in my pull request checks if the id is a map or string and base on that will return correctly

remiphilippe pushed a commit to 00security/grammes that referenced this issue Aug 30, 2022
* improve session close synchronization

* CR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants