I had a drive fail on me so I copied it all to a new one and some permissions broke. Discourse is now refusing to run and I’m not sure why.
Here is the discourse-doctor output:
pyx@localhost:~/discourse_docker$ sudo ./discourse-doctor
DISCOURSE DOCTOR Sun Jun 1 02:58:54 PM EDT 2025
OS: Linux localhost.localdomain 6.14.6-300.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 9 20:11:19 UTC 2025 x86_64 GNU/Linux
Found containers/app.yml
==================== YML SETTINGS ====================
DISCOURSE_HOSTNAME=blog.admsoftware.org
SMTP_ADDRESS=smtp-relay.brevo.com
DEVELOPER_EMAILS=admblog@notpyx.me
SMTP_PASSWORD=REDACTED
SMTP_PORT=587
SMTP_USER_NAME=REDACTED
LETSENCRYPT_ACCOUNT_EMAIL=me@example.com
==================== DOCKER INFO ====================
which: no docker.io in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/lib/snapd/snap/bin)
DOCKER VERSION: Docker version 28.1.1, build 4eba377
DOCKER PROCESSES (docker ps -a)
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8f123aeb38e7 local_discourse/app "/sbin/boot" 2 months ago Exited (5) About a minute ago app
==================== SERIOUS PROBLEM!!!! ====================
app not running!
Attempting to rebuild
==================== REBUILD LOG ====================
x86_64 arch detected.
Ensuring launcher is up to date
Launcher is up-to-date
Stopping old container
+ /usr/sbin/docker stop -t 600 app
app
2.0.20250226-0128: Pulling from discourse/base
Digest: sha256:6f18aa2cd22bba0deb91d69194e577d4f96130ad555ae8ec646a8792cbfe37db
Status: Image is up to date for discourse/base:2.0.20250226-0128
docker.io/discourse/base:2.0.20250226-0128
/usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2025-06-01T18:59:23.192549 #1] INFO -- : Reading from stdin
I, [2025-06-01T18:59:23.214419 #1] INFO -- : File > /etc/service/postgres/run chmod: +x chown:
I, [2025-06-01T18:59:23.217804 #1] INFO -- : File > /etc/service/postgres/log/run chmod: +x chown:
I, [2025-06-01T18:59:23.224688 #1] INFO -- : File > /etc/runit/3.d/99-postgres chmod: +x chown:
I, [2025-06-01T18:59:23.236071 #1] INFO -- : File > /root/install_postgres chmod: +x chown:
I, [2025-06-01T18:59:23.238653 #1] INFO -- : File > /root/upgrade_postgres chmod: +x chown:
I, [2025-06-01T18:59:23.238820 #1] INFO -- : Replacing data_directory = '/var/lib/postgresql/15/main' with data_directory = '/shared/postgres_data' in /etc/postgresql/15/main/postgresql.conf
I, [2025-06-01T18:59:23.279337 #1] INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/15/main/postgresql.conf
I, [2025-06-01T18:59:23.279732 #1] INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/15/main/postgresql.conf
I, [2025-06-01T18:59:23.280222 #1] INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/15/main/postgresql.conf
I, [2025-06-01T18:59:23.280678 #1] INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/15/main/postgresql.conf
I, [2025-06-01T18:59:23.281128 #1] INFO -- : Replacing (?-mix:#?default_text_search_config *=.*) with default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/15/main/postgresql.conf
I, [2025-06-01T18:59:23.281724 #1] INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/15/main/postgresql.conf
I, [2025-06-01T18:59:23.282241 #1] INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/15/main/postgresql.conf
I, [2025-06-01T18:59:23.282799 #1] INFO -- : Replacing (?-mix:#?log_min_duration_statement *=.*) with log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/15/main/postgresql.conf
I, [2025-06-01T18:59:23.283362 #1] INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres peer in /etc/postgresql/15/main/pg_hba.conf
I, [2025-06-01T18:59:23.335291 #1] INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/15/main/pg_hba.conf
I, [2025-06-01T18:59:23.336039 #1] INFO -- : Replacing (?-mix:^host.*all.*all.*::1\/128.*$) with host all all ::/0 md5 in /etc/postgresql/15/main/pg_hba.conf
I, [2025-06-01T18:59:23.336922 #1] INFO -- : > if [ -f /root/install_postgres ]; then
/root/install_postgres && rm -f /root/install_postgres
elif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then
socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
fi
I, [2025-06-01T18:59:37.414414 #1] INFO -- : Generating locales (this might take a while)...
en_US.UTF-8... done
Generation complete.
I, [2025-06-01T18:59:37.414911 #1] INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/15/bin/postmaster -D /etc/postgresql/15/main
2025-06-01 18:59:37.430 GMT [43] LOG: skipping missing configuration file "/shared/postgres_data/postgresql.auto.conf"
2025-06-01 18:59:37.430 UTC [43] FATAL: data directory "/shared/postgres_data" has wrong ownership
2025-06-01 18:59:37.430 UTC [43] HINT: The server must be started by the user that owns the data directory.
I, [2025-06-01T18:59:37.441300 #1] INFO -- : File > /usr/local/bin/create_db chmod: +x chown:
I, [2025-06-01T18:59:37.445699 #1] INFO -- : File > /var/lib/postgresql/take-database-backup chmod: +x chown: postgres:postgres
I, [2025-06-01T18:59:37.473465 #1] INFO -- : File > /var/spool/cron/crontabs/postgres chmod: chown:
I, [2025-06-01T18:59:37.474033 #1] INFO -- : > sleep 5
I, [2025-06-01T18:59:42.479011 #1] INFO -- :
I, [2025-06-01T18:59:42.479160 #1] INFO -- : > /usr/local/bin/create_db
createdb: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
Is the server running locally and accepting connections on that socket?
I, [2025-06-01T18:59:42.920574 #1] INFO -- :
I, [2025-06-01T18:59:42.920660 #1] INFO -- : > echo postgres installed!
I, [2025-06-01T18:59:42.922282 #1] INFO -- : postgres installed!
I, [2025-06-01T18:59:42.925593 #1] INFO -- : File > /etc/service/redis/run chmod: +x chown:
I, [2025-06-01T18:59:42.928336 #1] INFO -- : File > /etc/service/redis/log/run chmod: +x chown:
I, [2025-06-01T18:59:42.930932 #1] INFO -- : File > /etc/runit/3.d/10-redis chmod: +x chown:
I, [2025-06-01T18:59:42.931107 #1] INFO -- : Replacing daemonize yes with in /etc/redis/redis.conf
I, [2025-06-01T18:59:42.951089 #1] INFO -- : Replacing (?-mix:^pidfile.*$) with in /etc/redis/redis.conf
I, [2025-06-01T18:59:42.951418 #1] INFO -- : > install -d -m 0755 -o redis -g redis /shared/redis_data
I, [2025-06-01T18:59:42.953410 #1] INFO -- :
I, [2025-06-01T18:59:42.953663 #1] INFO -- : Replacing (?-mix:^logfile.*$) with logfile "" in /etc/redis/redis.conf
I, [2025-06-01T18:59:42.954064 #1] INFO -- : Replacing (?-mix:^bind .*$) with in /etc/redis/redis.conf
I, [2025-06-01T18:59:42.954614 #1] INFO -- : Replacing (?-mix:^dir .*$) with dir /shared/redis_data in /etc/redis/redis.conf
I, [2025-06-01T18:59:42.955168 #1] INFO -- : Replacing (?-mix:^protected-mode yes) with protected-mode no in /etc/redis/redis.conf
I, [2025-06-01T18:59:42.955684 #1] INFO -- : Replacing # io-threads 4 with io-threads $redis_io_threads in /etc/redis/redis.conf
I, [2025-06-01T18:59:42.956232 #1] INFO -- : > echo redis installed
I, [2025-06-01T18:59:42.957411 #1] INFO -- : redis installed
I, [2025-06-01T18:59:42.957556 #1] INFO -- : > cat /etc/redis/redis.conf | grep logfile
I, [2025-06-01T18:59:42.959859 #1] INFO -- : logfile ""
I, [2025-06-01T18:59:42.959955 #1] INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2025-06-01T18:59:42.960943 #1] INFO -- : > sleep 10
91:C 01 Jun 2025 18:59:42.966 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
91:C 01 Jun 2025 18:59:42.966 # Redis version=7.0.15, bits=64, commit=00000000, modified=0, pid=91, just started
91:C 01 Jun 2025 18:59:42.966 # Configuration loaded
91:M 01 Jun 2025 18:59:42.966 * monotonic clock: POSIX clock_gettime
91:M 01 Jun 2025 18:59:42.967 * Running mode=standalone, port=6379.
91:M 01 Jun 2025 18:59:42.967 # Server initialized
91:M 01 Jun 2025 18:59:42.967 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
91:M 01 Jun 2025 18:59:42.967 * Loading RDB produced by version 7.0.15
91:M 01 Jun 2025 18:59:42.967 * RDB age 75 seconds
91:M 01 Jun 2025 18:59:42.967 * RDB memory usage when created 1.13 Mb
91:M 01 Jun 2025 18:59:42.968 * Done loading RDB, keys loaded: 291, keys expired: 0.
91:M 01 Jun 2025 18:59:42.968 * DB loaded from disk: 0.001 seconds
91:M 01 Jun 2025 18:59:42.968 * Ready to accept connections
I, [2025-06-01T18:59:52.962279 #1] INFO -- :
I, [2025-06-01T18:59:52.962534 #1] INFO -- : > thpoff echo "thpoff is installed!"
I, [2025-06-01T18:59:52.965518 #1] INFO -- : thpoff is installed!
I, [2025-06-01T18:59:52.965723 #1] INFO -- : > /usr/local/bin/ruby -e 'if ENV["DISCOURSE_SMTP_ADDRESS"] == "smtp.example.com"; puts "Aborting! Mail is not configured!"; exit 1; end'
I, [2025-06-01T18:59:53.029770 #1] INFO -- :
I, [2025-06-01T18:59:53.029842 #1] INFO -- : > /usr/local/bin/ruby -e 'if ENV["DISCOURSE_HOSTNAME"] == "discourse.example.com"; puts "Aborting! Domain is not configured!"; exit 1; end'
I, [2025-06-01T18:59:53.084385 #1] INFO -- :
I, [2025-06-01T18:59:53.084455 #1] INFO -- : > /usr/local/bin/ruby -e 'if (ENV["DISCOURSE_CDN_URL"] || "")[0..1] == "//"; puts "Aborting! CDN must have a protocol specified. Once fixed you should rebake your posts now to correct all posts."; exit 1; end'
I, [2025-06-01T18:59:53.140012 #1] INFO -- :
I, [2025-06-01T18:59:53.140141 #1] INFO -- : > rm -f /etc/cron.d/anacron
I, [2025-06-01T18:59:53.150889 #1] INFO -- :
I, [2025-06-01T18:59:53.153082 #1] INFO -- : File > /etc/cron.d/anacron chmod: chown:
I, [2025-06-01T18:59:53.163799 #1] INFO -- : File > /etc/runit/1.d/copy-env chmod: +x chown:
I, [2025-06-01T18:59:53.167374 #1] INFO -- : File > /etc/service/unicorn/run chmod: +x chown:
I, [2025-06-01T18:59:53.170824 #1] INFO -- : File > /etc/service/nginx/run chmod: +x chown:
I, [2025-06-01T18:59:53.174223 #1] INFO -- : File > /etc/runit/3.d/01-nginx chmod: +x chown:
I, [2025-06-01T18:59:53.177667 #1] INFO -- : File > /etc/runit/3.d/02-unicorn chmod: +x chown:
I, [2025-06-01T18:59:53.177776 #1] INFO -- : Replacing # postgres with if [ -f /root/install_postgres ]; then
/root/install_postgres
rm /root/install_postgres
fi
sv start postgres || exit 1
in /etc/service/unicorn/run
I, [2025-06-01T18:59:53.178960 #1] INFO -- : > cd /var/www/discourse && sudo -H -E -u discourse git clean -f
fatal: detected dubious ownership in repository at '/var/www/discourse'
To add an exception for this directory, call:
git config --global --add safe.directory /var/www/discourse
I, [2025-06-01T18:59:53.186831 #1] INFO -- :
I, [2025-06-01T18:59:53.187193 #1] INFO -- : Terminating async processes
I, [2025-06-01T18:59:53.187219 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 91
91:signal-handler (1748804393) Received SIGTERM scheduling shutdown...
91:M 01 Jun 2025 18:59:53.211 # User requested shutdown...
91:M 01 Jun 2025 18:59:53.211 * Saving the final RDB snapshot before exiting.
91:M 01 Jun 2025 18:59:53.262 * DB saved on disk
91:M 01 Jun 2025 18:59:53.262 # Redis is now ready to exit, bye bye...
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && sudo -H -E -u discourse git clean -f failed with return #<Process::Status: pid 121 exit 128>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"code", "cmd"=>["sudo -H -E -u discourse git clean -f", "sudo -H -E -u discourse bash -c '\n set -o errexit\n if [ $(git rev-parse --is-shallow-repository) == \"true\" ]; then\n git remote set-branches --add origin main\n git remote set-branches origin $version\n git fetch --depth 1 origin $version\n else\n git fetch --tags --prune-tags --prune --force origin\n fi\n'", "sudo -H -E -u discourse bash -c '\n set -o errexit\n if [[ $(git symbolic-ref --short HEAD) == $version ]] ; then\n git pull\n else\n git -c advice.detachedHead=false checkout $version\n fi\n'", "sudo -H -E -u discourse git config user.discourse-version $version", "mkdir -p tmp", "chown discourse:www-data tmp", "mkdir -p tmp/pids", "mkdir -p tmp/sockets", "touch tmp/.gitkeep", "mkdir -p /shared/log/rails", "bash -c \"touch -a /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log\"", "bash -c \"ln -s /shared/log/rails/{production,production_errors,unicorn.stdout,unicorn.stderr,sidekiq}.log $home/log\"", "bash -c \"mkdir -p /shared/{uploads,backups}\"", "bash -c \"ln -s /shared/{uploads,backups} $home/public\"", "bash -c \"mkdir -p /shared/tmp/{backups,restores}\"", "bash -c \"ln -s /shared/tmp/{backups,restores} $home/tmp\"", "chown -R discourse:www-data /shared/log/rails /shared/uploads /shared/backups /shared/tmp", "[ ! -d public/plugins ] || find public/plugins/ -maxdepth 1 -xtype l -delete"]}
bootstrap failed with exit code 128
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
59a8998661328e4a023f25ebdc10b5782ca3346e36d6904e033995a4ed77800f
==================== END REBUILD LOG ====================
Failed to rebuild app.
Checking your domain name . . .
Connection to blog.admsoftware.org succeeded.
You should probably remove any non-standard plugins and rebuild.
Attempting to restart existing container. . .
x86_64 arch detected.
starting up existing container
+ /usr/sbin/docker start app
Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint app (f898acce83b9f4e8018b357577f4f9c7543262ee97b45b767b15ca740f258f97): failed to bind host port for 0.0.0.0:443:172.17.0.2:443/tcp: address already in use
Error: failed to start containers: app
Failed to restart the container.
==================== PLUGINS ====================
- git clone https://github.com/discourse/docker_manager.git
- git clone https://github.com/discourse/discourse-chat-integration
- git clone https://github.com/discourse/discourse-ai
No non-official plugins detected.
See https://github.com/discourse/discourse/blob/main/lib/plugin/metadata.rb for the official list.
========================================
Discourse version at blog.admsoftware.org: NOT FOUND
Discourse version at localhost: NOT FOUND
==================== MEMORY INFORMATION ====================
RAM (MB): 12431
total used free shared buff/cache available
Mem: 11855 3040 505 99 8719 8814
Swap: 8191 0 8191
==================== DISK SPACE CHECK ====================
---------- OS Disk Space ----------
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/fedora-root 930G 71G 860G 8% /
==================== DISK INFORMATION ====================
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10PURZ-85U
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 2600569C-3046-4306-9163-98FC13551442
Device Start End Sectors Size Type
/dev/sda1 2048 1230847 1228800 600M EFI System
/dev/sda2 1230848 3327999 2097152 1G Linux extended boot
/dev/sda3 3328000 1953523711 1950195712 929.9G Linux LVM
Disk /dev/mapper/fedora-root: 929.92 GiB, 998496010240 bytes, 1950187520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/zram0: 8 GiB, 8589934592 bytes, 2097152 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
==================== END DISK INFORMATION ====================
==================== MAIL TEST ====================
For a robust test, get an address from http://www.mail-tester.com/
Or just send a test message to yourself.
Email address for mail test? ('n' to skip) [admblog@notpyx.me]:
Sending mail to admblog@notpyx.me. . .
Error response from daemon: container 8f123aeb38e75d8fcdc24e774904d61f56145c512f3b7ad109e9863728dcd46d is not running
Replacing: SMTP_PASSWORD
Replacing: LETSENCRYPT_ACCOUNT_EMAIL
Replacing: DEVELOPER_EMAILS
Replacing: DISCOURSE_DB_PASSWORD
Replacing: Sending mail to
==================== DONE! ====================
Despite the “address already in use” error, I do not have anything listening on :443.
How do I get my site back up?