public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adrian Klaver <[email protected]>
To: Alexander Farber <[email protected]>
To: pgsql-general <[email protected]>
Subject: Re: How to debug: password authentication failed for user
Date: Thu, 27 Feb 2025 09:20:01 -0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAADeyWjQNmfiQxaiRF0tkZ-kZyApPJT00xbmcMtj+oToSPGoWQ@mail.gmail.com>
References: <CAADeyWjQNmfiQxaiRF0tkZ-kZyApPJT00xbmcMtj+oToSPGoWQ@mail.gmail.com>

On 2/27/25 08:46, Alexander Farber wrote:
> Good evening,
> 

> My problem is that the local "trust" connection all work fine, but 
> remote connection from another pod in the AKS fails with:
> 
> PGPASSWORD=timeshift_pass psql --host=timeshiftservice --port=5432 
> --dbname=timeshift_database --username=timeshift_user --password
> Password: (here I enter the "timeshift_pass" and press enter)

Why set PGPASSWORD=timeshift_pass and use --password?

The password should be picked up from the env variable.

> psql: error: connection to server at "timeshiftservice" (10.0.120.194), 
> port 5432 failed: FATAL:  password authentication failed for user 
> "timeshift_user"
> 

> timeshift_database=# SELECT rolname, rolpassword FROM pg_authid WHERE 
> rolname = 'timeshift_user';
>      rolname     |                                                      
>          rolpassword
> 
> ----------------+---------------------------------------------------------------------------------------------------------------------------------------
>   timeshift_user | 
> SCRAM-SHA-256$4096:kQisEuaKSpuJK4kmpqoq2w==$nNNngQozh11kpDeW43ETrVUe1eNvKuKWvU/nb1etxEI=:537RuSYGRHEVJL4PyUxfAYIXNdA8cOp+QGnvNjKWWvQ=
> (1 row)

What happens if, when logged in via local, you do:

ALTER ROLE timeshift_user PASSWORD 'timeshift_pass';

and then try logging in via the remote connection?

Seeing if maybe the script is passing in or mangling the password.


> 
> Does anybody have an idea, what else could be wrong?
> 
> What could I check to make the remote connection as timeshift_user work?
> 
> Thank you
> Alex

-- 
Adrian Klaver
[email protected]







view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: How to debug: password authentication failed for user
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox