Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meteor 1.0.4.2 Mongodb exit code 1, Restarting. #4019

Closed
WooterTheTroubleshooter opened this issue Mar 25, 2015 · 94 comments
Closed

Meteor 1.0.4.2 Mongodb exit code 1, Restarting. #4019

WooterTheTroubleshooter opened this issue Mar 25, 2015 · 94 comments

Comments

@WooterTheTroubleshooter
Copy link

@WooterTheTroubleshooter WooterTheTroubleshooter commented Mar 25, 2015

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.

@WooterTheTroubleshooter
Copy link
Author

@WooterTheTroubleshooter WooterTheTroubleshooter commented Mar 25, 2015

Logged in from a different location, 6 hours later.

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

@glasser
Copy link
Member

@glasser glasser commented Mar 26, 2015

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.

@glasser glasser closed this Mar 26, 2015
@WooterTheTroubleshooter
Copy link
Author

@WooterTheTroubleshooter WooterTheTroubleshooter commented Mar 27, 2015

It strangely resolved itself, indeed.

On Fri, Mar 27, 2015 at 12:17 AM, David Glasser notifications@github.com
wrote:

Closed #4019 #4019.


Reply to this email directly or view it on GitHub
#4019 (comment).

@allpratik
Copy link

@allpratik allpratik commented Mar 27, 2015

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.

@glasser
Copy link
Member

@glasser glasser commented Mar 27, 2015

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.)

@allpratik
Copy link

@allpratik allpratik commented Mar 27, 2015

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

@glasser
Copy link
Member

@glasser glasser commented Mar 31, 2015

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.

@techsavyravi
Copy link

@techsavyravi techsavyravi commented May 12, 2015

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?

@filipgorny
Copy link

@filipgorny filipgorny commented May 25, 2015

