I trying to create connection but having an issue

anybody can help me with tigergraph connection?
getting an error message “ERROR:pyTigerGraph.pyTigerGraphGSQL:Connection failed; check your username and password [Errno 99] Cannot assign requested address ERROR:pyTigerGraph.pyTigerGraphGSQL:Connection failed; check your username and password [Errno 99] Cannot assign requested address ERROR:pyTigerGraph.pyTigerGraphGSQL:Couldn’t initialize the client. See previous error. An exception has occurred, use %tb to see the full traceback.”
username/password creds are correct

docker image is running properly

hostName = “http://localhost” userName = “tigergraph” password = “tigergraph” graphName = “dummy_graph”

it shows connection is successful but later on it fails to create session or graphs
tried with “HTTP://localhost” and “http:127.0.0.1” and “https://127.0.0.1” but nothing works

Hello @lovepreet the following links might help you,make sure you have installed the correct library and have the access to the particular graph.

Hi @swasthik

For me it shows connection is successful but it fails while fetching the token as you can see in the image, not sure what went wrong there.

Regards,
Lovepreet

@lovepreet Certainly, here’s the revised explanation:

If you’re encountering a “connection failed” error and you’re sure that your username and password are correct, there are a few steps you can take to troubleshoot the issue.

  1. Create Users and Assign Roles: First, ensure that you have created the necessary users who can access the graph and assigned the appropriate roles to them. This involves setting up user credentials that match what you’re using to connect.

  2. Secret: Make sure that the secret you’re using for authentication is correct. If you suspect any issues with the secret, you might want to delete it and generate a new one. A mismatched or incorrect secret can lead to connection problems.

Here’s how you can set up users and roles:

  1. Click on your cluster and access the “Access Management” section.
  2. Look for the “Add Database User” option. This is where you can create new users.
  3. In the “Role Management” section, grant the appropriate roles to these users. Roles determine what actions these users can perform in the graph.

Remember to use the exact same username and password when connecting to the graph. These credentials need to match the ones you’ve set up for the users. Once you’ve ensured the proper setup of users, roles, and secret, you should be able to connect to the graph without encountering the “connection failed” error.

Hi Swastik,

I have tried all things you mentioned above but still facing an issue.
this is configurations I’m trying
Domain = “http://localhost

Graph = “dummy_graph”

secret = “p9xxxxxxxxxxxxxkjm76vs56”

userName = “tigergraph”

password = “xxxxxxxxxxxxxxx”

conn = tg.TigerGraphConnection(host=Domain, username=userName, password=password, graphname=Graph)

TILL ABOVE LINE CODE WORKS FINE but the below code gives an error
authToken = conn.getToken(secret)
authToken = authToken[0]

Is there any way to resolve this

@lovepreet Are you using TigerGraph Cloud? One thing you might need to do is create a Database User account and then elevate the privilege. Manage Database Users :: TigerGraph Cloud

I’ve also created a simple pyTigerGraph Connection Colab notebook for you to run. If you still have some issues I can create a short video walkthrough.

1 Like

Hi @Jon_Herke Yes, I’m using tigergraph cloud, As you mentioned above I created one database user and give him access of admin, pass these credentials as parameters to the google colab

It gave me an error of “incorrect graph name” and to make sure there is no graph issue I created one testing graph and gave my user to access this graph

FYI: this issue doesn’t occur when I try with docker image but there it shows the connection issue.

IN summary:
1).When I try to access through tiger studio cloud it gave me incorrect graphname issue
2)When try to access through docker image it gave me connection issue while fetching the token as mentioned above in trailing discussion.

If you can help with the resolution it would be really helpful,
Thanks

@lovepreet Can you try to copy the “Domain” string and put that in your hostname? Let me know if that fixes it.

Click on the cluster:

Copy the domain name string:

Thanks, Finally It worked and connection is successful.

2 Likes

Wow! Great to hear it, feel free to explore other things .

1 Like