Postgres changing ownership error when running launcher rebuild app

Hello all, please will someone help me with an app rebuild error?

I’m running Discourse on a 1GB Digitalocean droplet, entirely as described in the docs. It’s been running for about 6 months now, without issue.

I followed the recommended process to update docker and the app and ran into an error.

After SSHing in and running sudo su, this part runs fine:

cd /var/discourse
git pull

But running ./launcher rebuild app results in the following error.

root@server:/var/discourse# ./launcher rebuild app
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
cd /pups && git pull && /pups/bin/pups --stdin
Already up-to-date.
I, [2017-11-01T12:18:05.119119 #13]  INFO -- : Loading --stdin
I, [2017-11-01T12:18:05.125982 #13]  INFO -- : > mkdir -p /shared/postgres_run
I, [2017-11-01T12:18:05.128043 #13]  INFO -- : 
I, [2017-11-01T12:18:05.128511 #13]  INFO -- : > chown postgres:postgres /shared/postgres_run
chown: changing ownership of '/shared/postgres_run': Operation not permitted
I, [2017-11-01T12:18:05.130464 #13]  INFO -- : 

Pups::ExecError: chown postgres:postgres /shared/postgres_run failed with return #<Process::Status: pid 16 exit 1>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params "chown postgres:postgres /shared/postgres_run"
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

Discourse is now offline since it is no longer running and will not start. What can I do to fix this?


1 Like

Hopefully it’s okay to bump this every few days, as I would really like to get the forum back up and running again. Thanks! :slight_smile:

1 Like

All I can suggest is to

cd /var/discourse 
git pull
. /launcher rebuild app 

If that continues to fail, you can rename the discourse directory, build anew, then restore your old backup tool the new site.


Thank you for the suggestion, unfortunately, that’s the exact process I’m following which is resulting in some kind of postgres error. Unfortunately, I’m not familiar enough with the details of the software to start debugging it :confused:

If I have to restore from backup, does the daily backup that Discord saves in /var/discourse/shared/standalone/backups/default/ have all the content I need? Media and everything?

Thanks to this thread for showing me where backups were stored locally, since I didn’t have the latest one:


Yes, the backup by default includes uploads in addition to the database. Uploads would only be excluded if you change the backup with uploads setting for your site.

The advantage to Jay’s second suggestion (rename directory and start anew) is that if things just get worse, you can always “un-rename” the original folder and you’re no worse than where you started.


Thanks @pfaffman and @jomaxro I’ll give the rebuild from the most recent backup a try.


As other people have said try the following:

  • take a new backup
  • download it to your local workstation
  • uninstall discourse
  • reinstall discourse
  • restore the backup
  • reboot the server and wait