=> 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 :-(

@techsavyravi
Copy link

@techsavyravi techsavyravi commented May 26, 2015

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.

@glasser
Copy link
Member

@glasser glasser commented May 27, 2015

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

I tried to follow @etangreal 's instructions #4115 (comment) 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.)

@glasser
Copy link
Member

@glasser glasser commented May 27, 2015

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

@glasser glasser reopened this May 27, 2015
@sanrodari
Copy link

@sanrodari sanrodari commented May 29, 2015

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.
@Slava
Copy link
Member

@Slava Slava commented May 29, 2015

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

@sanrodari
Copy link

@sanrodari sanrodari commented May 29, 2015

$ 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").
@sanrodari
Copy link

@sanrodari sanrodari commented May 29, 2015

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

export LC_ALL=en_US.UTF-8

@splendido
Copy link

@splendido splendido commented Jun 1, 2015

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.

@glasser
Copy link
Member

@glasser glasser commented Jun 2, 2015

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 mongodb/mongo@ff70eb6 (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).

@bjarketrux
Copy link

@bjarketrux bjarketrux commented Jun 2, 2015

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
@ThiagoFerreir4
Copy link

@ThiagoFerreir4 ThiagoFerreir4 commented Jun 3, 2015

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.
@ThiagoFerreir4
Copy link

@ThiagoFerreir4 ThiagoFerreir4 commented Jun 3, 2015

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!

@krazyeom
Copy link
Contributor

@krazyeom krazyeom commented Jun 7, 2015

@sanrodari thanks a lot

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

export LC_ALL=en_US.UTF-8

@Nullpo
Copy link

@Nullpo Nullpo commented Jun 10, 2015

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!!!!

@ghost
Copy link

@ghost ghost commented Jun 11, 2015

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

@glasser
Copy link
Member

@glasser glasser commented Jun 11, 2015

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.

@braveh4rt
Copy link

@braveh4rt braveh4rt commented Jun 5, 2016

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
#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.

@Ruben9922
Copy link

@Ruben9922 Ruben9922 commented Jun 20, 2016

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

@thenetimp
Copy link

@thenetimp thenetimp commented Jun 27, 2016

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.

@mengning
Copy link

@mengning mengning commented Jun 28, 2016

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

@netman73
Copy link

@netman73 netman73 commented Jul 1, 2016

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.

@categulario
Copy link

@categulario categulario commented Jul 5, 2016

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

@dschnare
Copy link

@dschnare dschnare commented Aug 18, 2016

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.

@bush
Copy link

@bush bush commented Sep 3, 2016

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

jannikweichert pushed a commit to hochzehn/meteor-docker that referenced this issue Sep 6, 2016
@vinnyfs89
Copy link

@vinnyfs89 vinnyfs89 commented Sep 20, 2016

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! 👍

@Cooker-Monster
Copy link

@Cooker-Monster Cooker-Monster commented Sep 22, 2016

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

@IamGabrielWu
Copy link

@IamGabrielWu IamGabrielWu commented Sep 29, 2016

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"

@timbrandin
Copy link

@timbrandin timbrandin commented Dec 13, 2016

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

@tpechacek
Copy link

@tpechacek tpechacek commented Dec 20, 2016

@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.

@timbrandin
Copy link

@timbrandin timbrandin commented Dec 22, 2016

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: (meteor/todos#198)

@frapik99
Copy link

@frapik99 frapik99 commented Jan 10, 2017

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

@timbrandin
Copy link

@timbrandin timbrandin commented Jan 13, 2017

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

@baslking
Copy link

@baslking baslking commented Jan 18, 2017

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...

striezel added a commit to striezel/meteor-chess that referenced this issue Apr 27, 2017
MongoDB expects some locale-related variables to be set properly
on the system. It will not start, if these are not set.
Basically, LC_ALL needs to be set and the proper locale must
have been generated beforehand. The container will use the
en_GB.UTF-8 locale for the moment.

See <meteor/meteor#4019> for more
information about that issue.

Additionally, a short version history has been added to the
Dockerfile.
@trusktr
Copy link
Contributor

@trusktr trusktr commented Jun 16, 2017

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.

@TimeBandit
Copy link

@TimeBandit TimeBandit commented Jun 19, 2017

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

Great work everyone 👍

@bdedardel
Copy link

@bdedardel bdedardel commented Jan 5, 2018

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

noahsw added a commit to winsleague/winsleague that referenced this issue Apr 28, 2018
noahsw added a commit to winsleague/winsleague that referenced this issue May 3, 2018
* first conversion

* fixed yaml parsing

* fixed parsing

* trying to remove cache lines to get parse to work

* trying multiple save_caches

* trying a more specific build to see if it improves build time

* organized into workflows. added in deploy steps.

* added docker image to each test

* improving caching

* moving meteor install to cache but meteor build to workspace

* trying to use same build as meteor-up

* removing node install since it's already in docker container

* changed acceptance test to use machine because we need sudo access

* removing shell line because im not sure we need it

* fixed yarn path
fixed some caching

* debug path issues

* try to fix $PATH

* provided names to some steps
set METEOR_ALLOW_SUPERUSER to true because build container runs as root and this is okay in CI

* moved google-chrome printing because we only need it for one of the acceptance tests

* more caching

* moved away from meteor docker image because it's meant for production

* remove this cache path becaus eim not sure how it helps

* changed image

* don't cache git repo because it changes too often

* cache bump to see if that fixes unarchive error

* remove meteor runtime cache because its quicker to just install it each time

* trying to add mongo container

* fixed cache path

* fix path

* remove parallelism because it was just running build step 3 times

* fixed paths

* install meteor on downstream builds

* stopped using workflows because its more complexity than we need and it will just slow things down

* allow super user because we need root in this docker image

* for some mongo locale fix. meteor/meteor#4019

* another mongo locale fix

* selenium dependencies and hopefully more output during meteor build

* auto confirm prompt

* update first

* install chrome because all selenium tests need it

* more caching

* debug progress

* remove sudo because of our image

* fix to install chrome

* added -y

* chrome dependencies

* refactor

* trying to fix selenium with separate docker image - https://discuss.circleci.com/t/selenium-on-circle-ci-2/10910/4

* turn off profiling because it was causing pauses in CI

* turn off profiling

* remove manual install because selenium container does it

* moving back to script because it kills process after things are running

* typo

* added chromedriver package

* moved back to old way of doing dependencies because it installs java

* print java version

* changed dependency for chimp requirement

* needs java 8

* fixing package reference

* other java source

* trying java 8 again

* use openjdk so it doesnt require agreement

* auto accept

* removing problematic repo that 404s

* hopefully fixed java install

* hopefully fixed java install

* more specific node version

* print chrome version

* install chromedriver

* fix docker path

* seeing if --headless flag matters

* putting headless back. seeing if i need selenium image

* cleanup

* clean up artifact folders and clean up deployment paths

* fixed versions on apt-get packages

* cleaning whitespace
solderzzc added a commit to SharpAI/ApiServer that referenced this issue Sep 17, 2020
@aug2uag
Copy link

@aug2uag aug2uag commented Nov 9, 2020

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

solved with sudo apt-get install locales

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.