I am using a connection to a remote postgres database. In the Data Store section I have entered all the credential for the remote database and tested the connection which says successful. However when the the application is executed and it tries to accessed the database I get the following error:- Why i it looking for a postgres database ? My database is called ssnizjpl
Task :pgtest-core:createDb FAILED
[CubaDbCreation] Failed to execute SQL: drop database if exists “ssnizjpl”;
Error: FATAL: no pg_hba.conf entry for host “2.126.128.107”, user “ssnizjpl”, database “postgres”, SSL on
Error: FATAL: no pg_hba.conf entry for host “2.126.128.107”, user “ssnizjpl”, database “postgres”, SSL on
Execution failed for task ‘:pgtest-core:createDb’.
This is not a CUBA error, but PostgreSQL database configuration issue. You need to add your development workstation to the list of hosts that are allowed to connect to the database by adding the proper entry into the pg_hba.conf file.
Also, please be careful when working with existing databases from Studio.
Studio will try to drop and re-create the database if it doesn’t contain CUBA-related tables. So if you point your main datastore to an existing database and you don’t want it to be dropped, run the CUBA -> Update Database command from the main menu. Then the needed tables will be created in the database without dropping it.