A question to establish connection between postgresql and TVB client

59 views
Skip to first unread message

Yat-Lok Wong

unread,
Jan 8, 2024, 6:30:45 PMJan 8
to TVB Users
Hello everyone! 

Currently I am trying to set up my TVB client/server in a linux virtual machine (Rocky 8). I followed the tutorial from here to set up my `.tvb.configuration` file to create a headless TVB (https://docs.thevirtualbrain.org/manuals/UserGuide/UserGuide-Config.html#installing-posgresql-on-windows). 

I installed the postgresql 12 in my machine, and create a database called `tvb`, and a user called `rocky` in my virtual machine. I also filled in the information based on this format: postgresql+psycopg2://postgres:root@[postresql-server-host]:[postgres-port]/tvb?user=[user]&password=[postgres-pwd]

However, I still have error when i tried to launch my TVB web GUI. I attached my error log into this post. I think the main issue is `ERROR - tvb.core.services.settings_service - (psycopg2.OperationalError) FATAL:  Ident authentication failed for user "rocky"

I searched this error and tried to modify `pg_hba.conf` to change the authentication method from `ident` to `md5`. However, it doesn't help me to solve the problem. 

Could you please help me to take a look at it? Thanks!

Also, my `.tvb.configuration` file is also attached below:

```

MAXIMUM_NR_OF_OPS_IN_RANGE=2000

ADMINISTRATOR_EMAIL=jira...@gmail.com

MAXIMUM_NR_OF_THREADS=4

WEB_SERVER_PORT=8080

LAST_CHECKED_CODE_VERSION=6507

USR_DISK_SPACE=5242880

DEPLOY_CLUSTER=False

ADMINISTRATOR_NAME=admin

LAST_CHECKED_FILE_VERSION=2

URL_VALUE=postgresql+psycopg2://postgres:root@localhost:5432/tvb?user=rocky&password=rosa

ADMINISTRATOR_PASSWORD=[[md5 of password]]

SELECTED_DB=postgres

MAXIMUM_NR_OF_VERTICES_ON_SURFACE=300000

TVB_STORAGE=/home/rocky/TVB

```

error.txt

Lia Domide

unread,
Jan 9, 2024, 3:40:24 AMJan 9
to TVB Users
Hi,

I think the issue is still in the pg_hba.conf file.
Could you show us that ?
Does it contain something like bellow:
host all all 127.0.0.1/32 trust

Best,
Lia 

Yat-Lok Wong

unread,
Jan 9, 2024, 1:10:45 PMJan 9
to tvb-...@googlegroups.com


Hi Lia! Thanks for your reply!


I copied the content of the pg_hba.conf file here. 


I tried to change the METHOD to trust and run it again, but it still gave me an authentication error..


I am wondering whether the user identity could be the problem. Like, now, my username is "rocky", but when I modified my "pg_hba.conf" file, I am using the identity "postgres". When I ran the "tvb_start.sh" in "TVB_Distribution/bin", I also used the identity "rocky" instead of "postgres". Could it be a problem?


Thank you so much for your help! Looking forward to hearing from you~


Best Regards, 


Yile



```

# TYPE  DATABASE        USER            ADDRESS                 METHOD


# "local" is for Unix domain socket connections only

local   all             all                                     md5

# IPv4 local connections:

host    all             all             127.0.0.1/32            trust

# IPv6 local connections:

host    all             all             ::1/128                 md5

# Allow replication connections from localhost, by a user with the

# replication privilege.

local   replication     all                                     md5

host    replication     all             127.0.0.1/32            trust

host    replication     all             ::1/128                 md5

```


--
You received this message because you are subscribed to the Google Groups "TVB Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tvb-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tvb-users/41439036-aac1-4a5e-b30d-8d030f4f628fn%40googlegroups.com.

Lia Domide

unread,
Jan 11, 2024, 6:14:57 AMJan 11
to TVB Users
Did you restart the Postgres service after changing the pg_hba file ?

Best,
Lia.

Yat-Lok Wong

unread,
Jan 30, 2024, 1:50:43 PMJan 30
to TVB Users
Hi Lia, 

Thank you for the help! Now the previous issue has been solved but I have a new issue here. When I open the web GUI, and try to login with `admin` and `pass`, I always received error `Wrong username/password, or user not yet validated...`.

Even though I tried to use forgot password option and use the username and recover password sent to my mailbox to login again, I still got the error. I am wondering do you know where I could fix this issue? Is it still a problem from connections between TVB server and my database? Thank you!

Best Regards, 

Yile  



Screenshot 2024-01-30 at 12.44.23 PM.png

Yat-Lok Wong

unread,
Feb 4, 2024, 10:20:24 PMFeb 4
to TVB Users
Hi Lia! I did investigation myself again but unfortunately I still don't find the reason why I cannot use default credential `admin/pass` to login my TVB server. I thought that could be a connection issue between my backend database server (postgresql) and TVB webGUI. However, even though I switched my db to `sqlite`, re-launch a brand new virtual machine and re-install TVB again, I still have same issue that I cannot login TVB using `admin/pass` credentials. It always showed `Wrong username/password, or user not yet validated...`. I am wondering do you know where could be the cause of this problem? Or, any logs info can be useful to me for this problem? I took a look at the log file from `/home/tvb_user/TVB/'logs`, but the `cherrypy.log` and `web_application.log` don't seem to have errors... 

Thank you so much! Any suggestions are appreciated!

Best Regards, 

Yile

Reply all
Reply to author
Forward
0 new messages