New Here and New Installation

Hello Forum and Hello Fellow RT Users/Admins!

I only recently discovered this application and so I was walking through the install instructions. Running Ubuntu 22.04. I cannot get the PostgreSQL account to create. I keep getting this error:

createuser: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: role "root" does not exist

I am using the install guide here:
https://rt-wiki.bestpractical.com/wiki/ManualInstallation#Set_up_RT’s_web_server

it does not say if I need to do anything with the user I am using etc. I have tried as sudo su, I have tried the command with sudo as posted in the document. I can’t figure out what I am doing wrong. The command is this:

sudo createuser --createdb --createrole --login --pwprompt rt_admin

From what I can tell it is trying to access PostgreSQL in order to set permissions inside of there and that’s where things go wrong as the root user doesn’t appear to have access to postgresql.

So then I thought that it was looking for me instead to actually go into postgre and run the command…

I did # su - postgres
then went into psql and tried the command there which did nothing. Confirmed with \du

I am at a loss right now. The other issue I had when trying things is trying to go into the postgres user account and then trying to create the user from there which fails because it is asking for the password for the postgres user which is not set apparently for security reasons. I’m sure there is either something I’m not doing, typing, or missing. I’m not sure what to do at this point.

It’s a VM so I could scrap it and start over fairly easily since I made a snapshot but I feel like I’m going to hit the same roadblock.

Nevermind… the documentation just needs an edit:

sudo su - postgres
createuser --createdb --createrole --login --pwprompt rt_admin

That created the user. The document just doesn’t tell you to do that then then run the command from right there and WITHOUT the sudo in front of it.

When you run the command on the wiki

sudo createuser --createdb --createrole --login --pwprompt rt_admin

you are prompted, asking the password for the postgres account which doesn’t exist.

Unrelated quick story. I actually got through a good majority of this install yesterday and then borked the thing somehow so I rolled back and got stuck here. I think what I did yesterday is because I normally work from root prompt I skip the sudo command so I’m sure I read online to do su - postgres to go into the postgres user and then run the command and I was just naïve and ran it without the sudo in front which of course is the answer.