Meteor: Meteor 1.0.4.2 Mongodb exit code 1, Restarting.

Created on 25 Mar 2015  Â·  94Comments  Â·  Source: meteor/meteor

Yesterday I created a new meteor app using 1.0.4.2, I was able to run and edit the app yesterday.
Today while running meteor on the directory I received the following error:

Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Can't start Mongo server.

I have been searching for the solution, but am unable to find the solution, GCC is up to date. Also mongodb does not list exit code 1 on its website.

Mongo Driver Tool

Most helpful comment

I fix it adding this line to my ~/.bashrc

export LC_ALL=en_US.UTF-8

All 94 comments

Logged in from a different location, 6 hours later.

=> Started proxy.
=> Started MongoDB.
=> Started your app.

I agree that exit code 1 is surprising. I don't see it in the Mongo source either.

It sounds like it resolved itself, though?

This bug does not have a reproduction, so I'm closing it. If anyone is able to come up a way to consistently reproduce it, we can reopen it.

It strangely resolved itself, indeed.

On Fri, Mar 27, 2015 at 12:17 AM, David Glasser [email protected]
wrote:

Closed #4019 https://github.com/meteor/meteor/issues/4019.

—
Reply to this email directly or view it on GitHub
https://github.com/meteor/meteor/issues/4019#event-266435451.

I too got this kind of bug in my meteor (Latest version) app. Though the error code was 100 in my case. But as my product was in development and didn't had any data, I used meteor reset and got rid of the problem. Though still Don't know that why the problem was produced in first place.

Exit code 100 is actually one we're used to seeing. It typically means you are having problems writing to .meteor/local, because disk is full, you lack permissions, or you are on a network/shared filesystem. (There should be a message explaining this.)

Yes the message was pointing towards the filesystem. But I don't know what exactly wrong stuff I did, so this particular error occurred.

If people see an unexplained "exit code 100", run ls .meteor/local/db and mention here what you see. If you see journal but not local.ns, that's interesting.

Hey this is a problem which is regularly coming in my system Ubuntu 14.04 (x64) DO VPS.

=> Started proxy.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Can't start Mongo server.

Strangely enough very less information is found online?

=> Started proxy.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Can't start Mongo server.

