UTC [83] FATAL: configuration file “/etc/postgresql/9.5/main/postgresql.conf” contains errors

unsupported-install

(Tumi) #1

Hello . I was think its all ok and i was mega happy but NO , not yet :smiley:

This is from terminal:

> Already up-to-date.
> I, [2017-12-22T13:00:12.317668 #13]  INFO -- : Loading --stdin
> I, [2017-12-22T13:00:12.323458 #13]  INFO -- : > mkdir -p /shared/postgres_run
> I, [2017-12-22T13:00:12.336627 #13]  INFO -- :
> I, [2017-12-22T13:00:12.337106 #13]  INFO -- : > chown postgres:postgres /shared/postgres_run
> I, [2017-12-22T13:00:12.386537 #13]  INFO -- :
> I, [2017-12-22T13:00:12.387049 #13]  INFO -- : > chmod 775 /shared/postgres_run
> I, [2017-12-22T13:00:12.389418 #13]  INFO -- :
> I, [2017-12-22T13:00:12.389737 #13]  INFO -- : > rm -fr /var/run/postgresql
> I, [2017-12-22T13:00:12.392340 #13]  INFO -- :
> I, [2017-12-22T13:00:12.392679 #13]  INFO -- : > ln -s /shared/postgres_run /var/run/postgresql
> I, [2017-12-22T13:00:12.437103 #13]  INFO -- :
> I, [2017-12-22T13:00:12.437499 #13]  INFO -- : > socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running     stop container ; exit 1
> 2017/12/22 13:00:12 socat[21] E connect(6, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): No such file or directory
> I, [2017-12-22T13:00:13.035452 #13]  INFO -- :
> I, [2017-12-22T13:00:13.036017 #13]  INFO -- : > rm -fr /shared/postgres_run/.s*
> I, [2017-12-22T13:00:13.038472 #13]  INFO -- :
> I, [2017-12-22T13:00:13.038949 #13]  INFO -- : > rm -fr /shared/postgres_run/*.pid
> I, [2017-12-22T13:00:13.040694 #13]  INFO -- :
> I, [2017-12-22T13:00:13.041019 #13]  INFO -- : > mkdir -p /shared/postgres_run/9.5-main.pg_stat_tmp
> I, [2017-12-22T13:00:13.042900 #13]  INFO -- :
> I, [2017-12-22T13:00:13.043268 #13]  INFO -- : > chown postgres:postgres /shared/postgres_run/9.5-main.pg_stat_tmp
> I, [2017-12-22T13:00:13.044726 #13]  INFO -- :
> I, [2017-12-22T13:00:13.047651 #13]  INFO -- : File > /etc/service/postgres/run  chmod: +x
> I, [2017-12-22T13:00:13.050449 #13]  INFO -- : File > /etc/runit/3.d/99-postgres  chmod: +x
> I, [2017-12-22T13:00:13.053097 #13]  INFO -- : File > /root/upgrade_postgres  chmod: +x
> I, [2017-12-22T13:00:13.053607 #13]  INFO -- : > chown -R root /var/lib/postgresql/9.5/main
> I, [2017-12-22T13:00:46.807963 #13]  INFO -- :
> I, [2017-12-22T13:00:46.808667 #13]  INFO -- : > [ ! -e /shared/postgres_data ] && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo     -E -u postgres /usr/lib/postgresql/9.5/bin/initdb -D /shared/postgres_data || exit 0
> 
> WARNING: enabling "trust" authentication for local connections
> 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.
> I, [2017-12-22T13:01:09.907790 #13]  INFO -- : 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_US.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 ... ok
> creating subdirectories ... ok
> selecting default max_connections ... 100
> selecting default shared_buffers ... 128MB
> selecting dynamic shared memory implementation ... posix
> creating configuration files ... ok
> creating template1 database in /shared/postgres_data/base/1 ... ok
> initializing pg_authid ... ok
> initializing dependencies ... ok
> creating system views ... ok
> loading system objects' descriptions ... ok
> creating collations ... ok
> creating conversions ... ok
> creating dictionaries ... ok
> setting privileges on built-in objects ... ok
> creating information schema ... ok
> loading PL/pgSQL server-side language ... ok
> vacuuming database template1 ... ok
> copying template1 to template0 ... ok
> copying template1 to postgres ... ok
> syncing data to disk ... ok
> 
> Success. You can now start the database server using:
> 
>     /usr/lib/postgresql/9.5/bin/pg_ctl -D /shared/postgres_data -l logfile start
> 
> 
> I, [2017-12-22T13:01:09.908294 #13]  INFO -- : > chown -R postgres:postgres /shared/postgres_data
> I, [2017-12-22T13:01:09.913023 #13]  INFO -- :
> I, [2017-12-22T13:01:09.913294 #13]  INFO -- : > chown -R postgres:postgres /var/run/postgresql
> I, [2017-12-22T13:01:09.914904 #13]  INFO -- :
> I, [2017-12-22T13:01:09.915405 #13]  INFO -- : > /root/upgrade_postgres
> I, [2017-12-22T13:01:09.922011 #13]  INFO -- :
> I, [2017-12-22T13:01:09.922148 #13]  INFO -- : > rm /root/upgrade_postgres
> I, [2017-12-22T13:01:09.923561 #13]  INFO -- :
> I, [2017-12-22T13:01:09.935796 #13]  INFO -- : Replacing data_directory = '/var/lib/postgresql/9.5/main' with data_directory = '/shared/postgres_data' in /e    tc/postgresql/9.5/main/postgresql.conf
> I, [2017-12-22T13:01:09.936458 #13]  INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/9.5/main/postgresql.    conf
> I, [2017-12-22T13:01:09.937059 #13]  INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgres    ql/9.5/main/postgresql.conf
> I, [2017-12-22T13:01:09.937693 #13]  INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/9.5/main/    postgresql.conf
> I, [2017-12-22T13:01:09.938139 #13]  INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/9.5/main/postgresql.conf
> I, [2017-12-22T13:01:09.938725 #13]  INFO -- : Replacing (?-mix:#?default_text_search_config *=.*) with default_text_search_config = '$db_default_text_searc    h_config' in /etc/postgresql/9.5/main/postgresql.conf
> I, [2017-12-22T13:01:09.939137 #13]  INFO -- : > install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
> I, [2017-12-22T13:01:09.940865 #13]  INFO -- :
> I, [2017-12-22T13:01:09.941298 #13]  INFO -- : Replacing (?-mix:#?max_wal_senders *=.*) with max_wal_senders = $db_max_wal_senders in /etc/postgresql/9.5/ma    in/postgresql.conf
> I, [2017-12-22T13:01:09.985283 #13]  INFO -- : Replacing (?-mix:#?wal_level *=.*) with wal_level = $db_wal_level in /etc/postgresql/9.5/main/postgresql.conf
> I, [2017-12-22T13:01:09.985867 #13]  INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postg    resql/9.5/main/postgresql.conf
> I, [2017-12-22T13:01:09.986271 #13]  INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/    9.5/main/postgresql.conf
> I, [2017-12-22T13:01:09.987022 #13]  INFO -- : Replacing (?-mix:#?log_min_duration_statement *=.*) with log_min_duration_statement = $db_log_min_duration_st    atement in /etc/postgresql/9.5/main/postgresql.conf
> I, [2017-12-22T13:01:09.987708 #13]  INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres  peer in /etc/postgre    sql/9.5/main/pg_hba.conf
> I, [2017-12-22T13:01:09.988084 #13]  INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/9.5/main/pg_hba.    conf
> I, [2017-12-22T13:01:09.988661 #13]  INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-ce    rt /usr/lib/postgresql/9.5/bin/postmaster -D /etc/postgresql/9.5/main
> I, [2017-12-22T13:01:09.990125 #13]  INFO -- : > sleep 5
> LOG:  0 is outside the valid range for parameter "shared_buffers" (16 .. 1073741823)
> 2017-12-22 13:01:10.049 UTC [83] FATAL:  configuration file "/etc/postgresql/9.5/main/postgresql.conf" contains errors
> I, [2017-12-22T13:01:15.040397 #13]  INFO -- :
> I, [2017-12-22T13:01:15.040609 #13]  INFO -- : > su postgres -c 'createdb discourse' || true
> createdb: could not connect to database template1: could not connect to server: No such file or directory
>         Is the server running locally and accepting
>         connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
> I, [2017-12-22T13:01:15.841364 #13]  INFO -- :
> I, [2017-12-22T13:01:15.841746 #13]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
> psql: could not connect to server: No such file or directory
>         Is the server running locally and accepting
>         connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
> I, [2017-12-22T13:01:16.236829 #13]  INFO -- :
> I, [2017-12-22T13:01:16.237220 #13]  INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
> psql: could not connect to server: No such file or directory
>         Is the server running locally and accepting
>         connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
> I, [2017-12-22T13:01:16.285438 #13]  INFO -- :
> I, [2017-12-22T13:01:16.285877 #13]  INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
> psql: could not connect to server: No such file or directory
>         Is the server running locally and accepting
>         connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
> I, [2017-12-22T13:01:16.333852 #13]  INFO -- :
> I, [2017-12-22T13:01:16.334299 #13]  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 109 exit 2>
> Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
> exec failed with the params "su postgres -c 'psql $db_name -c \"alter schema public owner to $db_user;\"'"
> ba599d5a146a5773965191aea5bae886b3b9dca2afe21f165c5faec664b0ca9d
> ** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

(Michael Brown) #2

Right there :arrow_double_up:, related to your modified install script setting these:


(Michael Brown) #3

A post was merged into an existing topic: Found 0GB of memory and 1 physical CPU cores HOW?


(Tumi) #4

Really? I have just add only double ## before exit 1 ???
And i have 908 Mb this is not really low.


(Mittineague) #5

In terms of Discourse, it is too low. You will really want to at least meet the minimum requirements. Otherwise you will experience pain. Files getting corrupted by incomplete writes, crucial processes not running, etc. who knows all the possible problems that could happen.

IMHO, if there is anything that should be done by Discourse, if possible, it would be to output an error message before attempting any of the latter installation. Fail Fast.


(Tumi) #6

Ok guys thanks for “help” this time :smiley:

As a total noob i found a solution :smiley:
just change eq to le (db shared buffers)
and 2* Memory to to 2*1 (Unicorn Workers)
:smiley:

Now the problem is (or no)

using stale statistics instead of current ones because stats collector is not responding


(Matt Palmer) #7

It does. The OP removed the safeties on the script.


(Tumi) #8
 Redis is now ready to exit, bye bye...
 [46] LOG:  database system is shut down

and there is stop. hmn any advice ? :slight_smile:

It is really close to finish it !