Project

General

Profile

Bug #5297

Locale fails on a SuSE system

Added by Oliver Eichler over 2 years ago. Updated 10 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
28.04.2017
Due date:
% Done:

0%

Estimated time:
Sorting:
Commit Number:
Affected Version:

Description

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.

vcsserver.log (505 KB) vcsserver.log Oliver Eichler, 28.04.2017 17:24

History

#1 Updated by Nikolay Yankin over 1 year ago

Same problem for me.

#2 Updated by Marcin Kuzminski [staff] over 1 year ago

from the ticket https://issues.rhodecode.com/issues/5434#note-13

Setting LOCALE_ARCHIVE=/usr/lib64/locale/locale-archive in .rccontrol/supervisor/supervisord.ini fixes the problem

it's an enviroment= option

#3 Updated by Marcin Kuzminski [staff] about 1 year ago

  • Target version changed from v4.7 to v4.13

#4 Updated by Boris Basic about 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.

#5 Updated by Marcin Kuzminski [staff] about 1 year ago

Did you restart whole supervisord?

We thought this is fully fixed now

#6 Updated by Boris Basic about 1 year ago

Yes, I also restarted the whole system, same issue each time. The only solution was to disabled the failing command.

#7 Updated by Marcin Kuzminski [staff] about 1 year ago

Would it be possible to have a remote session with your system so someone from our team can look at this?

#8 Updated by Boris Basic about 1 year ago

Of course, I'll give you access tomorrow if you are available.

#9 Updated by Marcin Kuzminski [staff] about 1 year ago

That's great we'll poke around, hopefully, we can find some better solution. You can write to support@rhodecode.com with credentials, as those are private tickets that we can only see.

Thanks again!

#10 Updated by Boris Basic about 1 year ago

Thanks, I sent the credentials by mail, you can access the server to look art the issue.

#11 Updated by Marcin Kuzminski [staff] about 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] 12 months 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

#13 Updated by Daniel D 10 months ago

  • Status changed from New to In Progress

#14 Updated by Daniel D 10 months ago

  • Status changed from In Progress to Resolved

Also available in: Atom PDF