and my customer is waiting :-(

No one replies here. I have been installing it on newly created ssd VPS (ubuntu 14.04 64 bit) and I get the same issue. I am leaving meteor forever.

For some reason there have been more comments about this issue on #4115, an unrelated bug.

I tried to follow @etangreal 's instructions https://github.com/meteor/meteor/issues/4115#issuecomment-98474136 but was unable to reproduce.

I would definitely love to fix this issue which is apparently afflicting a number of users, but so far no reproductions have worked.

If people are consistently seeing this, maybe this can get me more information:

Go to a new directory and check out this branch of Meteor:

$ git clone -b issue-4019-debug https://github.com/meteor/meteor/

Then go back to the directory in which meteor shows the errors above, and run /path/to/your/new/checkout/meteor/meteor instead, and show me what it prints (assuming it still prints mongo errors). (You don't need to install anything to run Meteor from a git checkout; just running the meteor script inside the directory should do the trick.)

I'm also going to reopen this since multiple users are independently reporting it, even though there is no usable reproduction.

After doing this $ git clone -b issue-4019-debug https://github.com/meteor/meteor/ I got

=> Started proxy.                             
MONGOD STDOUT 2015-05-29T18:45:20.460+0000 SEVERE: Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly.

@sanrodari can you post your OS version and the value of the LC_ALL env variable?

$ uname -a
Linux vagrant-ubuntu-trusty-64 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

$ perl -e exit
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

I fix it adding this line to my ~/.bashrc

export LC_ALL=en_US.UTF-8

I've just had the very same problem on a DO droplet running Ubuntu Server 14.04 x86_64 and Meteor 1.1.0.2

I got the same output as @sanrodari running perl -e exit and everything got fixed after setting LC_ALL among the env variables.

OK, sounds like we should set default values for at least LC_ALL if none is set, when we spawn mongod.

And we should consider logging some part of stdout to make it easier to debug these things.

See https://jira.mongodb.org/browse/SERVER-9032 and https://github.com/mongodb/mongo/commit/ff70eb640552c049538a03d174edbc2c0311c8bd (though it looks like the issue pre-existed this commit and this commit just changed it from a weird stack trace to an error message).

I had the same problem, and can confirm that the LC_ALL environment variable helped:

JASMINE_BROWSER=PhantomJS LC_ALL=en_US.UTF-8 meteor --test

Hi!
I been having the same problem when starting meteor on my Elementary OS Freya machine:

=> Started proxy.

Unexpected mongo exit code 1. Restarting.

Unexpected mongo exit code 1. Restarting.

Unexpected mongo exit code 1. Restarting.

Can't start Mongo server.

Alright after much search/research, I found out that my locale settings were not working properly, and that was somehow affecting mongo/meteor.
Here's the fix that worked for me.

$ sudo sh -c "echo -e 'LANG=en_US.UTF-8\nLC_ALL=en_US.UTF-8' > /etc/default/locale" 

Btw, log out and log in for this to work.
Hope it helps!

@sanrodari thanks a lot

I fix it adding this line to my ~/.bashrc

export LC_ALL=en_US.UTF-8

Hi!

I had the same problem with a VM in Azure. The solution was add the LC_ALL mentioned by @krazyeom and @sanrodari

Previously, the command ´´´perl -e exit´´´ shows that LC_ALL was (unset)

Thanks!!!!

I have this same problem, in my machine etc/default/locale is set at (without line numbers):
1 LANG="en_US.UTF-8"
2 LC_NUMERIC="it_IT.UTF-8"
3 LC_TIME="it_IT.UTF-8"
4 LC_MONETARY="it_IT.UTF-8"
5 LC_PAPER="it_IT.UTF-8"
6 LC_NAME="it_IT.UTF-8"
7 LC_ADDRESS="it_IT.UTF-8"
8 LC_TELEPHONE="it_IT.UTF-8"
9 LC_MEASUREMENT="it_IT.UTF-8"
10 LC_IDENTIFICATION="it_IT.UTF-8"

Do I really have to set all with a single language with LC_ALL to run meteor? I mean this would be strange and pretty stupid, never had a problem running express or other node.js web frameworks with mongo

It's not Meteor that requires these environment variables; it's the database server mongod. And unfortunately it's not even explicit in the Mongo source what is required; it's part of the low-level boost library. That said, I'm figuring out today exactly what Mongo needs and we'll make Meteor set reasonable defaults.

That said, I am still unable to actually reproduce this myself. eg, on a fresh vagrant machine, perl -e exit works. @sanrodari maybe you can help me reproduce this?

glasser@glasser-lyrid 0 /tmp/trusty $ vagrant init ubuntu/trusty64
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
glasser@glasser-lyrid 0 /tmp/trusty $ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: A newer version of the box 'ubuntu/trusty64' is available! You currently
==> default: have version '14.04'. The latest is version '20150609.0.0'. Run
==> default: `vagrant box update` to update.
==> default: Setting the name of the VM: trusty_default_1434051147652_48936
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if its present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /private/tmp/trusty
glasser@glasser-lyrid 1 /tmp/trusty $ vagrant ssh
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-48-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Thu Jun 11 19:32:46 UTC 2015

  System load:  0.83              Processes:           87
  Usage of /:   2.8% of 39.34GB   Users logged in:     0
  Memory usage: 19%               IP address for eth0: 10.0.2.15
  Swap usage:   0%

  Graph this data and manage this system at:
    https://landscape.canonical.com/

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

0 packages can be updated.
0 updates are security updates.


vagrant@vagrant-ubuntu-trusty-64:~$ unset LANG
vagrant@vagrant-ubuntu-trusty-64:~$ unset LC_ALL
vagrant@vagrant-ubuntu-trusty-64:~$ perl -e exit

I tried it on a Digital Ocean droplet for Ubuntu Server 14.04 x86_64 too (both perl -e exit and actually running Meteor) and everything worked.

Look, I'm going to make ... some changes ... that I think might help ... but since I still have no idea how to actually reproduce the problem myself, who knows if they'll actually work?

OK, I pushed a change that provides default values for $LANG and $LC_ALL, and also detects the particular error message if it still occurs and provides a link to this page. This should get into 1.1.1. I do wish I was able to actually reproduce it myself, though...

Hi,
This just happened to me.
This was solved easily by disabling "set local variables automatically" in the terminal prefs.

Hi @xtrimf, can you describe in more detail how you disable local variables ?

Terminal -> Preferences -> Profiles -> advanced
uncheck "Set local environment variables on startup"

It happens very frequently on my machine. The solution is:

  1. Ctrl-C to exit.
  2. cd .meteor/local/db/journal
  3. rm mongod.lock
  4. Try to meteor again.

Deleting the lock can solve this. But it's a solution which is really different from all solutions above. Maybe exit code 1 is not happend for just one reason.

@laosb , actually you don't have to do it if you you do it like I described above - you see, your machine is trying to enforce LC parameters that are not available on the remote machine, so every time you log in and restart the mongo service this error will happen

@xtrimf Ah you got the point. That's the real truth.

Just in case this helps someone showing up to this thread like I did, I too had this error code 1 issue when starting MongoDB after I upgraded from 1.1.x to 1.2-rc.4. I happen to be running meteor from an Ubuntu 14.04 docker container, where the host is NixOS. Trying to set environment variables didn't work, but running locale-gen en_US.UTF-8 did the trick. I guess the locales set by default before I ran this were C, C.UTF-8 and POSIX (listed with locale -a).

same here on Debian after an upgrade to meteor update --release [email protected]

(master *% u=) sa@wks:~/0/todos$ meteor
[[[[[ ~/0/todos ]]]]]                         

=> Started proxy.                             
Unexpected mongo exit code 1. Restarting.     
Unexpected mongo exit code 1. Restarting.     
Unexpected mongo exit code 1. Restarting.     
Can't start Mongo server.                     
MongoDB failed global initialization

Looks like MongoDB doesn't understand your locale settings. See
https://github.com/meteor/meteor/issues/4019 for more details.
=> Babel active on file extensions: es6.js, es6, jsx
(master *% u=) sa@wks:~/0/todos$              

Quick fix was setting the locale from en_GB.UTF-8 to en_US.UTF-8 using dpkg-reconfigure locales as root on my local Debian development box.

I had the same problem - dpkg-reconfigure locales and setting it to en_US.UTF-8 did work.

I found that setting the locale in the environment variables wasn't necessary. Simply having that locale available on the OS was enough.

Similar to dackerman above, I generated the en-US.UTF-8 locale (though in my case, on Arch Linux, what I had to do was uncomment the en-US.UTF-8 UTF-8 line in /etc/locale.gen and then run $ sudo locale-gen)

I'm running Manjaro DE and it tells me that it cannot access the local archive because I don't have permissions. This is my first time running a Linux distribution, what can I do to change my local variables and try to fix this exit code 1?

Can confirm that adding export LC_ALL=en_AU.UTF-8 to my ~/.bashrc works, after logging out and then back in again. I'm in Australia. I imagine that export LC_ALL=en_US.UTF-8 would work too.

"apt-get install language-pack-en" fixed it for me

@dackerman

locale-gen en_US.UTF-8 done the tick for me.

I was running it in a ubuntu container also:

root@43a72c160694:/simple-todos# uname -a
Linux 43a72c160694 3.18.5-tinycore64 #1 SMP Sun Feb 1 06:02:30 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

"apt-get install language-pack-en" fixed it for me

For Arch Linux the solution presented by @Dockheas23 works like a charm!

After trying $ locale-gen en_US.UTF-8
$ localedef -i en_GB -f UTF-8 en_US.UTF-8 fixed for me in debian got the idea form

https://wiki.gentoo.org/wiki/UTF-8

[][]'s

dpkg-reconfigure locales fixed it to me.
I'm using Debian 8.2 Jessie.

Adding export LC_ALL=POSIX (en_US.UTF-8 was not installed on my system) in ~/.bashrc worked for me :+1:

Edit

The @Syphonpt (TANKS !!) solution worked for me :

$ apt-get install locales
$ locale-gen en_US.UTF-8
$ localedef -i en_GB -f UTF-8 en_US.UTF-8 

Is setting env vars still needed for people with Meteor 1.2 and above? I thought I fixed it to not need you to set env vars. Are you running an older version of meteor on your project, @mikamboo ?

@glasser I'm running latest meteor version inside a Debian Jessie based Docker container.

root@415312c996ea:/app# meteor --version
Meteor 1.2.1

Huh. Before you added that line, was $LC_ALL set? ie, delete that line, start a new shell, type echo $LC_ALL, what does it say?

@glasser $LC_ALL wasn't set befofore.
I just deleted $LC_ALL from my ~/.bashrc file, start a new shell, then run meteor cmd :

root@415312c996ea:/app# meteor
[[[[[ /app ]]]]]                              

=> Started proxy.                             
Unexpected mongo exit code 1. Restarting.     
Unexpected mongo exit code 1. Restarting.     
Unexpected mongo exit code 1. Restarting.     
Can't start Mongo server.                     
MongoDB failed global initialization

Looks like MongoDB doesn't understand your locale settings. See
https://github.com/meteor/meteor/issues/4019 for more details.

and just to be 100% clear, in this shell where Mongo doesn't work, echo $LC_ALL says nothing (and not, say, some other locale you don't have?)

This makes me think that the fix (bc1faab51d30737b59859b8688f2f474766ec3d5) doesn't actually work...

Oh, hmm, in addition to echo $LC_ALL, can you try:

node -e 'console.log("%s[%s]", "LC_ALL" in process.env, process.env.LC_ALL)'

Yes @glasser i confirm, my $LC_ALL is empty.

root@415312c996ea:/app# echo $LC_ALL

root@415312c996ea:/app# 

root@415312c996ea:/app# node -e 'console.log("%s[%s]", "LC_ALL" in process.env, process.env.LC_ALL)'
false[undefined]

I'm sorry, I'm pretty mystified as to what is happening here. I don't understand how the change in bc1faab doesn't fix this but setting it yourself does.

@glasser I think the problem comes from my docker container which running meteor. Because language pack en_US.UTF-8 is not installed inside. SORRY it's my bad, in my first reply I said that putting export LC_ALL=en_US.UTF-8 in ~/.bashrc solved. But in realty I had put export LC_ALL=POSIX .

This is my original locale cmd output :

root@415312c996ea:/app# locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

root@415312c996ea:/app# locale -a
C
C.UTF-8
POSIX

... That why I devicided to set LC_ALL to POSIX value, and it solved the Mongo error ! So, for the https://github.com/meteor/meteor/commit/bc1faab51d30737b59859b8688f2f474766ec3d5 fix, I think that it doesn't cover case of systems where en_US.UTF-8 is not installed. Perhaps a check of installed locales before could be a solution ..., I don't know.

Hmm. I mean, I think I'm OK with the status quo, where it fixes it for many users, and points with a link to this page if that doesn't work, then?

The link to this page was perfect for me. I would sleep less stupid tonight :) Thank @glasser for your time.

