Re: How to debug authentication issues in Postgres

2020-12-01 Thread Hemil Ruparel
My password had ascii spaces in it which the jdbc implementation stripped as a part of normalization of scram passwords causing authentication failures. I have submitted a PR. Hope it gets merged. The fix was literally one character because of which I spent days chasing the bug lol On Sun, Nov 29,

Re: How to debug authentication issues in Postgres

2020-11-29 Thread Daniele Varrazzo
IIRC you need libpq at least 10 to use password encryption other than md5. Maybe your java client uses an older version, or no libpq at all and the client library misses that feature? -- Daniele On Sat, 28 Nov 2020, 16:12 Hemil Ruparel, wrote: > I am unable to connect using Java in general. An

Re: How to debug authentication issues in Postgres

2020-11-28 Thread Hemil Ruparel
Thanks. I will On Sat, Nov 28, 2020 at 9:49 PM Adrian Klaver wrote: > On 11/28/20 8:11 AM, Hemil Ruparel wrote: > > I am unable to connect using Java in general. And DataGrip runs on Java > > as far as I know. My backend in python runs perfectly fine using the > > psycopg2 library (postgres driv

Re: How to debug authentication issues in Postgres

2020-11-28 Thread Adrian Klaver
On 11/28/20 8:11 AM, Hemil Ruparel wrote: I am unable to connect using Java in general. And DataGrip runs on Java as far as I know. My backend in python runs perfectly fine using the psycopg2 library (postgres driver for python). At this point I would file an issue here: https://github.com/pg

Re: How to debug authentication issues in Postgres

2020-11-28 Thread Hemil Ruparel
I am unable to connect using Java in general. And DataGrip runs on Java as far as I know. My backend in python runs perfectly fine using the psycopg2 library (postgres driver for python). I was actually changing the database name and user name On Sat, Nov 28, 2020 at 9:28 PM Adrian Klaver wrote:

Re: How to debug authentication issues in Postgres

2020-11-28 Thread Adrian Klaver
On 11/28/20 6:10 AM, Hemil Ruparel wrote: Line 88 is this line: host    database    user 0.0.0.0/0               scram-sha-256. I might have forgotten to change one of the names in the earlier mails. Change from what? This should just be a copy and paste or am I missing s

Re: How to debug authentication issues in Postgres

2020-11-28 Thread Adrian Klaver
On 11/28/20 6:08 AM, Hemil Ruparel wrote: I commented out scram-sha-256 lines for IPv4 and IPv6. I still got authentication failure. The log output now says: FATAL:  password authentication failed for user "centos" DETAIL:  Connection matched pg_hba.conf line 89: "host       database user 0.

Re: How to debug authentication issues in Postgres

2020-11-28 Thread Hemil Ruparel
This seems extremely odd. I can connect to my database using python's psycopg2 library. Most likely this is either an extremely stupid mistake on my side, or worst case some edge condition jdbc doesnt handle? On Sat, Nov 28, 2020 at 7:40 PM Hemil Ruparel wrote: > Line 88 is this line: hostda

Re: How to debug authentication issues in Postgres

2020-11-28 Thread Hemil Ruparel
Line 88 is this line: hostdatabaseuser 0.0.0.0/0 scram-sha-256. I might have forgotten to change one of the names in the earlier mails. On Sat, Nov 28, 2020 at 7:38 PM Hemil Ruparel wrote: > I commented out scram-sha-256 lines for IPv4 and IPv6. I still got > authentication

Re: How to debug authentication issues in Postgres

2020-11-28 Thread Hemil Ruparel
I commented out scram-sha-256 lines for IPv4 and IPv6. I still got authentication failure. The log output now says: FATAL: password authentication failed for user "centos" DETAIL: Connection matched pg_hba.conf line 89: "host database user 0.0.0.0/0 md5" On Sat, Nov

Re: How to debug authentication issues in Postgres

2020-11-28 Thread Hemil Ruparel
Yes. Password encryption is set to scram-sha-256. On Fri, Nov 27, 2020 at 10:36 PM Adrian Klaver wrote: > On 11/27/20 12:37 AM, Hemil Ruparel wrote: > > The log says: > > > FATAL: password authentication failed for user "centos" > > > DETAIL: Connection matched pg_hba.conf line 88: "host

Re: How to debug authentication issues in Postgres

2020-11-27 Thread Adrian Klaver
On 11/27/20 12:37 AM, Hemil Ruparel wrote: The log says: > FATAL:  password authentication failed for user "centos" > DETAIL:  Connection matched pg_hba.conf line 88: "host    user password 0.0.0.0/0               scram-sha-256" To me that looks like a strange line f

Re: How to debug authentication issues in Postgres

2020-11-27 Thread Adrian Klaver
On 11/27/20 7:15 AM, Hemil Ruparel wrote: The database has been upgraded Just to be clear the postgresql.conf file has: password_encryption = scram-sha-256 set correct? On Fri, Nov 27, 2020 at 8:41 PM Adrian Klaver > wrote: On 11/27/20 7:01 AM, Hemil

Re: How to debug authentication issues in Postgres

2020-11-27 Thread Hemil Ruparel
I will try that. I do not have access to the computer right now On Fri 27 Nov, 2020, 9:25 PM Tom Lane, wrote: > Hemil Ruparel writes: > > Thanks for the clarification. According to this page, > > https://jdbc.postgresql.org/documentation/changelog.html#version_42.2.0, > > scram support was adde

Re: How to debug authentication issues in Postgres

2020-11-27 Thread Tom Lane
Hemil Ruparel writes: > Thanks for the clarification. According to this page, > https://jdbc.postgresql.org/documentation/changelog.html#version_42.2.0, > scram support was added in JDBC driver 42.2.0. I am on 42.2.18. And using > the java code mentioned above, I still get the same error. If you

Re: How to debug authentication issues in Postgres

2020-11-27 Thread Hemil Ruparel
Thanks for the clarification. According to this page, https://jdbc.postgresql.org/documentation/changelog.html#version_42.2.0, scram support was added in JDBC driver 42.2.0. I am on 42.2.18. And using the java code mentioned above, I still get the same error. On Fri, Nov 27, 2020 at 9:06 PM Tom La

Re: How to debug authentication issues in Postgres

2020-11-27 Thread Tom Lane
Hemil Ruparel writes: > When I try to connect to the database, the log says: >> FATAL: password authentication failed for user "user" >> DETAIL: Connection matched pg_hba.conf line 88: "hostuser > password 0.0.0.0/0 scram-sha-256" > So I think the client is using scra

Re: How to debug authentication issues in Postgres

2020-11-27 Thread Hemil Ruparel
When I try to connect to the database, the log says: > FATAL: password authentication failed for user "user" > DETAIL: Connection matched pg_hba.conf line 88: "hostuser password 0.0.0.0/0 scram-sha-256" So I think the client is using scram-sha-256 On Fri, Nov 27, 2020

Re: How to debug authentication issues in Postgres

2020-11-27 Thread Hemil Ruparel
The database has been upgraded On Fri, Nov 27, 2020 at 8:41 PM Adrian Klaver wrote: > On 11/27/20 7:01 AM, Hemil Ruparel wrote: > > I don't quite get what you mean by upgrading to scram-sha256. I > > installed postgres 13. I haven't upgraded anything yet. > > In postgresql.conf see what password

Re: How to debug authentication issues in Postgres

2020-11-27 Thread Adrian Klaver
On 11/27/20 7:01 AM, Hemil Ruparel wrote: I don't quite get what you mean by upgrading to scram-sha256. I installed postgres 13. I haven't upgraded anything yet. In postgresql.conf see what password_encryption has been set to. If it is 'scram-sha-256` then it has been upgraded. On Fri, N

Re: How to debug authentication issues in Postgres

2020-11-27 Thread Hemil Ruparel
ers set new passwords, and change the authentication method > specifications in pg_hba.conf to scram-sha-256. > > > > > > > > -Markus > > > > > > > > *Von:* Hemil Ruparel > *Gesendet:* Freitag, 27. November 2020 09:38 > *An:* Laurenz Albe > *Cc:*

AW: How to debug authentication issues in Postgres

2020-11-27 Thread Zwettler Markus (OIZ)
all users set new passwords, and change the authentication method specifications in pg_hba.conf to scram-sha-256. -Markus Von: Hemil Ruparel Gesendet: Freitag, 27. November 2020 09:38 An: Laurenz Albe Cc: pgsql-generallists.postgresql.org Betreff: Re: How to debug authentication issues i

Re: How to debug authentication issues in Postgres

2020-11-27 Thread Hemil Ruparel
The log says: > FATAL: password authentication failed for user "centos" > DETAIL: Connection matched pg_hba.conf line 88: "hostuser password 0.0.0.0/0 scram-sha-256" I can't understand where is the problem as both psql and pgadmin connect without problems using the sam

Re: How to debug authentication issues in Postgres

2020-11-27 Thread Hemil Ruparel
Sorry. This was the replication section: local replication all peer hostreplication all 127.0.0.1/32 scram-sha-256 hostreplication all ::1/128 scram-sha-256 On Fri, Nov 27, 2020 at 1:41 PM Laurenz Albe wrote: > On

Re: How to debug authentication issues in Postgres

2020-11-27 Thread Laurenz Albe
On Fri, 2020-11-27 at 13:34 +0530, Hemil Ruparel wrote: > I have restarted postgres quite a few times to try making configuration > changes and it > is always back up. I don't know how. Feels weird to me. I didn't add the line > "local replication all". It was there by default I don't believe t

Re: How to debug authentication issues in Postgres

2020-11-27 Thread Hemil Ruparel
I have restarted postgres quite a few times to try making configuration changes and it is always back up. I don't know how. Feels weird to me. I didn't add the line "local replication all". It was there by default On Fri, Nov 27, 2020 at 1:24 PM Laurenz Albe wrote: > On Fri, 2020-11-27 at 12:44

Re: How to debug authentication issues in Postgres

2020-11-26 Thread Laurenz Albe
On Fri, 2020-11-27 at 12:44 +0530, Hemil Ruparel wrote: > I have a remote database which I can connect to using psql command line tool > as well as PgAdmin4. But I would really like to use DataGrip. But whenever I > try to connect, it gives me fatal: password > authentication failed and prompts m

How to debug authentication issues in Postgres

2020-11-26 Thread Hemil Ruparel
I have a remote database which I can connect to using psql command line tool as well as PgAdmin4. But I would really like to use DataGrip. But whenever I try to connect, it gives me fatal: password authentication failed and prompts me for another password. I raised an issue in DataGrip and I was to