Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return

As you can see, “safe mode” is automatically converted into a link to the safe mode tutorial :slight_smile:


Awesome thank you. my spologies. canapin do you see something that might be causing this issue? at a guess maybe a formatting usdye in app.yml?

excerpt from safe mode topic.

2023-02-11 19:20:40.842 UTC [42] FATAL: data directory “/shared/postgres_data” has invalid permissions
2023-02-11 19:20:40.842 UTC [42] DETAIL: Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).
I, [2023-02-11T19:20:45.834611 #1] INFO – :
I, [2023-02-11T19:20:45.834887 #1] INFO – : > su postgres -c ‘createdb discourse’ || true
createdb: error: could not connect to database template1: 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?

ypu may need to scroll up higher. Have you triedvthe safe mode procedure?

Not sure if it will work in this case or not tbh.

Site completely down, even i added safemode its not working, site down app not running

Can you repost the $plugins goes here section of your app.yml?

just be sure to pist it inside of “code” ending with “/code” replace quotes with “[” “]”

Your app.yml cintent here
- does nor trigger markdown

Dan, i removed plugin from app.yml file, there is no plugin now, but i will post you here again


  • volume:
    host: /var/discourse/shared/standalone
    guest: /shared
  • volume:
    host: /var/discourse/shared/standalone/log/var-log
    guest: /var/log

Plugins go here

see Install Plugins in Discourse for details

- exec:
cd: $home/plugins
- git clone GitHub - discourse/docker_manager: plugin for use with discourse docker image

I understand that but you may have a formatting error. The app.yml file us very picky…just one line outbof alignment can cause problems.

This why I mentioned pasting inbetween the code markdown so we can see a raw version of your file.

Something even simple as an empty line between lines can cause a problem.

Pups::ExecError: su postgres -c ‘psql discourse -c “alter schema public owner to discourse;”’ failed with return #<Process::Status: pid 54 exit 2>

ata directory “/shared/postgres_data” has invalid permissions

my app.yml file

## Plugins go here                                 ## see https://meta.discourse.org/t/19157 for deta$hooks:                                               after_code:                                          - exec:                                                cd: $home/plugins                                  cmd:                                                 - git clone https://github.com/discourse$          - git clone https://github.com/Ebsy/disc$          - git clone https://github.com/discourse$          - git clone https://github.com/discourse$          - git clone https://github.com/discourse$          - git clone https://github.com/discourse$          - git clone https://github.com/discourse$          - git clone https://github.com/discourse$          - git clone https://github.com/davidtayl$          - git clone https://github.com/discourse$##          - git clone https://github.com/pavilio$## Official Plugins                                ##          - git clone https://github.com/discour$          - git clone https://github.com/discourse$          - git clone https://github.com/discourse$          - git clone https://github.com/discourse$          - git clone https://github.com/discourse$          - git clone https://github.com/discourse$          - git clone https://github.com/discourse$          - git clone https://github.com/discourse$          - git clone https://github.com/discourse$## New Pluguns installed                                     - git clone https://github.com/Ahmedgaga$##          - git clone https://github.com/gdpelic$          - git clone https://github.com/paviliond$## Any custom commands to run after building
run:                                                 - exec: echo "Beginning of custom commands"        ## If you want to set the 'From' email address f$  ## After getting the first signup email, re-comm$  #- exec: rails r "SiteSetting.notification_email$  - exec: echo "End of custom commands"

copy and paste this to see if any fornmatting errors.

Not sure how to wrap it so it lists…

2023-02-11 19:55:35.034 GMT [42] LOG: skipping missing configuration file “/shared/postgres_data/postgresql.auto.conf”
2023-02-11 19:55:35.035 UTC [42] FATAL: could not read permissions of directory “/shared/postgres_data”: Permission denied

Try discourse doctor as I don’t seem to be able to help you any further as your just reposting an error. Need to scroll up and look for a cause and verify your app.yml file.

If you perform regular server backups and/or discourse backups you can also recovery that way. but i believe you will loose posts created after the backup.

Hi Ratnam,

Perhaps it would be a good idea to explain what you’re trying to achieve and what software you use because it’s a bit confusing right now. You’re mostly posting error messages without the proper context to fully understand.

Please first reply to these questions and we’ll try moving forward starting from here :slight_smile:

  1. Are you trying to install a production Discourse using the regular docker install, following the steps described here discourse/INSTALL-cloud.md at main · discourse/discourse · GitHub?

  2. What is your operating system?

  3. What are your server specs?


This looks like the problem, though I cannot imagine how changing the plugins would have caused an issue with the postgres permissions. Have you changed something else? This is a standard install, right?

safe-mode will not help since the site isn’t working.


I solved the issue by changing postgres data permissions @Canapin @Heliosurge Thanks for your support


I used following slack
GitHub - discourse/discourse_docker: A Docker image for Discourse /var/discoursed
Operating System - ubuntu 20.04 LTS
Server - 8GB RAM 30GB

Thanks & Regards

1 Like

Congrats. Glad you got it tesolved. I would recommend maybe doing a server backup if your thinking on trying a plugin install.

Though tbh you should be fine as long as you enter the plugin install correctly. With the plugin you were trying to install now come to think of it may need an update. Iirc now it showed last activity was feb 2022? if so it is potentially a year out of date and changes since then mau have broken the plugin.


I would recommend looking over plugin Category and see if any plugins may peak your interest.

Discourse Reactions

  • Is pretty cool as it gives you a way to extend to beyond simple likes.

National Flags

  • Gives your members option to display a flag on there posts.

Discourse Docs

  • Great for setting up a knowledge base seach. Good companion to Solved.

Discourse Solved

  • Setup a category for users t9 ask a question. Op Can choose best solution that worked. good to set category to always display first post. Solution is quoted in the Op’s post snd marked solved. There is a theme-component to make solvef quote prettier.

Discourse Who’s Online

  • Shows on different pages who is online. if User online if your reading a post a glow circle will surround profile pic.

Discourse Templates

  • Create template replies aka ‘canned replies’. Too much to much to mention. See topic

Main thing avoid deprecated and end of life plugins. You want plugins that have activeb maintainers. Good ones of Note are Disvourse Official plugins and Pavilion group; though there are many others that are actively maintained then just these 2 groups I have mentioned.

1 Like