Thanks for your time!

I'd like to say that it may be the path of your folder that create this error (If there's non-ascii characters that might be a serious problem for him)

In fact i just create a new simple directory at the root of my hdd, meteor create and then it worked !

@glasser the problem with the patch is that it is falling back to local en_US.UTF-8. If that locale is not available mongo still fails to start. Changing run-mongo-js to use POSIX (or C) as the fallback should always work. I testing on a Docker container, and seemed to fix the problem.

Installed Meteor on a clean install of BunsenLabs (Hydrogen) Linux and also get this error. Used the fix @mikamboo and confirm it solved my issue. Back to the tutorial :+1:

I had the same problem.. dpkg-reconfigure locales and setting it to en_US.UTF-8 did work for me for debian 8.2 jessie

On Debian/Docker "localedef -i de_DE -f UTF-8 en_US.UTF-8" fixed it for me.
My problem solution history: https://gist.github.com/RobTranquillo/cd08d85438f9ef03ce21

sorry unable to resolve your issue...

On Fri, Jan 29, 2016 at 11:53 AM, tranquillo [email protected]
wrote:

On Debian/Docker "localedef -i de_DE -f UTF-8 en_US.UTF-8" fixed it for me.
My problem solution history:
https://gist.github.com/RobTranquillo/cd08d85438f9ef03ce21

