gdotv
gdotv
Explore posts from servers
ATApache TinkerPop
Created by gdotv on 10/17/2024 in #questions
Is there a way to specify a query execution timeout via the GremlinLangScriptEngine?
I'm adding a way to specify a query timeout when running queries via G.V(). On the G.V() playground which uses TinkerGraph internally, we "submit" queries directly to the in-memory graph via the GremlinLangScriptEngine. Is there an equivalent of adding a timeout as seen in the Client object via the RequestOptions?
5 replies
JJanusGraph
Created by gdotv on 8/9/2024 in #questions
Granular configuration options for such as JANUSGRAPH_RELATION_DELIMITER on driver
Hi folks, I'm curious about the possibility to make configuration options such as JANUSGRAPH_RELATION_DELIMITER more granular at the driver level. I know it can currently be set as an environment variable, but I'm wondering if there's thoughts of making this configurable on a per DriverRemoteConnection/Cluster basis client-side. The reason I'm asking is to cater for potential use cases where users on G.V() might need to connect to multiple janusgraph databases with disparate setups. Is that something reasonable/achievable as a potential new feature?
5 replies
ATApache TinkerPop
Created by gdotv on 6/18/2024 in #questions
Is NoHostAvailableException losing/not including relevant error context (3.7.0 above)?
Hey folks, I've recently noticed that G.V() is "not as good" as it used to be in reporting some specific connectivity issue, and upon further investigation managed to attribute this to a change in behaviour with NoHostAvailableException seemingly losing some relevant context. In my case, I'm testing the scenario of trying to connect to Azure Cosmos DB from an IP that is not allowed through their firewall, which usually results in a bespoke error message for Azure going as follows:
Invalid handshake response getStatus: 403 Request originated from IP 213.31.211.185 through public internet. This is blocked by your Cosmos DB account firewall settings. More info: https://aka.ms/cosmosdb-tsg-forbidden
Invalid handshake response getStatus: 403 Request originated from IP 213.31.211.185 through public internet. This is blocked by your Cosmos DB account firewall settings. More info: https://aka.ms/cosmosdb-tsg-forbidden
Attempting to submit a query to a Cosmos DB endpoint protected by a firewall results in the expected NoHostAvailableException, but the error's detailedMessage only states:
"All hosts are considered unavailable due to previous exceptions. Check the error log to find the actual reason."
"All hosts are considered unavailable due to previous exceptions. Check the error log to find the actual reason."
The rootCause for the thrown exception is itself a NoHostAvailableException and does not contain any reference to the actual error message returned when attempting the connection, which is instead output separately by the driver before the NHA exception is thrown - "I'm assuming this is what the check the error log to find the actual reason message refers to" Is there a way to get this downstream failure from the NHA exception? I've seen cases where it seemingly works (e.g. SecurityException from invalid credentials, serialization issue, etc) and others where the root cause seems to just get lost. For reference I've attached what's output by the driver prior to throwing the exception (lengthy stack trace alert).
5 replies
JJanusGraph
Created by gdotv on 5/22/2024 in #questions
Creating a customer serializer Io Registry in Java
Hey folks, I've got a somewhat unusual use case I'd like to bring to G.V(). Some users have customer serializers configured on their servers and I'd like to find a way to allow them to configure G.V() using those custom serializers. My initial thought was to create a "custom" IoRegistry that loads those classes via reflection based on user input information (e.g. jar path and class name). Would that be the correct way to load custom serializers into a client Java codebase? I've been looking at some custom serializer examples but they focus mostly on the server side of things, not so much the client, gremlin-driver part of it
12 replies
ATApache TinkerPop
Created by gdotv on 2/23/2024 in #questions
Configuring Websockets connection to pass through a proxy server
Hey, I'm working on making G.V() fully proxy aware, but I can't seem to get websockets connection to pass through a SOCKS/HTTP proxy configuration. I've got all the proxy configuration java system properties set and working for HTTP connections. Is there any specific configuration to add to let the Gremlin driver to use a configured proxy?
13 replies
JJanusGraph
Created by gdotv on 1/13/2024 in #questions
Deserializing of Vertex ID with Custom String value
Hi, I've come across an issue with deserialization from users enabling custom vertex ID values and types as documented on https://docs.janusgraph.org/advanced-topics/custom-vertex-id/. Below is a sample GraphSON serialization error highlighting the issue, where a vertex has a custom string ID value (U933779):
java.lang.IllegalArgumentException: Invalid id - each token expected to be a number
at [Source: (byte[])"{"requestId":"171a7723-7b62-4131-8035-e735ff368ffd","status":{"message":"","code":200,"attributes":{"@type":"g:Map","@value":["host","localhost"]}},"result":{"data":{"@type":"g:List","@value":[{"@type":"g:Vertex","@value":{"id":"U933779","label":"user","properties":{"phone":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"janusgraph:RelationIdentifier","@value":{"relationId":"9g3yj-SU933779-8p1"}},"value":"[REDACTED]","label":"phone","properties":{"metadata":"{}"}}}],"profile"[truncated 645 bytes]; line: 1, column: 415]
java.lang.IllegalArgumentException: Invalid id - each token expected to be a number
at [Source: (byte[])"{"requestId":"171a7723-7b62-4131-8035-e735ff368ffd","status":{"message":"","code":200,"attributes":{"@type":"g:Map","@value":["host","localhost"]}},"result":{"data":{"@type":"g:List","@value":[{"@type":"g:Vertex","@value":{"id":"U933779","label":"user","properties":{"phone":[{"@type":"g:VertexProperty","@value":{"id":{"@type":"janusgraph:RelationIdentifier","@value":{"relationId":"9g3yj-SU933779-8p1"}},"value":"[REDACTED]","label":"phone","properties":{"metadata":"{}"}}}],"profile"[truncated 645 bytes]; line: 1, column: 415]
The part that confuses me is the RelationIdentifier class as defined in JG 1.0 (https://github.com/JanusGraph/janusgraph/blob/12708188397f69616adddc933e539e841af409e4/janusgraph-driver/src/main/java/org/janusgraph/graphdb/relations/RelationIdentifier.java#L31) still defines the id value as a long. My question is, for custom vertex id values, what is the correct approach to deserializing ID values? We've tried this with multiple different types of serializers to no avail.
10 replies
ATApache TinkerPop
Created by gdotv on 11/15/2023 in #questions
Gremlin driver setup for Amazon Neptune behind a Load balancer
Hi folks, I've been running into issues connecting to Amazon Neptune behind an HAProxy as detailed on https://aws-samples.github.io/aws-dbs-refarch-graph/src/connecting-using-a-load-balancer/ (2nd option) The issue is to do with sending subsequent queries via a graph traversal source where it appears to cause NoHostAvailableExceptions frequently. The interesting part here is that this only happens when a Graph traversal source is reused. I'm using Gremlin driver 3.7.0 in Java. Are there any specific configurations that should be used when creating the Cluster/Client/Graph traversal source when connecting to a load balancer?
8 replies
ATApache TinkerPop
Created by gdotv on 10/24/2023 in #questions
Clarification on Kerberos configuration for Gremlin Driver
I'm a little bit unclear on the role of the JAAS configuration file for the Gremlin client in the context of the gremlin-driver (rather than just the GremlinConsole). Looking at https://tinkerpop.apache.org/docs/current/reference/#krb5authenticator Is the naming convention around the jaasEntry name at all of relevance or can any gremlin-driver assume the existence of a GremlinConsole jaas entry? I'm assuming the mapping here between jaasEntry name and gremlin-driver configuration is done by setting the jaasEntry value on the ClusterBuilder but just looking for confirmation on that!
13 replies
ATApache TinkerPop
Created by gdotv on 8/4/2023 in #questions
Can gremlin-server be started via its Java package
I'm considering exposing the G.V() Playground graphs, which runs on TinkerGraph, to the network via Gremlin Server. Can the GremlinServer Java class be instantiated to expose a TinkerGraph instance (or have the TinkerGraph data exposed on the GremlinServer by loading a graph instance that shares its "gremlin.tinkergraph.graphLocation" value?)
8 replies
JJanusGraph
Created by gdotv on 6/30/2023 in #questions
Can graph scans restrictions be bypassed?
When a JanusGraph database has janusgraph.query.force-index: "true"​, is there a way to submit queries that would be considered as graph scans (e.g. g.V().limit(25)) despite the setting being enabled? I know that DataStax Enterprise for instance has a with('allow-filtering') that lets users bypass that restriction.
5 replies
ATApache TinkerPop
Created by gdotv on 6/12/2023 in #questions
Is it possible to extract the requestId of an Amazon Neptune Gremlin query via gremlin-driver?
Is there any way via gremlin-driver to extract the requestId of a completed query submitted to Amazon Neptune? Specifically when it's submitted either using a Client or via Bytecode. Or is using the REST endpoint the only way to achieve this?
5 replies
ATApache TinkerPop
Created by gdotv on 3/19/2023 in #questions
Is there a limitation on Neptune HTTP API endpoint compatibility when using a proxy and IAM Auth?
Hi, Got a weird one today. I'm working on bringing full compatibility for the use of proxies fronting Amazon Neptune services. In my setup I have an Amazon Neptune cluster and an nginx proxy. The proxy runs on an EC2 container and provides connectivity to Neptune over a public domain. Additionally, my Neptune DB has IAM authentication enabled. The issue I'm encountering is the following: When attempting to make API calls to the Neptune instance through the proxy, (e.g. status/explain/profile APIs), the calls are getting consistently rejected with a 403 Forbidden despite using the correct credentials. (when accessing the Neptune DB via SSH tunnel and using the same credentials, the requests are authorised). For WebSocket auth, this proxy setup appears to work (using the NeptuneNettyHttpSigV4Signer utility). For HTTP auth, it fails (using the NeptuneApacheHttpSigV4Signer). To allow this setup to work correctly using WSS, the handshake interceptor takes an extra step to replace the Host header in the request with the original Neptune DB endpoint (not doing this causes the Neptune API to respond with a 400 error). I've implemented the same mechanism for making HTTP API calls to Neptune using the Apache HTTP Client and unlike the Netty implementation this causes the API call to fail with a 403. I'm struggling to get the signature generated on my end to match the format expected server side on Neptune, using these utility classes. Is there any recommended way to sign REST API calls to Neptune endpoints made behind a proxy?
6 replies
ATApache TinkerPop
Created by gdotv on 2/21/2023 in #questions
Agnostic client-side serialization of custom types
Hi, I've noticed a potential trend in G.V() of serialization issues for types that appear to be custom and therefore not deserializable from G.V()'s perspective. Where things get tricky is from G.V()'s perspective we need to somehow be able to connect to any database regardless of this type of customer specific situation. Is there a way to configure a fallback deserializing mechanism client-side (e.g. GraphBinary config or otherwise) that automatically deserializes a result as string (or some other default) in the absence of an appropriate serializer being available?
21 replies
ATApache TinkerPop
Created by gdotv on 2/2/2023 in #questions
GremlinGroovyScriptEngine to submit bytecode from string vs Client to submit query as string
Hey, Bit of a weird question here but I'm trying to decommission the (potentially never actually useful) use of the GremlinGroovyScriptEngine. "Historically" the GremlinGroovyScriptEngine was used to convert queries written in the query editor as String to bytecode for submission via a GraphTraversalSource generated in the backend. My question essentially is: can I completely rely on the Client instead to submit queries as string? The main limitation of the GremlinGroovyScriptEngine (groovy dependency aside) is that when submitting queries for non Gremlin technologies (e.g. JanusGraph) it leads to script execution errors when submitting JanusGraph specific predicates, for instance. I have a feeling the answer is "submit everything via client and it will work the same" but I'm just curious to know whether there's any fundamental difference in the way results are returned when submitting via client rather than bytecode
8 replies
ATApache TinkerPop
Created by gdotv on 1/26/2023 in #questions
How to connect to a specific graph on Gremlin Server?
Provided a Gremlin server configured with multiple graphs in the graph property of the gremlin server configuration as below:
host: localhost
port: 8182
evaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
graph: conf/tinkergraph-empty.properties, otherGraph: conf/tinkergraph-empty.properties}
...etc
host: localhost
port: 8182
evaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
graph: conf/tinkergraph-empty.properties, otherGraph: conf/tinkergraph-empty.properties}
...etc
How to specify which graph to connect to in Java (either using RemoteDriverConnection or Client)? I'd assumed DriverRemoteConnection.using(cluster, traversalSourceName) was the place to do this, but that clearly not it! I'm noticing the Client class allows specifying an alias but that doesn't seem to work either. What's the proper way of configuring multiple graphs on a server and then connecting to them in Java?
33 replies