Hello Discourse Community,
I am a newbie when it comes to docker and linux sysadmin tasks in general. I am trying to convince my company to use Discourse and they asked me a demo first. So here I am trying to bring it to life on our servers.
I’ve been attempting to set up Discourse on a local server and have encountered some issues that I’m hoping to get assistance with. Below is a summary of my setup and the steps I’ve taken so far:
System Setup:
- Operating System: Ubuntu 20.04.6 LTS
- Docker Version: 24.0.5, build 24.0.5-0ubuntu1~20.04.1
- Discourse Version: 3.2
Issue:
I followed the official guide for installing Discourse on a cloud server (discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub), but I’m running into errors with the discourse-setup
script related to PostgreSQL.
Steps Taken:
- I confirmed that PostgreSQL is running by checking the process list.
- I verified that PostgreSQL is listening on the correct port (5432) and that the Unix socket file exists.
- I encountered errors indicating that the “discourse” database and user already exist, but when I checked using the
psql
command, neither the database nor the user were listed.
Here the commands I used:
- Checked PostgreSQL processes:
ps aux | grep postgres
- Checked PostgreSQL listening port:
sudo netstat -plunt | grep postgres
- Checked Unix socket file:
ls -l /var/run/postgresql/.s.PGSQL.5432
- Attempted to drop the “discourse” database and user:
su postgres -c 'psql -c "DROP DATABASE IF EXISTS discourse;"'
andsu postgres -c 'psql -c "DROP USER IF EXISTS discourse;"'
- Listed databases and users:
psql -c "\l"
andpsql -c "\du"
Errors Encountered:
ERROR: database "discourse" already exists
ERROR: role "discourse" already exists
psql: error: FATAL: role "root" does not exist
Despite these errors, the “discourse” database and user do not appear to exist when checked directly in PostgreSQL.
There are other errors in the log but I believe these are the relevant ones at least for now.
I would greatly appreciate any guidance or suggestions on how to resolve these issues. Has anyone else encountered similar problems, or does anyone have insights into what might be going wrong?
Thank you in advance for your help,
Andrea