Closed howardlowndes closed 4 months ago
I am able to log into the database as a user
You should be able to log into the PostgreSQL cluster using the psql
command line client and set the password of the user:
alter role lsmb_dbadmin password 'YOURPASSWORD';
Unfortunately that didn't work for me.
Using psql AMS the log shows: 2024-02-13 20:14:31.789 AEDT [18729] @. ERROR: permission denied 2024-02-13 20:14:31.789 AEDT [18729] @. STATEMENT: alter role lsmb_dbadmin password '****';
When I try to log in using setup.pl http://setup.pl the log presents: 2024-02-13 20:12:56.734 AEDT [18593] @. FATAL: password authentication failed for user "lsmb_dbadmin" 2024-02-13 20:12:56.734 AEDT [18593] @. DETAIL: User "lsmb_dbadmin" has an expired password. Connection matched pg_hba.conf line 102: "host all all ::1/128 scram-sha-256" 2024-02-13 20:12:56.767 AEDT [18594] @. FATAL: password authentication failed for user "lsmb_dbadmin" 2024-02-13 20:12:56.767 AEDT [18594] @. DETAIL: User "lsmb_dbadmin" has an expired password. Connection matched pg_hba.conf line 102: "host all all ::1/128 scram-sha-256" 2024-02-13 20:12:56.830 AEDT [18597] @. FATAL: password authentication failed for user "lsmb_dbadmin" 2024-02-13 20:12:56.830 AEDT [18597] @. DETAIL: User "lsmb_dbadmin" has an expired password. Connection matched pg_hba.conf line 98: "host postgres,template0,template1 lsmb_dbadmin ::1/128 scram-sha-256 " 2024-02-13 20:12:56.863 AEDT [18598] @. FATAL: password authentication failed for user "lsmb_dbadmin" 2024-02-13 20:12:56.863 AEDT [18598] @. DETAIL: User "lsmb_dbadmin" has an expired password. Connection matched pg_hba.conf line 98: "host postgres,template0,template1 lsmb_dbadmin ::1/128 scram-sha-256 "
On Tue, 13 Feb 2024 at 18:09, Erik Huelsmann @.***> wrote:
You should be able to log into the PostgreSQL cluster using the psql command line client and set the password of the user:
alter role lsmb_dbadmin password 'YOURPASSWORD';
— Reply to this email directly, view it on GitHub https://github.com/ledgersmb/LedgerSMB/issues/8017#issuecomment-1940538173, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMS2F7W6FQBABEISCWPHJBTYTMGRFAVCNFSM6AAAAABDF65NLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBQGUZTQMJXGM . You are receiving this because you authored the thread.Message ID: @.***>
-- Howard. -- When you want a computer system that works, just choose Linux; When you want a computer system that works, just, choose Microsoft.
What is the exact psql
command you use to connect to the database?
psql AMS
then
alter role lsmb_dbadmin password '****';
On Wed, 14 Feb 2024 at 05:07, Erik Huelsmann @.***> wrote:
What is the exact psql command you use to connect to the database?
— Reply to this email directly, view it on GitHub https://github.com/ledgersmb/LedgerSMB/issues/8017#issuecomment-1942120814, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMS2F7UKFU33D4RFNEYHTSDYTOTURAVCNFSM6AAAAABDF65NLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBSGEZDAOBRGQ . You are receiving this because you authored the thread.Message ID: @.***>
-- Howard. -- When you want a computer system that works, just choose Linux; When you want a computer system that works, just, choose Microsoft.
Hi,
I don't understand how you can receive a "permission denied" error. As what user did you run that command? As the 'postgres' unix user? That should have connected you to the database as "postgres" superuser which can't receive a "permission denied" on the command you showed.
Regards,
Erik.
I'm logged into the computer as myself - a user with sudo access and I can issue psql AMS and can get access but is I try psql -U postgres -d AMS I get $ psql -d AMS -U postgres psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "postgres"
On Fri, 16 Feb 2024 at 08:48, Erik Huelsmann @.***> wrote:
Hi,
I don't understand how you can receive a "permission denied" error. As what user did you run that command? As the 'postgres' unix user? That should have connected you to the database as "postgres" superuser which can't receive a "permission denied" on the command you showed.
Regards,
Erik.
— Reply to this email directly, view it on GitHub https://github.com/ledgersmb/LedgerSMB/issues/8017#issuecomment-1947393651, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMS2F7U3RPNIDHDVX6PYV7DYTZ7DBAVCNFSM6AAAAABDF65NLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBXGM4TGNRVGE . You are receiving this because you authored the thread.Message ID: @.***>
-- Howard. -- When you want a computer system that works, just choose Linux; When you want a computer system that works, just, choose Microsoft.
Try running
sudo -u postgres psql
And after that the alter role
command
My apologies for taking some time to get back to you but I have had to deal with some other issues. Anyway, logged into my /home/howard account, I issued the 'sudo -u postgres psql' command and it came back with:
$ sudo -u postgres psqlcould not change directory to "/home/howard": Permission deniedpsql (15.6 (Debian 15.6-0+deb12u1))Type "help" for help.postgres=#
which is a bit strange. Anyway I then issued the SQL 'select * from pg_user;' and it returned with:
Will the following SQL work 'update pg_user set valuntil = NULL where usename = "lsmb_dbadmin;' work?
Regards,
On Fri, 16 Feb 2024 at 18:09, Erik Huelsmann @.***> wrote:
Try running
sudo -u postgres plql
And after that the alter role command
— Reply to this email directly, view it on GitHub https://github.com/ledgersmb/LedgerSMB/issues/8017#issuecomment-1947862278, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMS2F7VDIYPQNEV6HPJVIN3YT4AZBAVCNFSM6AAAAABDF65NLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBXHA3DEMRXHA . You are receiving this because you authored the thread.Message ID: @.***>
-- Howard. -- When you want a computer system that works, just choose Linux; When you want a computer system that works, just, choose Microsoft.
I've answered my own question - it won't work because pg_user is a view and not a table.
On Tue, 27 Feb 2024 at 09:28, Howard Lowndes @.***> wrote:
My apologies for taking some time to get back to you but I have had to deal with some other issues. Anyway, logged into my /home/howard account, I issued the 'sudo -u postgres psql' command and it came back with:
$ sudo -u postgres psqlcould not change directory to "/home/howard": Permission deniedpsql (15.6 (Debian 15.6-0+deb12u1))Type "help" for help.postgres=#
which is a bit strange. Anyway I then issued the SQL 'select * from pg_user;' and it returned with:
- usename | usesysid | usecreatedb | usesuper | userepl | usebypassrls | passwd | valuntil | useconfig --------------+----------+-------------+----------+---------+--------------+----------+-------------------------------+----------- postgres | 10 | t | t | t | t | **** | | lsmb_dbadmin | 16388 | t | f | f | f | **** | 2024-02-09 12:11:24.007924+11 | howard | 21308 | f | f | f | f | **** | infinity | (3 rows)*
Will the following SQL work 'update pg_user set valuntil = NULL where usename = "lsmb_dbadmin;' work?
Regards,
On Fri, 16 Feb 2024 at 18:09, Erik Huelsmann @.***> wrote:
Try running
sudo -u postgres plql
And after that the alter role command
— Reply to this email directly, view it on GitHub https://github.com/ledgersmb/LedgerSMB/issues/8017#issuecomment-1947862278, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMS2F7VDIYPQNEV6HPJVIN3YT4AZBAVCNFSM6AAAAABDF65NLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBXHA3DEMRXHA . You are receiving this because you authored the thread.Message ID: @.***>
-- Howard.
When you want a computer system that works, just choose Linux; When you want a computer system that works, just, choose Microsoft.
-- Howard. -- When you want a computer system that works, just choose Linux; When you want a computer system that works, just, choose Microsoft.
When you're looking at
postgres#
type after that the alter role
command (you can't edit pg_user):
alter role lsmb_dbadmin password 'YOURPASSWORD';
I did that and it appeared to accept the SQL, but when I try to log into / setup.pl I still get
Could not connect to database: connection to server at "localhost" (::1), port 5432 failed: FATAL: password authentication failed for user "lsmb_dbadmin"connection to server at "localhost" (::1), port 5432 failed: FATAL: password authentication failed for user "lsmb_dbadmin" at lib/LedgerSMB/Scripts/setup.pm http://setup.pm line 344.
dbversion: 1.11.9, company:
On Tue, 27 Feb 2024 at 09:35, Erik Huelsmann @.***> wrote:
When you're looking at
postgres#
type after that the alter role command (you can't edit pg_user):
alter role lsmb_dbadmin password 'YOURPASSWORD';
— Reply to this email directly, view it on GitHub https://github.com/ledgersmb/LedgerSMB/issues/8017#issuecomment-1965448531, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMS2F7QQ7BQANZRLWDEYZJTYVUE3BAVCNFSM6AAAAABDF65NLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRVGQ2DQNJTGE . You are receiving this because you authored the thread.Message ID: @.***>
-- Howard. -- When you want a computer system that works, just choose Linux; When you want a computer system that works, just, choose Microsoft.
what happens if you run
psql -U lsmb_dbadmin -h 127.0.0.1 -d postgres
? Does it ask for your password? What happens if you enter YOURPASSWORD
? Does it log you into the "postgres" database?
Let's start from the beginning. This is where I started: @.**:~ $ sudo -u postgres psql
*could not change directory to "/home/howard": Permission deniedpsql (15.6 (Debian 15.6-0+deb12u1))Type "help" for help.postgres=# alter role lsmb_dbadmin password 'MensShed';ALTER ROLEpostgres=# @.**:~ $
As you can see the ALTER ROLE appears to have executed correctly. I then used the command you suggested above using the password "MensShed" as previously set:
@.:~ $ psql -U lsmb_dbadmin -h 127.0.0.1 -d postgresPassword for user lsmb_dbadmin: psql: error: connection to server at "127.0.0.1", port 5432 failed: FATAL: password authentication failed for user "lsmb_dbadmin"connection to server at "127.0.0.1", port 5432 failed: FATAL: password authentication failed for user @.:~ $ *
Regards,
On Tue, 27 Feb 2024 at 10:15, Erik Huelsmann @.***> wrote:
what happens if you run
psql -U lsmb_dbadmin -h 127.0.0.1 -d postgres
? Does it ask for your password? What happens if you enter YOURPASSWORD ? Does it log you into the "postgres" database?
— Reply to this email directly, view it on GitHub https://github.com/ledgersmb/LedgerSMB/issues/8017#issuecomment-1965498824, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMS2F7VZI7NPZ2OTJVOTV33YVUJRPAVCNFSM6AAAAABDF65NLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRVGQ4TQOBSGQ . You are receiving this because you authored the thread.Message ID: @.***>
-- Howard. -- When you want a computer system that works, just choose Linux; When you want a computer system that works, just, choose Microsoft.
Well, based on the error, I have to conclude that you're sending the wrong password, because you did set it indeed. And the pg_hba.conf file does not deny this access (unless you found in the logs that it does?)
This is not an error in setup.pl, because it already does not work from the command line. It would be good to understand this is not a documentation issue in the installation instructions. If the logs don't mention denial by pg_hba then this is something else.
Closing: more than 90 days without user response. Feel free to reopen with your comments.
Version
1.11.9
What browsers are you seeing the problem on?
This problem isn't browser related
What happened?
I'm trying to log into setup.pl as lsmb_dbadmin using what I thought was the correct password, being the one that is saved in Google Password Manager - there it looks like what I know I have previously used. However, I am getting the following error:
The pg_hba.conf file is:
What should have happened?
Where do I need to go to to fix this problem?