다른 서버에서 pg_dump 관련 오류가 발생했습니다:
x86_64 arch detected.
Ensuring launcher is up to date
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 600 app
app
2.0.20260803-0122: Pulling from discourse/base
Digest: sha256:ab1e7217470759e63313a16bc5b71b9f2dd7d3ae8303286e5985f563ad12b7b3
Status: Image is up to date for discourse/base:2.0.20260803-0122
docker.io/discourse/base:2.0.20260803-0122
/usr/local/lib/ruby/gems/3.4.0/gems/pups-1.4.0/lib/pups.rb
/usr/local/bin/pups --stdin
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)
I, [2026-08-03T09:02:29.698631 #1] INFO -- : Reading from stdin
I, [2026-08-03T09:02:29.724575 #1] INFO -- : File > /etc/service/postgres/run chmod: +x chown:
I, [2026-08-03T09:02:29.737296 #1] INFO -- : File > /etc/service/postgres/log/run chmod: +x chown:
I, [2026-08-03T09:02:29.750650 #1] INFO -- : File > /etc/runit/3.d/99-postgres chmod: +x chown:
I, [2026-08-03T09:02:29.763301 #1] INFO -- : File > /root/install_postgres chmod: +x chown:
I, [2026-08-03T09:02:29.775620 #1] INFO -- : File > /root/upgrade_postgres chmod: +x chown:
I, [2026-08-03T09:02:29.777021 #1] INFO -- : Replacing data_directory = '/var/lib/postgresql/18/main' with data_directory = '/shared/postgres_data' in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.778673 #1] INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.780140 #1] INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.781699 #1] INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.783144 #1] INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.784461 #1] INFO -- : Replacing (?-mix:#?default_text_search_config *=.*) with default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.785820 #1] INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.787120 #1] INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.788468 #1] INFO -- : Replacing (?-mix:#?log_min_duration_statement *=.*) with log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/18/main/postgresql.conf
I, [2026-08-03T09:02:29.789816 #1] INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres peer in /etc/postgresql/18/main/pg_hba.conf
I, [2026-08-03T09:02:29.790932 #1] INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/18/main/pg_hba.conf
I, [2026-08-03T09:02:29.792274 #1] INFO -- : Replacing (?-mix:^host.*all.*all.*::1\/128.*$) with host all all ::/0 md5 in /etc/postgresql/18/main/pg_hba.conf
I, [2026-08-03T09:02:29.793638 #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
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)
Generating locales (this might take a while)...
en_GB.UTF-8... done
en_US.UTF-8... done
Generation complete.
2026/08/03 09:02:33 socat[35] E connect(, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): Connection refused
Upgrading PostgreSQL from version 15 to 18
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with this locale configuration:
locale provider: builtin
default collation: C.UTF-8
LC_COLLATE: C.UTF-8
LC_CTYPE: C.UTF-8
LC_MESSAGES: C.UTF-8
LC_MONETARY: C.UTF-8
LC_NUMERIC: C.UTF-8
LC_TIME: C.UTF-8
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /shared/postgres_data_new ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default "max_connections" ... 100
selecting default "shared_buffers" ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
/usr/lib/postgresql/18/bin/pg_ctl -D /shared/postgres_data_new -l logfile start
Get:1 http://deb.debian.org/debian bookworm-backports InRelease [59.4 kB]
Hit:2 http://deb.debian.org/debian bookworm InRelease
Get:3 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Hit:4 http://deb.debian.org/debian-security bookworm-security InRelease
Hit:5 https://deb.nodesource.com/node_22.x nodistro InRelease
Hit:6 https://dl.yarnpkg.com/debian stable InRelease
Hit:7 https://apt.postgresql.org/pub/repos/apt bookworm-pgdg InRelease
Fetched 115 kB in 1s (77.2 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
postgresql-15 postgresql-15-pgvector
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 15.2 MB of archives.
After this operation, 52.6 MB of additional disk space will be used.
Get:1 https://apt.postgresql.org/pub/repos/apt bookworm-pgdg/main amd64 postgresql-15 amd64 15.18-1.pgdg12+1 [15.0 MB]
Get:2 https://apt.postgresql.org/pub/repos/apt bookworm-pgdg/main amd64 postgresql-15-pgvector amd64 0.8.6-1.pgdg12+1 [271 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 15.2 MB in 1s (29.8 MB/s)
Selecting previously unselected package postgresql-15.
(Reading database ... 32784 files and directories currently installed.)
Preparing to unpack .../postgresql-15_15.18-1.pgdg12+1_amd64.deb ...
Unpacking postgresql-15 (15.18-1.pgdg12+1) ...
Selecting previously unselected package postgresql-15-pgvector.
Preparing to unpack .../postgresql-15-pgvector_0.8.6-1.pgdg12+1_amd64.deb ...
Unpacking postgresql-15-pgvector (0.8.6-1.pgdg12+1) ...
Setting up postgresql-15 (15.18-1.pgdg12+1) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
Setting up postgresql-15-pgvector (0.8.6-1.pgdg12+1) ...
Processing triggers for postgresql-common (293.pgdg12+1) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
Creating new PostgreSQL cluster 15/main ...
/usr/lib/postgresql/15/bin/initdb -D /var/lib/postgresql/15/main --auth-local peer --auth-host scram-sha-256 --no-instructions
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_GB.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/15/main ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Etc/UTC
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
Stopping PostgreSQL 15 database server: main.
Stopping PostgreSQL 18 database server: main.
waiting for server to start....2026-08-03 09:02:47.642 UTC [1145] LOG: starting PostgreSQL 15.18 (Debian 15.18-1.pgdg12+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14+deb12u1) 12.2.0, 64-bit
2026-08-03 09:02:47.643 UTC [1145] LOG: listening on IPv6 address "::1", port 5432
2026-08-03 09:02:47.644 UTC [1145] LOG: listening on IPv4 address "127.0.0.1", port 5432
2026-08-03 09:02:47.647 UTC [1145] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2026-08-03 09:02:47.664 UTC [1148] LOG: database system was interrupted; last known up at 2026-08-03 08:59:02 UTC
2026-08-03 09:02:48.205 UTC [1148] LOG: database system was not properly shut down; automatic recovery in progress
2026-08-03 09:02:48.212 UTC [1148] LOG: invalid record length at 12/F5C779B0: wanted 24, got 0
2026-08-03 09:02:48.213 UTC [1148] LOG: redo is not required
2026-08-03 09:02:48.218 UTC [1146] LOG: checkpoint starting: end-of-recovery immediate wait
2026-08-03 09:02:48.230 UTC [1146] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.004 s, sync=0.002 s, total=0.013 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB
2026-08-03 09:02:48.252 UTC [1145] LOG: database system is ready to accept connections
done
server started
pg_dump: error: -j/--jobs must be in range 1..2147483647
-------------------------------------------------------------------------------------
UPGRADE OF POSTGRES FAILED
Failed on: su postgres -c "/usr/lib/postgresql/${PG_MAJOR_OLD}/bin/pg_dump -Fd -j$(($(nproc) - 1)) discourse -f /shared/postgres_dump/discourse"
Please visit https://meta.discourse.org/t/postgresql-18-update/406194 for support.
You can run ./launcher start app to restart your app in the meantime
-------------------------------------------------------------------------------------
FAILED
--------------------
Pups::ExecError: 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
failed with return #<Process::Status: pid 18 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.4.0/gems/pups-1.4.0/lib/pups/exec_command.rb:138:in 'Pups::ExecCommand#spawn'
exec failed with the params {"tag" => "db", "cmd" => "if [ -f /root/install_postgres ]; then\n /root/install_postgres && rm -f /root/install_postgres\nelif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then\n socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1\nfi\n"}
bootstrap failed with exit code 1
---
HINT: The plugin 'discourse-calendar' is now bundled with Discourse and should not be included in your container configuration.
Remove the line 'git clone https://github.com/discourse/discourse-calendar' from your containers/app.yml file, then try again.
For more information, see https://meta.discourse.org/t/373574
---
---
HINT: The plugin 'discourse-templates' is now bundled with Discourse and should not be included in your container configuration.
Remove the line 'git clone https://github.com/discourse/discourse-templates' from your containers/app.yml file, then try again.
For more information, see https://meta.discourse.org/t/373574
---
---
HINT: The plugin 'discourse-policy' is now bundled with Discourse and should not be included in your container configuration.
Remove the line 'git clone https://github.com/discourse/discourse-policy' from your containers/app.yml file, then try again.
For more information, see https://meta.discourse.org/t/373574
---
** 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.
d2f4b0c8ce1d67917f88c87da7d3fd8886b2b3c93800e30ae6d8ceeeb131a419
이것은 위와 동일한 오류이며 그 위의 게시물과도 같습니다. @Nacho_Caballero의 제안에 따라 ./templates/web.template.yml을 편집하여 210번째 줄을 변경해 보았습니다:
- exec:
cd: $home
tag: build
hook: bundle_exec
cmd:
# - su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'
- su discourse -c 'bundle install --jobs $(( $(nproc) > 1 ? $(nproc) - 1 : 1 )) --retry 3'
- su discourse -c 'bundle clean'
- su discourse -c 'find /var/www/discourse/vendor/bundle -name cache -not -path "*/gems/*" -type d -exec rm -rf {} +'
- su discourse -c 'find /var/www/discourse/vendor/bundle -name tmp -type d -exec rm -rf {} +'
하지만 실패하여 다시 다음과 같이 편집했습니다:
- exec:
cd: $home
tag: build
hook: bundle_exec
cmd:
# - su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'
# - su discourse -c 'bundle install --jobs $(( $(nproc) > 1 ? $(nproc) - 1 : 1 )) --retry 3'
- su discourse -c 'bundle install --jobs 1 --retry 3'
- su discourse -c 'bundle clean'
- su discourse -c 'find /var/www/discourse/vendor/bundle -name cache -not -path "*/gems/*" -type d -exec rm -rf {} +'
- su discourse -c 'find /var/www/discourse/vendor/bundle -name tmp -type d -exec rm -rf {} +'
하지만 여전히 다음과 같은 오류가 발생했습니다:
pg_dump: error: -j/--jobs must be in range 1..2147483647
-------------------------------------------------------------------------------------
UPGRADE OF POSTGRES FAILED
Failed on: su postgres -c "/usr/lib/postgresql/${PG_MAJOR_OLD}/bin/pg_dump -Fd -j$(($(nproc) - 1)) discourse -f /shared/postgres_dump/discourse"
Please visit https://meta.discourse.org/t/postgresql-18-update/406194 for support.
You can run ./launcher start app to restart your app in the meantime
-------------------------------------------------------------------------------------
여러 파일을 편집해야 하기 때문입니다:
grep -l nproc templates/*.yml
templates/postgres.18.template.yml
templates/postgres.template.yml
templates/web.template.yml
세 파일 모두를 vim으로 열고 nproc을 검색하십시오:
vim $(grep -l nproc templates/*.yml|xargs)
templates/postgres.18.template.yml의 154번과 160번 줄:
# su postgres -c "/usr/lib/postgresql/${PG_MAJOR_OLD}/bin/pg_dump -Fd -j$(($(nproc) - 1)) discourse -f /shared/postgres_dump/discourse"
su postgres -c "/usr/lib/postgresql/${PG_MAJOR_OLD}/bin/pg_dump -Fd -j1) discourse -f /shared/postgres_dump/discourse"
# su postgres -c "/usr/lib/postgresql/18/bin/pg_restore -e -j$(($(nproc) - 1)) -d discourse /shared/postgres_dump/discourse"
su postgres -c "/usr/lib/postgresql/18/bin/pg_restore -e -j1 -d discourse /shared/postgres_dump/discourse"
그리고 templates/postgres.template.yml의 155번과 161번 줄:
# su postgres -c "/usr/lib/postgresql/${PG_MAJOR_OLD}/bin/pg_dump -Fd -j$(($(nproc) - 1)) discourse -f /shared/postgres_dump/discourse"
su postgres -c "/usr/lib/postgresql/${PG_MAJOR_OLD}/bin/pg_dump -Fd -j1 discourse -f /shared/postgres_dump/discourse"
# su postgres -c "/usr/lib/postgresql/18/bin/pg_restore -e -j$(($(nproc) - 1)) -d discourse /shared/postgres_dump/discourse"
su postgres -c "/usr/lib/postgresql/18/bin/pg_restore -e -j1 -d discourse /shared/postgres_dump/discourse"
그리고 templates/web.template.yml의 209번 줄:
# - su discourse -c 'bundle install --jobs $(($(nproc) - 1)) --retry 3'
- su discourse -c 'bundle install --jobs 1 --retry 3'
그리고 나서 모든 것이 정상 작동했습니다.
그러나 어떤 서버에서는 다음과 같은 루프에 빠졌습니다:
x86_64 arch detected.
Ensuring launcher is up to date
Updating Launcher...
Updating 0949304..7de2cf5
error: Your local changes to the following files would be overwritten by merge:
templates/postgres.18.template.yml
templates/postgres.template.yml
Please commit your changes or stash them before you merge.
Aborting
따라서 편집 내용을 stash하고, 코드를 업데이트한 후, ./launcher rebuild app을 다시 시도하기 전에 편집 내용을 다시 적용했습니다:
git stash
git pull
git stash drop
한 서버에서는 다음과 같은 상황이 발생했습니다:
-------------------------------------------------------------------------------------
WARNING: Upgrading PostgreSQL would require an additional 896M of disk space
Please free up some space, or expand your disk, before continuing.
To avoid upgrading change "templates/postgres.template.yml" TO "templates/postgres.15.template.yml" in containers/app.yml
You can run "./launcher start app" to restart your app in the meanwhile.
-------------------------------------------------------------------------------------
따라서 다시 시도하기 전에 디스크를 확장해야 했습니다.
이 문제를 해결하는 데 도움을 주신 @Nacho_Caballero님과 @Ivan_Rapekas님께 감사드립니다 
업데이트
PostgreSQL 템플릿 파일은 이제 @chrisr님에 의해 수정되었습니다. 감사합니다! 따라서 위에서 제가 한 변경 사항을 되돌리기 위해 다음을 실행했습니다:
git stash
git pull
git stash drop