Gurjeet Singh
Gurjeet Singh

Reputation: 41

nsenter error:_nl_intern_locale_data: Assertion failed

I am trying to work with nsenter in docker but getting the above error from morning.

I have upgraded locales as well but still getting the same error command which I am trying to execute is

sudo nsenter -m 29050 /bin/bash

The error I am getting after execution of the same command is

nsenter: loadlocale.c:129: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
    Aborted.

Kindly help me in solving the problem.

Thanks.

Upvotes: 4

Views: 4574

Answers (2)

Akhil Pathania
Akhil Pathania

Reputation: 752

First, edit /etc/locale.gen and add the locales you want.

Make sure the utf8 in the locale name is lowercase, not e.g. UTF-8.

Make sure in your startup files like ~/.bash_profile and ~/.bashrc etc. you set LANG and related variables to the lowercase utf8 form, see the directories in /usr/lib/locale for the correct form.

Refer this link -> https://askubuntu.com/questions/1081901/what-is-the-correct-way-to-fix-an-assertion-in-loadlocale-c

Upvotes: 1

Marcos Marado
Marcos Marado

Reputation: 51

Setting LC_ALL="C.UTF-8" will probably fix your problem.

Upvotes: 5

Related Questions