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

Gremlin driver throwing GraphMalformedException after updating gremlin driver to 3.4.0 #26201

Closed
boltmillee opened this issue Dec 28, 2021 · 8 comments
Assignees
Labels
azure-spring All azure-spring related issues Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@boltmillee
Copy link

This is in reference to microsoft/spring-data-gremlin#196 . I followed the steps and updated the gremlin driver but I am getting a different issue because of that. Exception message attached

Caused by: org.apache.tinkerpop.gremlin.driver.exception.ResponseException:

ActivityId : ac404cc5-b895-4253-bab8-a0e4710e9eec
ExceptionType : GraphMalformedException
ExceptionMessage :
Gremlin Malformed Request: GraphSON v3 IO is not supported.
GremlinRequestId : eadcb143-ad25-44ae-adee-522d19eef257
Context : global
GraphInterOpStatusCode : MalformedRequest
HResult : 0x80131500

  • OS: MacOS

  • IDE: IntelliJ

  • Library/Libraries: PFB

     <dependency>
     	<groupId>org.apache.tinkerpop</groupId>
     	<artifactId>gremlin-driver</artifactId>
     	<version>3.4.9</version>
     </dependency>
     <dependency>
     	<groupId>com.microsoft.azure</groupId>
     	<artifactId>spring-data-gremlin-boot-starter</artifactId>
     	<version>2.3.0</version>
     	<exclusions>
     		<exclusion>
     			<groupId>org.apache.tinkerpop</groupId>
     			<artifactId>gremlin-driver</artifactId>
     		</exclusion>
     	</exclusions>
     </dependency>
     <dependency>
     	<groupId>com.microsoft.spring.data.gremlin</groupId>
     	<artifactId>spring-data-gremlin</artifactId>
     	<version>2.3.0</version>
     	<exclusions>
     		<exclusion>
     			<groupId>com.fasterxml.jackson.core</groupId>
     			<artifactId>jackson-databind</artifactId>
     		</exclusion>
     	</exclusions>
     </dependency>
    

Query - g.V().hasLabel("Trade").has("name","FM - PLUMBING").outE().inV().hasLabel("CheckList").has("division",within('WM')).as("checklist").and(inE().outV().hasLabel("Category").has("name","INTERNAL TECH"),inE().outV().hasLabel("Location").has("id","2005850749")).select("checklist")

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 28, 2021
@omerkisoss
Copy link

GraphSON v3 is not supported in Azure Gremlin Api, we had that issue as well and we changed gremlin client serializer to GRAPHSON_V2D0
for example:

private Cluster createGremlinCluster() throws GremlinIllegalConfigurationException {
    final Cluster cluster;

    try {
        cluster = Cluster.build(this.gremlinConfig.getEndpoint())
                .serializer(Serializers.GRAPHSON_V2D0.toString())
                .create();
    } catch (IllegalArgumentException e) {
        throw new GremlinIllegalConfigurationException("Invalid configuration of Gremlin", e);
    }

    return cluster;
}

hope this helps.

@joshfree joshfree added azure-spring All azure-spring related issues azure-spring-gremlin Client This issue points to a problem in the data-plane of the library. labels Jan 3, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jan 3, 2022
@joshfree
Copy link
Member

joshfree commented Jan 3, 2022

@backwind1233 could you please help route this issue from @boltmillee?

@yiliuTo yiliuTo added this to the [2022] February milestone Jan 4, 2022
@boltmillee
Copy link
Author

@omerkisoss Thanks for the help. This seems to be working fine with custom queries. However, I have a few GremlinRepositories where the default findById() and findAll() methods are giving this issue. Is there any solution for that also?

@msingal003
Copy link

GraphSON v3 is not supported in Azure Gremlin Api, we had that issue as well and we changed gremlin client serializer to GRAPHSON_V2D0 for example:

private Cluster createGremlinCluster() throws GremlinIllegalConfigurationException {
    final Cluster cluster;

    try {
        cluster = Cluster.build(this.gremlinConfig.getEndpoint())
                .serializer(Serializers.GRAPHSON_V2D0.toString())
                .create();
    } catch (IllegalArgumentException e) {
        throw new GremlinIllegalConfigurationException("Invalid configuration of Gremlin", e);
    }

    return cluster;
}

hope this helps.

@omerkisoss I tried with above code with gremlin driver version 3.4.0 but I am getting the same timeout exception I was getting with version 3.2.4: java.lang.RuntimeException: java.util.concurrent.TimeoutException: Timed out while waiting for an available host - check the client configuration and connectivity to the server if this message persists

@omerkisoss
Copy link

omerkisoss commented Jan 20, 2022

@msingal003
That is probably because you didnt configure all gremlin repositories properly, here is a sample of Gremlin Repositories configuration:


@Configuration
@EnableGremlinRepositories(basePackages = "com.example")
@EnableConfigurationProperties(GremlinProperties.class)
@PropertySource("classpath:application.yml")
@Slf4j
public class GremlinRepoConfig extends AbstractGremlinConfiguration {

    private final GremlinProperties gremlinProps;

    @Autowired
    public GremlinRepoConfig(GremlinProperties gremlinProps) {
        this.gremlinProps = gremlinProps;
    }

    @Override
    public GremlinConfig getGremlinConfig() {
        log.info("Gremlin Configurations loaded: {}", gremlinProps.toString());
        return GremlinConfig.builder(gremlinProps.getEndpoint(), gremlinProps.getUsername(), gremlinProps.getPassword())
                .serializer(gremlinProps.getSerializer())
                .maxConnectionPoolSize(gremlinProps.getMaxConnectionPoolSize())
                .maxInProcessPerConnection(gremlinProps.getMaxInProcessPerConnection())
                .maxSimultaneousUsagePerConnection(gremlinProps.getMaxSimultaneousUsagePerConnection())
                //.maxWaitForConnection(gremlinProps.getMaxWaitForConnection())
                //.keepAliveInterval(gremlinProps.getKeepAliveInterval())
                .build();

    }

hope this helps, let me know if you still having issues.

@backwind1233 backwind1233 added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Mar 22, 2022
@backwind1233
Copy link
Contributor

@boltmillee @msingal003 @omerkisoss
Thank you for your comments on the issue, we have deprecated Spring Data Gremlin support for Cosmos DB,
if it is important to you, please vote on this issue #24773.

@manishmsfte
Copy link

Please use .NET Gremlin SDK v 3.4.13, refer the compatible version list here https://learn.microsoft.com/en-us/azure/cosmos-db/gremlin/support#compatible-client-libraries

@manishmsfte
Copy link

#please-close

@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
azure-spring All azure-spring related issues Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
Archived in project
Development

No branches or pull requests

7 participants