Postgresql connection via 127.0.0.2

For development, I use a postgresql server to which I connect via ssh tunnel. When the localhost address is set in the settings, everything works as it should. If you set the address to 127.0.0.2, then in Wappler, reading from the database to the Server Action passes normally (testing). If I try to do this through the developer web server, I get an error:
{
"status": "500",
"code": "ECONNREFUSED",
"message": "connect ECONNREFUSED ::1:5432",
"stack": "Error: connect ECONNREFUSED ::1:5432\n at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1495:16)"
}
And as I understand it, the connection for some reason goes through the IPv6 address, although I specified 127.0.0.2. Am I doing something wrong or is it a Wappler error?

There are two places you need to configure DB credentials, I think you only configured the settings for Wappler Database Manager, you need to go to your Globals and change the credentials of the database

Also mention if you're using Docker, because if yes then you're going to run into a 2nd error once you fix that 1st

(no docker)
I returned the ssh tunnel to the address 127.0.0.1. Everything works inside the Wappler. Through the web server, it now gives out that the wrong user. For some reason, the old user is being used, which I replaced with a new one in the Project_options->Targets->Development tab. I also replaced the login in the Database Manager. Where it gets the old data from is not at all clear.

There is another oddity. I used to notice it, but I didn't pay attention to it. Wappler creates a connection named db in the Database Manager itself. I created my connection with a different name and use it everywhere. Why is another connection named db being created? I just deleted it and everything worked fine. Maybe this is also part of the problem with data confusion.

I have changed all logins to database connections (Project options, Database Manager), but Wappler uses the old login in its developer web server. Restarting the Wappler does not help.

A search of the old login files showed the following.
There is a file in the Wappler project directory: app\modules\connections\conndb.json
.wappler\targets\Development\app\modules\connections\conndb.json
The old username and password are still in this file.

In the file .wappler\targets\Development\databases\conndb.json has new login and password data.
At the same time, both the Database Manager and the Project Options in Wappler show a new username and password. Maybe there is a third place where I have to change the data?

After manually correcting the files, everything worked as it should. I think it needs to be fixed somehow so that you don't have to edit files with your hands. :wink: