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

Iam getting following error when i tried run ./launcher rebuild app

FAILED


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

Location of failure: /usr/local/lib/ruby/gems/3.1.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn’

exec failed with the params “su postgres -c ‘psql $db_name -c "alter schema public owner to $db_user;"’”

bootstrap failed with exit code 2

** 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.

4079c40b96373f2f33049a30414bc383acf909fc3863bdb52a1a678a9f0cc9f7

Originally sent in general
Ratnam_Raju_Varsala

Hi @Canapin, how can i integrate plugins into docker app ?

Heliosurge
Ratnam_Raju_Varsala

FAILED

--------------------

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

Location of failure: /usr/local/lib/ruby/gems/3.1.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'

exec failed with the params "su postgres -c 'psql $db_name -c \"alter schema public owner to $db_user;\"'"

bootstrap failed with exit code 2

** 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.

4079c40b96373f2f33049a30414bc383acf909fc3863bdb52a1a678a9f0cc9f7

root@community-online:/var/discourse# /discourse-doctor

-bash: /discourse-doctor: No such file or directory

iam getting this error after adding plugin in app.yml file

Heliosurge

can you post that section of your app.yml where you added plugin under docker?

You have to ensure the formatting is pretty precise.

it is a bit of a pain but usually only install snd rebuild 2 plugin at a time

What plugin are you trying to install?

Ratnam_Raju_Varsala

The site was working fine until the plugin was added, after adding this error, the site is down

Heliosurge

Delete part of your chat post. You have sensitive info. only need the section whhere it ssys $home type stuff abd plugin info.

You have your trade buttons plugins added twice. Remove noth instances and try a rebuild abd see if site is restored

Only need from here down if chat allows wrap it with something like ´´ .... ´´

Ratnam_Raju_Varsala

no not added twise

just i paste here after completion app.yml content

JammyDodger

I think this would probably be better discussed in the topic. I'll move these messages over. :+1:

Ratnam_Raju_Varsala

deleted

Heliosurge

cool jam. can you remove his sensitive info so just plugin info?

1 Like

