Can't Create Token - getToken() fails under 3.6.0

I’m unable to create a token using Python package to connect to my cloud instance of AWS or Azure that I just created today (6/25/2022).

I installed a new (blank) instance of TigerGraph Cloud server 3.6.0. I’m using the latest version of pyTigerGraph 0.9.1 with pyTigerDriver 1.0.14.

I have setup my connection (see below) to use port 443 per the instructions:

  • Use API endpoint 443/restpp/<endpoint> for RESTPP endpoints that were on port 9000
  • Use API endpoint 443/<endpoint> for endpoints that were on port 14240

I’m able to create a Secret = j7*5 just fine. However, when I pass the secret to getToken() I receive the following error: “Error: TigerGraphException(‘Route /requesttoken not found.’, None)”

        self._conn = tg.TigerGraphConnection(host = self.host,
                                        gsPort = "443",
                                        restppPort = "443",
                                        graphname = self.graphName,
                                        username = self.userName, 
                                        password = self._passWord, 
                                        version = self.version)

All of my python code worked just fine before the port changes. Any insights on how to resolve this would be greatly appreciated.

Finally, I tried to create a token using the command line curl and received the following same error message: {“error”:true,“message”:“Route /requesttoken?secret=5n6qhn7cf5cfur4b3141k85jdd6kq283\u0026lifetime=None not found.”,“results”:{}}

Edit: instead of using gcp, use tgCloud, as described in the posts below.

Hi!

Instead of manually setting the ports, you should be able to set the TigerGraphConnection parameter gcp = True.

self._conn = tg.TigerGraphConnection(host = self.host,
                                        graphname = self.graphName,
                                        username = self.userName, 
                                        password = self._passWord, 
                                        gcp = True)

Then you should be able to generate a token without errors.

self._conn.apiToken = self._conn.getToken(self._conn.createSecret())

Let me know if this helps or if you run into any other errors!

1 Like

gcp is a deprecated parameter. You can now use the tgCloud parameter however, as described here: TigerGraphConnection :: pyTigerGraph. Hope this helps!

4 Likes

Hi Parker,

Yes, using the tgCloud has resolved my problem. I did notice that gcp was marked as deprecated, but your entry beat me to the punch on pointing that out.

Also, thank for pointing out the new pyTigerGraph documentation site. I have booked marked it :wink:

BTW, nice job on refactoring the pyTigerGraph library :smile:

Kind Regards,

Mitch DeFelice

3 Likes

FYI:

When I tried using the tgCloud flag with my solution, I was running on AWS. I just moved to Azure, and the problem popped backed up, where I could not create a token. Now, I just tried running on Google and it seems to work fine using the tgCloud flag.

I’m I having a bad day? Or can someone else confirm that it’s not working on Azure :face_with_spiral_eyes:

Kind Regards,

Mitch DeFelice