Monitoring, Management & Location Tracking

Locale Errors on CLI
Problem:

We have seen issues where after login to the AMP CLI you will get the Perl warning errors:

[root@localhost mercury]# root
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = "UTF-8",
        LANG = "en_US"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
svn: warning: cannot set LC_CTYPE locale
svn: warning: environment variable LC_ALL is UTF-8
svn: warning: please check that your locale name is correct
 

 



Diagnostics:

From the error message you could see that the Locale settings are incorrect for LC_ALL which is set to UTF-8.  However, the LANG is set to en_US.

To see the current setting use the command 'locale':

[root@localhost mercury]# 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=en_US
LC_CTYPE="UTF-8"
LC_NUMERIC="UTF-8"
LC_TIME="UTF-8"
LC_COLLATE="UTF-8"
LC_MONETARY="UTF-8"
LC_MESSAGES="UTF-8"
LC_PAPER="UTF-8"
LC_NAME="UTF-8"
LC_ADDRESS="UTF-8"
LC_TELEPHONE="UTF-8"
LC_MEASUREMENT="UTF-8"
LC_IDENTIFICATION="UTF-8"
LC_ALL=UTF-8

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = "UTF-8",
        LANG = "en_US"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
svn: warning: cannot set LC_CTYPE locale
svn: warning: environment variable LC_ALL is UTF-8
svn: warning: please check that your locale name is correct
 

Also if you execute 'locale -a', you will find all the language options:

[root@localhost mercury]# locale -a
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_COLLATE to default locale: No such file or directory
C
POSIX
aa_DJ
aa_DJ.iso88591
aa_DJ.utf8
aa_ER
aa_ER.utf8
aa_ER.utf8@saaho
aa_ER@saaho
aa_ET
aa_ET.utf8
af_ZA
af_ZA.iso88591
af_ZA.utf8
am_ET
am_ET.utf8
an_ES
an_ES.iso885915
an_ES.utf8
ar_AE
ar_AE.iso88596
ar_AE.utf8
ar_BH

-----

-----

But in the list you won't find UTF-8. This was the reason the perl module was throwing the error.

 



Solution

To resolve the issue, you could export the correct language option by run the command:

Example: 

# export LC_ALL="en_US"

This will resolve the issue. However this will be for the running session but in next reboot you will face the same issue. 

To resolve it permanently you could the above command in '/root/.bash_profile':

# vi /root/.bash_profile

(you could use vi editor: use 'i' to insert and put the command at the bottom of the file then press 'Esc' then  ':'  then 'x!').

Once done source .bash_profile:

# source /root/.bash_profile

To verify execute 'locale' command again:

[root@localhost mercury]# locale
LANG=en_US
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=en_US

This will resolve the issue. 

 

Version history
Revision #:
6 of 6
Last update:
‎03-29-2017 04:09 AM
Updated by:
 
Labels (1)
Contributors
Search Airheads
Showing results for 
Search instead for 
Did you mean: 
Is this a frequent problem?

Request an official Aruba knowledge base article to be written by our experts.