locale -a missing on Alpine Linux?

Started by Peter Eisentrautabout 3 years ago6 messages
#1Peter Eisentraut
peter.eisentraut@enterprisedb.com

Since 2fe3bdbd691a, initdb has been failing on malleefowl:

performing post-bootstrap initialization ... sh: locale: not found
2022-11-15 23:48:44.288 EST [10436] FATAL: could not execute command
"locale -a": command not found
2022-11-15 23:48:44.288 EST [10436] STATEMENT: SELECT
pg_import_system_collations('pg_catalog');

That's precisely the kind of thing this patch was supposed to catch, but
obviously it's not good that initdb is now failing.

First of all, is this a standard installation of this OS, or is perhaps
something incomplete, broken, or unusual about the current OS installation?

#2Christoph Moench-Tegeder
cmt@burggraben.net
In reply to: Peter Eisentraut (#1)
Re: locale -a missing on Alpine Linux?

## Peter Eisentraut (peter.eisentraut@enterprisedb.com):

First of all, is this a standard installation of this OS, or is perhaps
something incomplete, broken, or unusual about the current OS installation?

Alpine uses musl libc, on which you need package musl-locales to get
a /usr/bin/locale.
https://pkgs.alpinelinux.org/package/edge/community/x86/musl-locales
https://musl.libc.org/

Regards,
Christoph

--
Spare Space

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Christoph Moench-Tegeder (#2)
Re: locale -a missing on Alpine Linux?

Christoph Moench-Tegeder <cmt@burggraben.net> writes:

## Peter Eisentraut (peter.eisentraut@enterprisedb.com):

First of all, is this a standard installation of this OS, or is perhaps
something incomplete, broken, or unusual about the current OS installation?

Alpine uses musl libc, on which you need package musl-locales to get
a /usr/bin/locale.
https://pkgs.alpinelinux.org/package/edge/community/x86/musl-locales

Ah. And that also shows that if you didn't install that package,
you don't have any locales either, except presumably C/POSIX.

So probably we should treat failure of the locale command as okay
and just press on with no non-built-in locales.

regards, tom lane

#4Peter Eisentraut
peter.eisentraut@enterprisedb.com
In reply to: Tom Lane (#3)
Re: locale -a missing on Alpine Linux?

On 16.11.22 20:25, Tom Lane wrote:

Christoph Moench-Tegeder <cmt@burggraben.net> writes:

## Peter Eisentraut (peter.eisentraut@enterprisedb.com):

First of all, is this a standard installation of this OS, or is perhaps
something incomplete, broken, or unusual about the current OS installation?

Alpine uses musl libc, on which you need package musl-locales to get
a /usr/bin/locale.
https://pkgs.alpinelinux.org/package/edge/community/x86/musl-locales

Ah. And that also shows that if you didn't install that package,
you don't have any locales either, except presumably C/POSIX.

So probably we should treat failure of the locale command as okay
and just press on with no non-built-in locales.

That's basically what we had before, so I have just reverted that part
of my original patch.

#5Andrew Dunstan
andrew@dunslane.net
In reply to: Tom Lane (#3)
Re: locale -a missing on Alpine Linux?

On 2022-11-16 We 14:25, Tom Lane wrote:

Christoph Moench-Tegeder <cmt@burggraben.net> writes:

## Peter Eisentraut (peter.eisentraut@enterprisedb.com):

First of all, is this a standard installation of this OS, or is perhaps
something incomplete, broken, or unusual about the current OS installation?

Alpine uses musl libc, on which you need package musl-locales to get
a /usr/bin/locale.
https://pkgs.alpinelinux.org/package/edge/community/x86/musl-locales

Ah. And that also shows that if you didn't install that package,
you don't have any locales either, except presumably C/POSIX.

So probably we should treat failure of the locale command as okay
and just press on with no non-built-in locales.

malleefowl is a docker instance (mostly docker images is what Alpine is
used for). It would be extremely easy to recreate the image and add in
musl-locales, but maybe we should just leave it as it is to test the
case where the command isn't available.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andrew Dunstan (#5)
Re: locale -a missing on Alpine Linux?

Andrew Dunstan <andrew@dunslane.net> writes:

malleefowl is a docker instance (mostly docker images is what Alpine is
used for). It would be extremely easy to recreate the image and add in
musl-locales, but maybe we should just leave it as it is to test the
case where the command isn't available.

Agreed, leave it as-is.

regards, tom lane