1

I have a module that manages Azure Cosmosdb Gremlin queries. When I call it from jupyter notebooks like this, it works fine. However, when calling it from the Django app I get a ConnectionError:

Cannot connect to host graph-exodestiny.gremlin.cosmos.azure.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')]

Both the local jupyter notebook and the django app are importing the same module. That module's code is pretty simple gremlinpython stuff:

    ## Managing the client
    def open_client(self):
            self.c = client.Client(
                self.endpoint,
                "g",
                username=self.username,
                password=self.password,
                message_serializer=serializer.GraphSONSerializersV2d0(),
            )
            
    def close_client(self):
        self.c.close()

    ## Managing the queries
    def run_query(self, query="g.V().count()"):
        self.open_client()
        callback = self.c.submitAsync(query)
        res = callback.result().all().result()
        self.close_client()
        self.res = res
  • Both are importing the same cmdb_graph.py connector module here.
  • Both are running on the same local environment.

I also have the same application running here on an Azure Web App and it's working fine. From this environment.

The closest related issue is this one, however I'm unable to draw a connection. They seem to be totally different connector types.

2
  • 1
    Did you check this question? Commented May 21, 2023 at 7:10
  • That's, interesting. But how to apply it to the gremlinpython library? That post is about an ado pipeline. Commented May 21, 2023 at 9:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.