Domino on Linux/Unix, Troubleshooting, Best Practices, Tips and more ...

 
alt

Daniel Nashed

 

"Locale" issue on Linux CentOS & RHEL

Daniel Nashed  26 October 2019 18:40:14

"Locale" issue on Linux CentOS & RHEL



I ran into this with Domino on Docker. I noticed that the locale settings have not been detected correctly by Domino when running on CentOS with the German locale.

It turned out that this is a more general issue on Docker with other locales than LANG=C or LANG=en_US.UTF-8


There are differences between CentOS/RHEL 7 and the new version 8 where the language support in glibc has changed!


The issue in version 7 only impacts Docker environments. But with the new language handling in CentOS/RHEL8 this also impacts native applications on Linux.


When the locale is broken you see following error messages when checking the "locale".

And the date format is reverted on the Domino server (you will see month/day/year instead of /day/month/year).

export LANG=de_DE.UTF-8

locale

locale: Cannot set LC_CTYPE to default locale: No such file or directory

locale: Cannot set LC_MESSAGES to default locale: No such file or directory

locale: Cannot set LC_ALL to default locale: No such file or directory

LANG=de_DE.UTF-8

LC_CTYPE="de_DE.UTF-8"

LC_NUMERIC="de_DE.UTF-8"

LC_TIME="de_DE.UTF-8"

LC_COLLATE="de_DE.UTF-8"

LC_MONETARY="de_DE.UTF-8"

LC_MESSAGES="de_DE.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=



CentOS 7 / RHEL7


It took a while to figure out why this is happening. And it turned out that for Docker the CentOS base image does only contain English in the glibc package.


There is a setting in /etc/yum.conf which causes that only the English locale is installed -apparently to save a bit of storage (it's not really much..).


The solution is to remove the following line from /etc/yum.conf


override_install_langs=en_US.utf8



Afterwards to reinstall the glibc-common. In some cases that doesn't work and you need to update it instead


yum reinstall -y glibc-common  
or  yum update -y glibc-common

For our Docker project this means we have to change the setting during the Docker build process and than update the glibc-common package.

In CentOS /RHEL 7 this only affects Docker and I have seen the discussion about this issue in the Docker community.
But I didn't find any solution. So I am documenting it in my blog to make it searchable.



CentOS/RHEL 8


With CentOS/RHEL 8 they have completely changed the way language support in glibc is handled.

This does not only affect Domino on Docker but also natively installed.

There is an interesting article about it on the RedHat website:


https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/installing-using-langpacks


They are mentioning a glibc-all-langpacks
which can be used instead of the smaller package glibc-minimal-langpack which is installed by default.

But even when installing this package you don't get all the languages installed. Instead this is the packet which sort of manages the other languages you can install.

There is an alternate solution to install glibc langauge packs (also mentioned in the article) but that's not recommended because it is slower as they say.

Update 12.12.2021: We changed the Docker image to use glibc-langpack-de instead of e.g. langpacks-de.
It turned out that this would be the right package to install. See reference information below.


UBI for example only contains glibc-langpack-en.  No other language and only the glibc language pack.


So the right install line would be the following on CentOS:

yum install -y glibc-langpack-en glibc-langpack-de


It also tuned out that the glibc-all-langpacks is quite big and is not needed.


Only with this combination your locale works as expected and the "locale" command does not complain about missing files.


For Docker we take care about this in the Docker Project.
But this can also hit you on native installed Domino servers!


-- Daniel


Reference information from the package:


Name         : glibc-langpack-en

Version      : 2.28

Release      : 127.el8_3.2

Architecture : x86_64

Size         : 824 k

Source       : glibc-2.28-127.el8_3.2.src.rpm

Repository   : ubi-8-baseos

Summary      : Locale data for en

URL          : http://www.gnu.org/software/glibc/

License      : LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL

Description  : The glibc-langpack-en package includes the basic information required

            : to support the en language in your applications.


Comments

1ZERO SHENGZHONG XIE  08.05.2020 10:28:46   Locale issue on Linux CentOS & RHEL

THANK YOU FOR SHARING THIS BLOG ABOUT LOCALE ISSUE FOR DOCKER IMAGE. IT IS HELPFUL

2Raphael  02.11.2020 19:18:38   Locale issue on Linux CentOS & RHEL

Thank you for sharing a way to solve locale issue, you are a hero :)

3Kjetil Torgrim Homme  14.11.2020 0:34:55   Locale issue on Linux CentOS & RHEL

Thanks, very useful information. It helped me understand it better. I did not expect this to be configured via an RPM macro. I explained my findings in this issue on Github:

https://github.com/saz/puppet-locales/issues/48#issuecomment-727080698

4Chris J  03.12.2020 4:28:48   Locale issue on Linux CentOS & RHEL

Even I installed the package getting the same error

I am trying install Hana Cockpit on AWS EC2 RHEL 8.0 instance.

Installation of SAP HANA Cockpit System failed.

Cannot detect command line options dynamically.

Cannot get external program configuration

Can you please let me know how to resolve.

Thanks !!

Links

    Archives


    • [IBM Lotus Domino]
    • [Domino on Linux]
    • [Nash!Com]
    • [Daniel Nashed]