I, [2023-02-11T18:58:30.914906 #1]  INFO -- : > [ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/13/bin/initdb -D /shared/postgres_data || exit 0
I, [2023-02-11T18:58:30.917342 #1]  INFO -- : 
I, [2023-02-11T18:58:30.917415 #1]  INFO -- : > chown -R postgres:postgres /shared/postgres_data
I, [2023-02-11T18:58:30.930655 #1]  INFO -- : 
I, [2023-02-11T18:58:30.930872 #1]  INFO -- : > chown -R postgres:postgres /var/run/postgresql
I, [2023-02-11T18:58:30.933165 #1]  INFO -- : 
I, [2023-02-11T18:58:30.933384 #1]  INFO -- : > /root/upgrade_postgres
I, [2023-02-11T18:58:30.937415 #1]  INFO -- : 
I, [2023-02-11T18:58:30.937665 #1]  INFO -- : > rm /root/upgrade_postgres
I, [2023-02-11T18:58:30.939673 #1]  INFO -- : 
I, [2023-02-11T18:58:30.940012 #1]  INFO -- : Replacing data_directory = '/var/lib/postgresql/13/main' with data_directory = '/shared/postgres_data' in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.940639 #1]  INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.941061 #1]  INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.941491 #1]  INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.941859 #1]  INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.942208 #1]  INFO -- : Replacing (?-mix:#?default_text_search_config *=.*) with default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.942546 #1]  INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2023-02-11T18:58:30.945002 #1]  INFO -- : 
I, [2023-02-11T18:58:30.945405 #1]  INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.945805 #1]  INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.946227 #1]  INFO -- : Replacing (?-mix:#?log_min_duration_statement *=.*) with log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.946605 #1]  INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres  peer in /etc/postgresql/13/main/pg_hba.conf
I, [2023-02-11T18:58:30.946992 #1]  INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/13/main/pg_hba.conf
I, [2023-02-11T18:58:30.947317 #1]  INFO -- : Replacing (?-mix:^host.*all.*all.*::1\/128.*$) with host all all ::/0 md5 in /etc/postgresql/13/main/pg_hba.conf
I, [2023-02-11T18:58:30.947660 #1]  INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main
I, [2023-02-11T18:58:30.949060 #1]  INFO -- : > sleep 5
2023-02-11 18:58:30.959 UTC [42] FATAL:  data directory "/shared/postgres_data" has invalid permissions
2023-02-11 18:58:30.959 UTC [42] DETAIL:  Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).
I, [2023-02-11T18:58:35.952167 #1]  INFO -- : 
I, [2023-02-11T18:58:35.952437 #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?
I, [2023-02-11T18:58:35.994953 #1]  INFO -- : 
I, [2023-02-11T18:58:35.995243 #1]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
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, [2023-02-11T18:58:36.036721 #1]  INFO -- : 
I, [2023-02-11T18:58:36.037043 #1]  INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
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, [2023-02-11T18:58:36.078384 #1]  INFO -- : 
I, [2023-02-11T18:58:36.078703 #1]  INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
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, [2023-02-11T18:58:36.120285 #1]  INFO -- : 
I, [2023-02-11T18:58:36.120682 #1]  INFO -- : Terminating async processes


FAILED
--------------------
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return #<Process::Status: pid 54 exit 2>
Location of failure: /usr/local/lib/ruby/gems/3.1.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params "su postgres -c 'psql $db_name -c \"alter schema public owner to $db_user;\"'"
bootstrap failed with exit code 2
** 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.
4c2225e9c667f9fc2b7b4f9bd26c03f243e877b123be1d41a3c57bf90c049595

When you add a plugin you will want to copy abd position the code like the one above. I believe no spaces between lines.

Also verify the plugin you want to use is still supported.

can you post that plugin link? not familar eith that one iff hand. better if it has a link here in discourse as well.

discourse git clone GitHub - jannolii/discourse-topic-trade-buttons

I removed plugin and after that try to rebuild it, but after removing the plugin iam getting this error, before its working fine.

I, [2023-02-11T18:58:30.949060 #1] INFO – : > sleep 5

2023-02-11 18:58:30.959 UTC [42] FATAL: data directory “/shared/postgres_data” has invalid permissions

2023-02-11 18:58:30.959 UTC [42] DETAIL: Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).

I, [2023-02-11T18:58:35.952167 #1] INFO – :

I, [2023-02-11T18:58:35.952437 #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?

I, [2023-02-11T18:58:35.994953 #1] INFO – :

I, [2023-02-11T18:58:35.995243 #1] INFO – : > su postgres -c ‘psql discourse -c “create user discourse;”’ || true

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, [2023-02-11T18:58:36.036721 #1] INFO – :

I, [2023-02-11T18:58:36.037043 #1] INFO – : > su postgres -c ‘psql discourse -c “grant all privileges on database discourse to discourse;”’ || true

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, [2023-02-11T18:58:36.078384 #1] INFO – :

I, [2023-02-11T18:58:36.078703 #1] INFO – : > su postgres -c ‘psql discourse -c “alter schema public owner to discourse;”’

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, [2023-02-11T18:58:36.120285 #1] INFO – :

I, [2023-02-11T18:58:36.120682 #1] INFO – : Terminating async processes

FAILED


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

Location of failure: /usr/local/lib/ruby/gems/3.1.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn’

exec failed with the params “su postgres -c ‘psql $db_name -c "alter schema public owner to $db_user;"’”

bootstrap failed with exit code 2

** 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.

4c2225e9c667f9fc2b7b4f9bd26c03f243e877b123be1d41a3c57bf90c049595

I am nnot fully sure of the procedure but you might be able to load the site in safe mode.

@JammyDodger can you link the procedure for safe mode?

Have you seen my log file?

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

2 Likes

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

volumes:

  • 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

hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- 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.