—
Reply to this email directly or view it on GitHub
https://github.com/meteor/meteor/issues/4019#issuecomment-176599348.

on Debian, i had to do (as root)
-- dpkg-reconfigure locales # and select en-US.UTF-8
-- /etc/init.d/mongodb restart # restart mongodb

There is anyone fix that doesn't include force change localization? I don't want do it, it makes many problems in Linux.

Ok, for me was enough generate en_US localization files in Arch Linux, and works.

I'm on Debian (release 3.16.0-4-amd64), I had the same problem and export LC_ALL=fr_FR.UTF-8 fixed it

$ apt-get install locales
$ locale-gen en_US.UTF-8
$ localedef -i en_GB -f UTF-8 en_US.UTF-8

worked for me on latest Raspbian with Meteor.

export LC_ALL="POSIX" also worked (Ubuntu Server 14.04 64-bit)

On Debian Jessie.
$ sudo dpkg-reconfigure locales
First screen, add 'en_US.UTF-8' and don't change any thing on others screen.
start you meteor project !

For current Arch, add en_US.UTF-8 to /etc/locale.gen and execute sudo locale-gen

OS: Debian Jessie, in a chroot beside Chrome OS v49.0.2623.111
Meteor v1.3.1, while attempting to run a newly created Meteor application:

  • Fail with
