Build.gradle - Postgres Driver

Hi guys,

in my new environment when running my application I’ve got the error:

org.postgresql.util.PSQLException: The authentication type 10 is not supported. Check that you have configured the pg_hba.conf file to include the client's IP address or subnet, and that it is using an authentication scheme supported by the driver.

I was able to fix this by adding postgresql-42.5.4.jar to my \deploy\tomcat\lib directory.

But I still get above error when running gradle.build → :app-core:updateDb fails. Since it is the identical error, I guess it is also related to the driver.

How can a specify the driver to use for the gradle script ?

I’ve tried:
image

My Studio was downloading some dependencies on next execution, but still the same error appears.

Any advice would be helpful, thanks.

Best regards
Daniel

Hello,

you mentioned a new environment.
Can you please tell us more about it, for the old and new:

  • CUBA platform version
  • database type and version
  • java version
  • development and deployment operating system

But, it’s already likely that you have a different version of the PostgreSQL database, from what I can see.
Try this:

  • edit postgresql.conf - find the line with password_encryption, comment it with #, then add new line with
    password_encryption = md5
    also
    listen_addresses = '*'
  • edit pg_hba.conf , if method is e.g scram_sha_256, change that to md5 too
  • while editing pg_hba.conf, check that the server can be reached from the outside,
    add
    host all all 0.0.0.0/0 md5
    and make sure to understand the consequences of these settings, especially listen_address and host entries.

Now you need to change any password in use, so its refreshed with md5, you can use
psql -U postgres
ALTER ROLE postgres WITH PASSWORD ‘someting’;
ALTER ROLE cuba WITH PASSWORD ‘sometingelse’;

Hope this helps,
Mladen

Hi Mladen,

thanks for all the advice. Yes, in my old environment, I was running an older version of PostgreSQL.

For some reason, the issue now fixed itself. I suspect, after a restart the change in PostgreSQL Driver Version (in gradle script as mentioned above) came to effect. gradle updateDB is now working as usual.

Just some more details about my environment, in case others experience the same issue: CUBA Platform 6.10.18, PostgreSQL 15, Java Open JDK 11, CUBA Studio 2020.2 (Intellij Edition), Windows 11

Best regards
Daniel