Locale fails on a SuSE system
The used system is a minimal server with SuSE Leap 42.2 installed. I use RhodeCode-installer-linux-build20170418_2200 to install.
The VCSServer failes to start. See attached server log.
The root cause seems to be a failing "locale.setlocale(locale.LC_ALL, u'')".
On the server I get for locale:
LANG=en_US.UTF-8 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=
If I use the server's python environment I can do:
import locale locale.setlocale(locale.LC_ALL, u'')
As a result I get "en_US.UTF-8"
If I use the python environment from RhodeCode by:
rccontrol ishell comunnity-1
The code snippet will fail with the same error message as in the log.
Probably the python environment shipped with RhodeCode is expecting a different locale setup than what's done in SuSE.
#4 Updated by Boris Basic over 1 year ago
Same problem after upgrading from Ubuntu 16.10 to 18.04 LTS. I tried setting LOCALE_ARCHIVE and LC_ALL in supervisord.ini but it did not fix the problem.
The only solution in my case was to comment out line 30 in /opt/rhodecode/store/hgp03jrdni84hg60af1pw36swfwq3rm4-python2.7-mercurial-4.4.2/lib/python2. 7/site-packages/mercurial/crecord.py.
#11 Updated by Marcin Kuzminski [staff] over 1 year ago
We've identified the problem for now. It looks like since glibc 2.27 the generated locale broke backward compatibility. We've yet not found a solution to this problem, the only thing right now is to potentially either re-generate the locale-archives using older glibc or downgrade glibc to pre 2.27
#12 Updated by Marcin Kuzminski [staff] over 1 year ago
Another way to fix this:
Fedora 23 / Ubuntu 18.04 ------------------------ |RCC| has a know problem with locales, due to changes in glibc 2.27+ which affects the local-archive format, which is now incompatible with our used glibc 2.26. To work around this problem, you need set path to ``$LOCAL_ARCHIVE`` to the locale package in older pre glibc 2.27 format, or set `LC_ALL=C` in your enviroment. To use the pre 2.27 locale-archive fix follow these steps: 1. Download the pre 2.27 locale-archive package .. code-block:: bash wget https://dls.rhodecode.com/assets/locale-archive 2. Point ``$LOCAL_ARCHIVE`` to the locale package. .. code-block:: bash $ export LOCALE_ARCHIVE=/home/USER/locale-archive # change to your path