[Pkg-postgresql-public] Bug#791526: Bug#791526: Bug#791526: postgresql-9.4: postgresql needs locales-all to create cluster on install

Malte malte at wk3.org
Thu Sep 3 12:23:21 UTC 2015


Hi,


first off: unsetting LC_ALL ("unset LC_ALL") seems to have created a 
disturbance in the force and de_DE.UTF-8 slipped in the locale settings. WTF? 
The only thing that I ever tell my servers about german is the keyboard 
layout...


On Monday 31 August 2015 21:30 Christoph Berg wrote:

> You seem to explicitly have LC_ALL set in the environment (note
> there's no "quotes" around the value).

All I ever did was to run "dpkg-reconfigure locales", only select "en_US.UTF-8 
UTF-8" and select it as "default locale" at the end of the dialog.

> While this shouldn't cause any
> problems, it's not the supposed default setup; you should set LANG and
> possibly selected LC_* entries, and only set LC_ALL to override all
> other settings to run individual commands.

Then I don't know what the default setup is. I'm reporting against Debian 
jessie, but I had Postgres-Installations failing all over the place, Debian 
wheezy included (although there it worked with apt-get install, but not with 
aptitude... might be a different issue).


> That said, could you retry with LC_ALL unset?

Ok. Once again:

###
# locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=

###
# cat /etc/default/locale
#  File generated by update-locale
LANG=en_US.UTF-8

###
# apt-get install postgresql-9.4                                                                      
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  cron libpopt0 libpq5 logrotate lsb-release postgresql-client-9.4 postgresql-
client-common postgresql-common ucf
Suggested packages:
  anacron checksecurity lsb oidentd ident-server locales-all postgresql-
doc-9.4
The following NEW packages will be installed:
  cron libpopt0 libpq5 logrotate lsb-release postgresql-9.4 postgresql-
client-9.4 postgresql-client-common
  postgresql-common ucf
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 3702 kB/5462 kB of archives.
After this operation, 25.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://http.debian.net/debian/ jessie/main postgresql-9.4 amd64 
9.4.3-0+deb8u1 [3702 kB]
Fetched 3702 kB in 18s (205 kB/s)                                                                                    
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "de_DE.UTF-8",
        LC_MONETARY = "de_DE.UTF-8",
        LC_ADDRESS = "de_DE.UTF-8",
        LC_TELEPHONE = "de_DE.UTF-8",
        LC_NAME = "de_DE.UTF-8",
        LC_MEASUREMENT = "de_DE.UTF-8",
        LC_IDENTIFICATION = "de_DE.UTF-8",
        LC_NUMERIC = "de_DE.UTF-8",
        LC_PAPER = "de_DE.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_ALL to default locale: No such file or directory
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package cron.
(Reading database ... 17149 files and directories currently installed.)
Preparing to unpack .../cron_3.0pl1-127_amd64.deb ...
Unpacking cron (3.0pl1-127) ...
Selecting previously unselected package libpopt0:amd64.
Preparing to unpack .../libpopt0_1.16-10_amd64.deb ...
Unpacking libpopt0:amd64 (1.16-10) ...
Selecting previously unselected package libpq5:amd64.
Preparing to unpack .../libpq5_9.4.3-0+deb8u1_amd64.deb ...
Unpacking libpq5:amd64 (9.4.3-0+deb8u1) ...
Selecting previously unselected package logrotate.
Preparing to unpack .../logrotate_3.8.7-1+b1_amd64.deb ...
Unpacking logrotate (3.8.7-1+b1) ...
Selecting previously unselected package ucf.
Preparing to unpack .../archives/ucf_3.0030_all.deb ...
Moving old data out of the way
Unpacking ucf (3.0030) ...
Selecting previously unselected package lsb-release.
Preparing to unpack .../lsb-release_4.1+Debian13+nmu1_all.deb ...
Unpacking lsb-release (4.1+Debian13+nmu1) ...
Selecting previously unselected package postgresql-client-common.
Preparing to unpack .../postgresql-client-common_165_all.deb ...
Unpacking postgresql-client-common (165) ...
Selecting previously unselected package postgresql-client-9.4.
Preparing to unpack .../postgresql-client-9.4_9.4.3-0+deb8u1_amd64.deb ...
Unpacking postgresql-client-9.4 (9.4.3-0+deb8u1) ...
Selecting previously unselected package postgresql-common.
Preparing to unpack .../postgresql-common_165_all.deb ...
Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by 
postgresql-common'
Unpacking postgresql-common (165) ...
Selecting previously unselected package postgresql-9.4.
Preparing to unpack .../postgresql-9.4_9.4.3-0+deb8u1_amd64.deb ...
Unpacking postgresql-9.4 (9.4.3-0+deb8u1) ...
Processing triggers for systemd (215-17+deb8u1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up cron (3.0pl1-127) ...
update-rc.d: warning: start and stop actions are no longer supported; falling 
back to defaults
Setting up libpopt0:amd64 (1.16-10) ...
Setting up libpq5:amd64 (9.4.3-0+deb8u1) ...
Setting up logrotate (3.8.7-1+b1) ...
Setting up ucf (3.0030) ...
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up lsb-release (4.1+Debian13+nmu1) ...
Setting up postgresql-client-common (165) ...
Setting up postgresql-client-9.4 (9.4.3-0+deb8u1) ...
update-alternatives: using /usr/share/postgresql/9.4/man/man1/psql.1.gz to 
provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode
Setting up postgresql-common (165) ...
locale: Cannot set LC_ALL to default locale: No such file or directory

Creating config file /etc/postgresql-common/createcluster.conf with new 
version

Creating config file /etc/logrotate.d/postgresql-common with new version
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
Setting up postgresql-9.4 (9.4.3-0+deb8u1) ...
Error: The locale requested by the environment is invalid.
Error: could not create default cluster. Please create it manually with

  pg_createcluster 9.4 main --start

or a similar command (see 'man pg_createcluster').
update-alternatives: using /usr/share/postgresql/9.4/man/man1/postmaster.1.gz 
to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
Processing triggers for libc-bin (2.19-18) ...
Processing triggers for systemd (215-17+deb8u1) ...

###
# aptitude install postgresql-9.4
The following NEW packages will be installed:
  cron{a} libpopt0{a} libpq5{a} logrotate{a} lsb-release{a} postgresql-9.4 
postgresql-client-9.4{a} 
  postgresql-client-common{a} postgresql-common{a} ucf{a} 
0 packages upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/5462 kB of archives. After unpacking 25.2 MB will be used.
Do you want to continue? [Y/n/?] 
perl: warning: Setting locale failed.    
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_TIME = "de_DE.UTF-8",
        LC_MONETARY = "de_DE.UTF-8",
        LC_ADDRESS = "de_DE.UTF-8",
        LC_TELEPHONE = "de_DE.UTF-8",
        LC_NAME = "de_DE.UTF-8",
        LC_MEASUREMENT = "de_DE.UTF-8",
        LC_IDENTIFICATION = "de_DE.UTF-8",
        LC_NUMERIC = "de_DE.UTF-8",
        LC_PAPER = "de_DE.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_ALL to default locale: No such file or directory
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package cron.
(Reading database ... 17149 files and directories currently installed.)
Preparing to unpack .../cron_3.0pl1-127_amd64.deb ...
Unpacking cron (3.0pl1-127) ...
Selecting previously unselected package libpopt0:amd64.
Preparing to unpack .../libpopt0_1.16-10_amd64.deb ...
Unpacking libpopt0:amd64 (1.16-10) ...
Selecting previously unselected package libpq5:amd64.
Preparing to unpack .../libpq5_9.4.3-0+deb8u1_amd64.deb ...
Unpacking libpq5:amd64 (9.4.3-0+deb8u1) ...
Selecting previously unselected package logrotate.
Preparing to unpack .../logrotate_3.8.7-1+b1_amd64.deb ...
Unpacking logrotate (3.8.7-1+b1) ...
Selecting previously unselected package ucf.
Preparing to unpack .../archives/ucf_3.0030_all.deb ...
Moving old data out of the way
Unpacking ucf (3.0030) ...
Selecting previously unselected package lsb-release.
Preparing to unpack .../lsb-release_4.1+Debian13+nmu1_all.deb ...
Unpacking lsb-release (4.1+Debian13+nmu1) ...
Selecting previously unselected package postgresql-client-common.
Preparing to unpack .../postgresql-client-common_165_all.deb ...
Unpacking postgresql-client-common (165) ...
Selecting previously unselected package postgresql-client-9.4.
Preparing to unpack .../postgresql-client-9.4_9.4.3-0+deb8u1_amd64.deb ...
Unpacking postgresql-client-9.4 (9.4.3-0+deb8u1) ...
Selecting previously unselected package postgresql-common.
Preparing to unpack .../postgresql-common_165_all.deb ...
Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by 
postgresql-common'
Unpacking postgresql-common (165) ...
Selecting previously unselected package postgresql-9.4.
Preparing to unpack .../postgresql-9.4_9.4.3-0+deb8u1_amd64.deb ...
Unpacking postgresql-9.4 (9.4.3-0+deb8u1) ...
Processing triggers for systemd (215-17+deb8u1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up cron (3.0pl1-127) ...
update-rc.d: warning: start and stop actions are no longer supported; falling 
back to defaults
Setting up libpopt0:amd64 (1.16-10) ...
Setting up libpq5:amd64 (9.4.3-0+deb8u1) ...
Setting up logrotate (3.8.7-1+b1) ...
Setting up ucf (3.0030) ...
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up lsb-release (4.1+Debian13+nmu1) ...
Setting up postgresql-client-common (165) ...
Setting up postgresql-client-9.4 (9.4.3-0+deb8u1) ...
update-alternatives: using /usr/share/postgresql/9.4/man/man1/psql.1.gz to 
provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode
Setting up postgresql-common (165) ...
locale: Cannot set LC_ALL to default locale: No such file or directory

Creating config file /etc/postgresql-common/createcluster.conf with new 
version

Creating config file /etc/logrotate.d/postgresql-common with new version
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
Setting up postgresql-9.4 (9.4.3-0+deb8u1) ...
Error: The locale requested by the environment is invalid.
Error: could not create default cluster. Please create it manually with

  pg_createcluster 9.4 main --start

or a similar command (see 'man pg_createcluster').
update-alternatives: using /usr/share/postgresql/9.4/man/man1/postmaster.1.gz 
to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
Processing triggers for libc-bin (2.19-18) ...
Processing triggers for systemd (215-17+deb8u1) ...


> > ###
> > # apt-get install postgresql-9.4
> > Setting up postgresql-9.4 (9.4.3-0+deb8u1) ...
> > Error: The locale requested by the environment is invalid.
> > Error: could not create default cluster. Please create it manually with
> > 
> >   pg_createcluster 9.4 main --start
> 
> The first error is from pg_createcluster:
> 
> # check validity of locale
> unless (setlocale (LC_ALL, "")) {
>     error ('The locale requested by the environment is invalid.')
> }
> 
> ... which means your locales aren't properly set up (even if "locale"
> doesn't print any warning).
> 
> Does the pg_createcluster command work when you try it manually? Which
> locale does the created cluster get (show the output of "psql -l")?

No.

###
# pg_createcluster 9.4 main --start
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_PAPER = "de_DE.UTF-8",
        LC_ADDRESS = "de_DE.UTF-8",
        LC_MONETARY = "de_DE.UTF-8",
        LC_NUMERIC = "de_DE.UTF-8",
        LC_TELEPHONE = "de_DE.UTF-8",
        LC_IDENTIFICATION = "de_DE.UTF-8",
        LC_MEASUREMENT = "de_DE.UTF-8",
        LC_TIME = "de_DE.UTF-8",
        LC_NAME = "de_DE.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
Error: The locale requested by the environment is invalid.



On Tuesday 01 September 2015 06:38 Martin Pitt wrote:

> Malte [2015-07-07 19:41 +0200]:
> > ###
> > # locale
> > LANG=en_US.UTF-8
> > LANGUAGE=
> > LC_CTYPE="en_US.UTF-8"
> > LC_NUMERIC="en_US.UTF-8"
> > LC_TIME="en_US.UTF-8"
> > LC_COLLATE="en_US.UTF-8"
> > LC_MONETARY="en_US.UTF-8"
> > LC_MESSAGES="en_US.UTF-8"
> > LC_PAPER="en_US.UTF-8"
> > LC_NAME="en_US.UTF-8"
> > LC_ADDRESS="en_US.UTF-8"
> > LC_TELEPHONE="en_US.UTF-8"
> > LC_MEASUREMENT="en_US.UTF-8"
> > LC_IDENTIFICATION="en_US.UTF-8"
> > LC_ALL=en_US.UTF-8
> 
> You're sure that there weren't any warnings here? Does "en_US.utf8"
> appear in the output of "locale -a"?

###
# locale -a
C
C.UTF-8
en_US.utf8
POSIX

> If locales-all helps, then your system does not actually have the
> en_US.utf8 locale generated. This commonly happens if you set a locale
> in /etc/default/locale without running "update-locales".

No. Running update-locale did nothing (there is no "update-locales", though).


I don't know. This whole locale business leaves me clueless and usually I'm 
happy when it does not hail "perl: warnings". Maybe I need to move to the US 
(I mean, seriously, where did the "de_DE.UTF-8" come from?)...


Thank you for your efforts, though!


Sincerely,

Malte



More information about the Pkg-postgresql-public mailing list