=> Started proxy.                             
Unexpected mongo exit code 1. Restarting.     
Unexpected mongo exit code 1. Restarting.     
Unexpected mongo exit code 1. Restarting.     
Can't start Mongo server.                     
MongoDB failed global initialization

Looks like MongoDB doesn't understand your locale settings. See
https://github.com/meteor/meteor/issues/4019 for more details.
  • Fresh Debian install via crouton did not come with the packages package, so I did not have an /etc/locale.gen file
  • MongoDB thus had problems determining my locale
  • Running sudo apt-get install locales, as part of its installation, created /etc/locale.gen with valid contents
  • Problem resolved

This still happend..i just try meteor.

using with debian wheezy 7.3 and meteor 1.3.2.4 with error below

`[[[[[ ~/development/socially ]]]]]

=> Started proxy.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Can't start Mongo server.
MongoDB failed global initialization

Looks like MongoDB doesn't understand your locale settings. See
https://github.com/meteor/meteor/issues/4019 for more details.
`

I try all mention not work,and try edit the /etc/locale.gen to have en_US.UTF-8 UTF-8 and run locale.gen

And meteor can load---- mongodb not complain.
Is this cannot be fix?

Dunno with server deploy, but with development in linux desktop surely many experience this.

@Dockheas23 Same worked for me on Raspbian Jessie Lite, thanks!

I have Meteor-Universial for Raspbian. I was having this issue using iTerm software for OSX to log into the RaspberryPi. After reading some comments above, I closed iTerm and opened Terminal and logged into RaspberryPi with Terminal and the problem went away.

apt-get purge locales

apt-get autoclean

apt-get install locales

cd /usr/share/locales

./install-language-pack en_US.UTF-8

dpkg-reconfigure locales

sh -c "echo -e 'LANG=en_US.UTF-8\nLC_ALL=en_US.UTF-8' > /etc/default/locale"

fixed this problem

For me, using a Debian Testing distro, with a Spanish locale, a simple
`LC_ALL=es_ES.UTF-8meteor`
was enough to solve this issue.

Manjaro Linux, meteor 1.3.4.1, got:

=> Started proxy.                             
Unexpected mongo exit code 1. Restarting.     
Unexpected mongo exit code 1. Restarting.     
Unexpected mongo exit code 1. Restarting.     
Can't start Mongo server.                     
MongoDB failed global initialization

Looks like MongoDB doesn't understand your locale settings. See
https://github.com/meteor/meteor/issues/4019 for more details.

adding export LC_ALL=es_MX.utf8 solved it for me

If you're using one of the official Node images for Docker then export LC_ALL=C.UTF-8 and export LANG=C works. Have to use the lang C because that's the only language that has a UTF-8 character set. You can use locale -a to list the locales available.

I'm currently seeing this issue in a docker container created from a ubuntu:16.04 image. I resolved it like this in my Dockerfile:

FROM ubuntu:16.04
ENV OS_LOCALE="en_US.UTF-8"
RUN locale-gen ${OS_LOCALE}
ENV LANG=${OS_LOCALE} \
LANGUAGE=en_US:en \
LC_ALL=${OS_LOCALE}
RUN apt-get update && apt-get -y install curl locales && curl https://install.meteor.com/ | sh

I fixed it for docker debian image running the commands below:

$ apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales
$ sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen &&     echo 'LANG="en_US.UTF-8"'>/etc/default/locale &&     dpkg-reconfigure --frontend=noninteractive locales &&     update-locale LANG=en_US.UTF-8
$ export LANG=en_US.UTF-8

You can access here too: https://gist.github.com/vinnyfs89/a3cf7e3a342ce8625e5d763ddc145720

Have fun! :+1:

fixed on Debian Jessie and Meteor 1.4.1.1 with :
localedef -i en_US -f UTF-8 en_US.UTF-8
Thx

i'm meeting the issue when i'm running meteor application in a docker container based on ubuntu 14:04.

root@GCTechBlog:~/dockerfiles# docker run -dit -p 3000:3000 --name gctechcommerce gabrielwu/gctechcommerce 
5067c9ba66aaf069b4949d2b53d6135dd654d279a0890454d763cb01a01dd827
root@GCTechBlog:~/dockerfiles# docker logs gctechcommerce

Using settings file at settings/dev.settings.json

Setting up plugin imports...

[[[[[ /home/reaction ]]]]]

=> Started proxy.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
root@GCTechBlog:~/dockerfiles# docker logs -f gctechcommerce

Using settings file at settings/dev.settings.json

Setting up plugin imports...

[[[[[ /home/reaction ]]]]]

=> Started proxy.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Unexpected mongo exit code 1. Restarting.
Can't start Mongo server.
MongoDB failed global initialization

Looks like MongoDB doesn't understand your locale settings. See
https://github.com/meteor/meteor/issues/4019 for more details.
cfs:gridfs: updating npm dependencies -- mongodb, gridfs-stream..

The problem is fixed by:

"apt-get install language-pack-en -y"

@vinnyfs89 your comment helped me, I'm using this image ryanhanwu/docker-meteor:latest for our testing on the bitbucket pipeline.

@timbrandin That's very helpful and I'm excited that you use bitbucket pipeline because I have been trying to get this to work for a few days now. I have a very simple setup and my build is still failing when using ryanhanwu/docker-meteor:latest.

I am only using 2 commands for my script on the .yml file:

script: Modify the commands below to build your repository.

  • meteor npm install
  • meteor test --driver-package practicalmeteor:mocha --port 5000 --allow-superuser

Thoughts on how I can get my build to run successfully? I feel like I am missing something here when using a CI server vs. just running these locally.

Hi @tpechacek, this is my pipeline config:

image: ryanhanwu/docker-meteor:latest

pipelines:
  default:
    - step:
        script:
          - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales
          - sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen &&     echo 'LANG="en_US.UTF-8"'>/etc/default/locale &&     dpkg-reconfigure --frontend=noninteractive locales &&     update-locale LANG=en_US.UTF-8
          - export LANG=en_US.UTF-8
          - npm install
          - npm test

And this is how my package.json defines the test:

"scripts": {
    "test": "meteor test --allow-superuser --once --driver-package dispatch:mocha"
  },

Right now we only do server side tests, due to this bug: (https://github.com/meteor/todos/issues/198)

Hi,
I had the same issue using the ubuntu image with docker. I solved in this way:

locale-gen en_US.UTF-8
update-locale LANG=en_US.UTF-8

HTH

@frapik99 that did not work for me though, I think locale-gen is not installed on ryanhanwu/docker-meteor:latest

I'm running a Raspian and doing a
dpkg-reconfigure locales
and adding en_US.UTF-8 to the installed locales fixed the problem, no LC_ALL or changing the default system settings. I suspect that minimalistic space saving Linux installs that are not installing the en_US locale is the problem...

I am running Meteor 1.5 in Ubuntu Xenial LTS, and using dpkg-reconfigure locales and settings locale(s) fixed it.

I know this solution has been mentioned a few times already, but I'm mainly just pointing out that it's Meteor 1.5, and still seems to have the problem despite @glasser's attempt to make it automatically create an env variable.

@trusktr I can confirm that this:
dpkg-reconfigure locales
works for me also on Meteor 1.5 in Ubuntu Xenial LTS

Great work everyone :+1:

dpkg-reconfigure locales and setting it to en_US.UTF-8 works for me on debian9 + meteor1.6

I'm late to the party, for me running Debian GNU/Linux 8 (jessie)

solved with sudo apt-get install locales

Was this page helpful?
0 / 5 - 0 ratings