So, we have this old API which uses Rails 5.0.3, Ruby Version is 2.3; That is hosted on AWS ECS, and the DB used is a Postgres V12 on an Aurora/RDS. The issue is that since Postgres V12 is not being supported anymore ( we can still use it there but noww it will be way more expensive since it is deprecated), we need to migrate that API to Postgres 17 but when we tried to point the API to this new DB host with that upgraded Postgres Version, when doing the deploy task on ECS we could see the error "PostgreSQL authentication method 10 not supported". Other API's of ours would connect to the old Postgres 12 and to this new 17 one without an issue.
From this answer and other that I found, it seems clear that the issue is on the "Postgres Client Software" which is outdated and has to support the scram-sha-256 authentication method. What is this Postgres Client Software in a Rails App? I though it would be the pg gem which we were using the 0.21 version, but even after trying to update to v1.2.3 (which is being used to the other API's who had no issue connecting to the Postgres 17 RDS server) it didn't work, and we saw the same authentication error being displayed.
What actually should I update on that rails app so I can get rid of that error when connecting to that PG 17 server?
So, we have this old API which uses Rails 5.0.3, Ruby Version is 2.3; That is hosted on AWS ECS, and the DB used is a Postgres V12 on an Aurora/RDS. The issue is that since Postgres V12 is not being supported anymore ( we can still use it there but noww it will be way more expensive since it is deprecated), we need to migrate that API to Postgres 17 but when we tried to point the API to this new DB host with that upgraded Postgres Version, when doing the deploy task on ECS we could see the error "PostgreSQL authentication method 10 not supported". Other API's of ours would connect to the old Postgres 12 and to this new 17 one without an issue.
From this answer and other that I found, it seems clear that the issue is on the "Postgres Client Software" which is outdated and has to support the scram-sha-256 authentication method. What is this Postgres Client Software in a Rails App? I though it would be the pg gem which we were using the 0.21 version, but even after trying to update to v1.2.3 (which is being used to the other API's who had no issue connecting to the Postgres 17 RDS server) it didn't work, and we saw the same authentication error being displayed.
What actually should I update on that rails app so I can get rid of that error when connecting to that PG 17 server?
Share Improve this question asked Mar 16 at 15:22 Roger PeixotoRoger Peixoto 3782 gold badges5 silver badges18 bronze badges 7 | Show 2 more comments1 Answer
Reset to default 2As discussed in other answers, scram-sha-256 was introduced in PostgreSQL 10 so you need at least libpq v10. v17 would be best so you can take advantage of all of PostgreSQL v17's features.
And if you're going to upgrade Ruby, upgrade to the latest bugfix within that minor version. Instead of 2.7.1 upgrade to 2.7.8.
scram-sha-256
per Password auth. 2) What version oflibpq
are you using on the client that the API is being run from? 3) What is the deploy task doing? – Adrian Klaver Commented Mar 16 at 16:06libpq
version is going to depend on the OS and packaging. For instance here on Ubuntu 22.04:apt-cache search libpq
findslibpq5 - PostgreSQL C client library
andapt info libpq5
findsVersion: 17.4-1.pgdg22.04+2
. – Adrian Klaver Commented Mar 16 at 16:54scram-sha-256
was introduced in Postgres 10, any of the9.x
versions would be out of date. Note, for Postgres versions less then 10 thex
inX.x.y
is a major version andy
is the minor release. In 10+ the format isX.y
. – Adrian Klaver Commented Mar 16 at 19:53