1

I referred to many links to solve this error SEVERE: Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly..

I executed export LC_ALL=C as told in the below link

Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly

https://askubuntu.com/questions/536875/error-in-installing-mongo-in-virtual-machine

I also referred to BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly

and did the following steps,

root@product:/# localedef -i en_US -f UTF-8 en_US.UTF-8
root@product:/# export LANGUAGE=en_US.UTF-8
root@product:/# export LANG=en_US.UTF-8
root@product:/# export LC_ALL=en_US.UTF-8
root@product:/# locale-gen en_US.UTF-8
Generating locales...
  en_US.UTF-8... done
Generation complete.
root@product:/# dpkg-reconfigure locales
Generating locales...
  en_US.UTF-8... up-to-date
Generation complete.

After trying all the above steps also i still get the below error when i execute mongo command through ssh

product@product:~/docker$ sshpass -p password ssh root@172.20.71.71 'mongod --dbpath /var/lib/mongodb/ &'
2015-02-24T09:50:27.158+0000 SEVERE: Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly.

But when i execute mongod --dbpath /var/lib/mongodb/ & from within the container it works, below is the terminal output

root@product:/# mongod --dbpath /var/lib/mongodb/ &
[1] 284
root@product:/# 2015-02-24T09:56:42.108+0000 [initandlisten] MongoDB starting : pid=284 port=27017 dbpath=/var/lib/mongodb/ 64-bit host=product
2015-02-24T09:56:42.108+0000 [initandlisten] db version v2.6.7
2015-02-24T09:56:42.108+0000 [initandlisten] git version: a7d57ad27c382de82e9cb93bf983a80fd9ac9899
2015-02-24T09:56:42.108+0000 [initandlisten] build info: Linux build7.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
2015-02-24T09:56:42.108+0000 [initandlisten] allocator: tcmalloc
2015-02-24T09:56:42.108+0000 [initandlisten] options: { storage: { dbPath: "/var/lib/mongodb/" } }

If anyone knows why this is happening, I want to run it through ssh.

Community
  • 1
  • 1
Tejus Prasad
  • 6,322
  • 7
  • 47
  • 75
  • can you post th result from `sshpass -p password ssh root@172.20.71.71 'echo $LANGUAGE' ` – user2915097 Feb 24 '15 at 10:37
  • Empty line is the response i get when i run your command. This is what i'm running= "product@product:~/docker$ sshpass -p password ssh root@172.20.71.71 'echo $LANGUAGE'" – Tejus Prasad Feb 24 '15 at 10:40

1 Answers1

2

Probably your ssh client is trying to set those environmental variables in remote host. Edit you /etc/ssh/ssh_config commenting the line SendEnv LANG LC_*

Javier Cortejoso
  • 8,851
  • 3
  • 26
  • 27