Database files are incompatible with server


(Camille Roux) #1

Hi!

I’m getting the following error when I running ./launcher rebuild app

I, [2016-05-26T21:01:54.949877 #20]  INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.5/bin/postmaster -D /etc/postgresql/9.5/main
I, [2016-05-26T21:01:54.953219 #20]  INFO -- : > sleep 5
LOG:  skipping missing configuration file "/shared/postgres_data/postgresql.auto.conf"
2016-05-26 21:01:55 UTC [55-2] FATAL:  database files are incompatible with server
2016-05-26 21:01:55 UTC [55-3] DETAIL:  The data directory was initialized by PostgreSQL version 9.3, which is not compatible with this version 9.5.3.
I, [2016-05-26T21:01:59.963014 #20]  INFO -- :
I, [2016-05-26T21:01:59.963774 #20]  INFO -- : > su postgres -c 'createdb discourse' || true
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "fr_FR.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
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, [2016-05-26T21:02:00.198683 #20]  INFO -- :
I, [2016-05-26T21:02:00.199875 #20]  INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "fr_FR.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
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, [2016-05-26T21:02:00.396258 #20]  INFO -- :
I, [2016-05-26T21:02:00.397433 #20]  INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "fr_FR.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
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, [2016-05-26T21:02:00.572012 #20]  INFO -- :
I, [2016-05-26T21:02:00.572989 #20]  INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "fr_FR.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
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, [2016-05-26T21:02:00.784738 #20]  INFO -- :
I, [2016-05-26T21:02:00.787512 #20]  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 81 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;\"'"
155a2e51ecdfd149b6daa9b1ca4cfb0b58044f5ef52f284e16bbb8e56f1e4b18
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

I’m currently the template for pg 9.3 to make it work


(Felix Freiberger) #2

I ran into the same issue:

Something is up here. My install was using a non-default locale, too.


(William Di Luigi) #3

Same error here with LANG=it_IT.UTF-8


(Felix Freiberger) #4

Try going back to the default language. Do you get a different error?


(Nukeador) #5

Hi, same problem here.

My containers/app.yml had LANG=es_ES.UTF-8.

How did I solve it?

  • Change locale to LANG=en_US.UTF-8
  • ./launcher rebuild app
  • Postgres is updated correctly
  • Change back to LANG=es_ES.UTF-8
  • Do ./launcher rebuild app again

Is this a bug with locales you have on the server but not available inside the docker image?


Bootstrap failure due to lack of locales in container
#6

I’m getting the same issue: Bootstrap failure due to lack of locales in container

Will try the workaround but since I automate things it will be painful to manage


#7

So, it seems that this is not related to my issue after all. This issue is related to Postgresql 9.3 > 9.5 upgrade. My issue instead is related to the container locales… sorry for the noise. :grin:


(Nukeador) #8

Is this something already on track on the list of bugs? It seems more people are having troubles with this.


(Andrey) #10

facing this problem with ru_RU locale


(Mittineague) #11

This is a problem different from your other post?


(Andrey) #12

They are related.
Tried to change LANG to ru_RU and rebuild app
…and got those warnings perl: warning: Please check that your locale settings:


#13

Same issue here, with warnings related to fr locale and psql connection error.

Anyone has a status / update / info on how to fix it ?

Thank you

EDIT: Ok got the answer in another topic, problem fixed:

There is appearently an issue related to upgrading when having a ‘custom’ locale…