Problems to run examples in Meteor
Asked Answered
W

26

34

I'm testing Meteor examples and this is what I see when I run meteor in todos examples:

Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Can't start mongod. Check for other processes listening on port 3002 or other meteors running in the same project.

And this is what happens if I run mongod in the command line:

Thu Apr 12 19:27:39 Mongo DB : starting : pid = 2686 port = 27017 dbpath = /data/db/ master = 0 slave = 0  32-bit 

** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
**       see http://blog.mongodb.org/post/137788967/32-bit-limitations for more

Thu Apr 12 19:27:39 db version v1.4.4, pdfile version 4.5
Thu Apr 12 19:27:39 git version: nogitversion
Thu Apr 12 19:27:39 sys info: Linux murphy 2.6.32.14-dsa-ia32 #1 SMP Thu May 27 16:19:20 CEST 2010 i686 BOOST_LIB_VERSION=1_42
Thu Apr 12 19:27:39 waiting for connections on port 27017
Thu Apr 12 19:27:39 listen(): bind() failed errno:98 Address already in use for port: 27017
Thu Apr 12 19:27:39 MiniWebServer: bind() failed port:28017 errno:98 Address already in use
Thu Apr 12 19:27:39   addr already in use
Thu Apr 12 19:27:39 warning: web admin interface failed to initialize on port 28017

Someone helps? Thanks!

Whoremaster answered 11/4, 2012 at 10:5 Comment(4)
Perhaps try this aleccumming.com/2012/02/21/when-mongod-wont-start-on-os-xDunghill
Well what happens when you just run mongod from the command line?Myasthenia
I've edited the question with the prompt for mongod from command lineWhoremaster
uninstall meteor worked for me #24687471Iorgos
E
63

I had the same problem. Fixed with:

WARNING: This erases your local database:

meteor reset

Encarnacion answered 12/4, 2012 at 16:16 Comment(7)
me too, does not work, I get this error: $ sudo meteor reset reset: Meteor is running. This command does not work while Meteor is running your application. Exit the running meteor development server.Dyewood
This worked for me. (I had started receiving the Can't start mongod error after restarting my machine without exiting meteor.)Hierology
Worked for me too. I had been struggling getting the project shared to my win box (I am running Ubuntu through VirtualBox on a Windows host). During this time the folder has been moved around and I suddenly had problems like described above. I must admit that the confidence in that meteor reset should work, but hey - it worked :)Rothman
Worked for me. I think you have to cd into the project root folder and then do the meteor reset.Foliose
Yes, it works, but it removes all your data from Mongo as well. Try removing .meteor/local/db/mongod.lock (see answer below) first!Skees
Works like a charm. My failure was caused by an unexpected shutdown btw.Biolysis
Putting up a warning doesn't make this a good solution. Meteor reset should only be used as a last resource. The answer on #31618115 fits perfectly, deleting mongodb.lock and journal files.Deannadeanne
S
27

I had the same problem. Just remove .meteor/local/db/mongod.lock in your meteor project folder. And meteor should run normally.

Hope it helped! :)

Sutherland answered 29/4, 2012 at 8:24 Comment(2)
meteor reset did the trick for me. I guess that this command perhaps removes the lock-file (along with some other stuff maybe)?Rothman
+1 worked great. meteor reset removes everything from your database so this solution is a much better bet.Karren
K
26

As mKriss mentioned, try

meteor reset

If you get this error:

reset: Meteor is running.

This command does not work while Meteor is running your application.
Exit the running meteor development server.

Then look for meteor in your running processes:

ps -x | grep meteor

This gave me the following output:

14877 pts/0    Sl     0:02 /usr/lib/meteor/mongodb/bin/mongod --bind_ip 127.0.0.1 --port 3005 --dbpath /home/sam/proto/.meteor/local/db
15022 pts/0    S+     0:00 grep --color=auto meteor

So then I did:

kill -s KILL 14877
meteor reset
meteor

Now everything works!

Kwabena answered 18/4, 2012 at 16:2 Comment(0)
O
19

Not sure if this is relevant to your problem, but I got this error and eventually discovered it was caused because I had my app directory in a NFS share (I am running on Ubuntu in VirtualBox) which mongodb doesn't like. Putting my app in my home directory instead fixed the problem.

Ose answered 19/4, 2012 at 15:41 Comment(6)
I had the same problem when I had my project directory on a VirtualBox share, with Ubuntu as the guest and Win7 as the host. Works elsewhere.Clack
Same bug seems to appear in installs on my NTFS share (Win7/Ubuntu 12.04). Moving back to a directory on EXT4 seems to fix things.Vesperal
I have the same problem. I'd really like to keep the share location for my meteor apps, however...any known workarounds?Karren
@Karren I had same issue running VirtualBox on mac with Vagrant using precise64 (ubuntu) box. For me the workaround was to put my apps in the share location (/vagrant) and to use rsync to copy the apps to the /home/vagrant so I could run mongo without the errors on startup. I put some notes in my dev box repo here: github.com/pixelhandler/vagrant-dev-envAmias
The reason is here, groups.google.com/forum/?fromgroups=#!topic/mongodb-user/… Some file systems don't support the exclusive locking type needed in the dbpath directory. If this is a problem it will be very apparent as the server won't start.Porterporterage
@Porterporterage Yep, that was my problem. I was using a VirtualBox shared folder (shared with Windows 8). Once I created my meteor project in my Ubuntu home directory all was well. Thank you.Tilford
M
11

There are a few ways around this, the question didn't show how to use mongod so I'm going to run through how to get a bit more detail on the error. meteor reset might work but not always & it will clear your apps data if it does work.

The core issue is meteor is very undescriptive when it comes to displaying data, so I would advise to get get a bit more detail on the error as it could literally any mongodb error out there. The steps below should reproduce the error with more verbosity to help diagnose what the root issue is

Find where Meteor installs mongodb

If you have the mongod tool (downloadable from http://mongodb.com), otherwise use the one installed with meteor. Just be careful you don't get too new a version that upgrades your old database, then meteor's older mongodb won't be able to understand it.

typically (but not always) at

/usr/local/meteor/mongodb/bin/mongod (OS X)

/usr/lib/meteor/mongodb/bin/mongod (Red Hat/Debian)

C:\Program Files\Meteor\mongodb\bin\mongod.exe (Windows via Tom Wijsman's port)

Run Meteor's database manually with mongodb

So we're going to use this to manually run mongodb on your apps mongodb database:

In your projects directory with your terminal app/command prompt

cd .meteor
cd local
/usr/local/meteor/mongodb/bin/mongod --dbpath ./

If your mongod path is something else use that instead, the above works on OS X.

Analyse the output to find the root cause of the issue

Now mongodb should run and give you a good description of what the problem is, or run smoothly:

Mon Apr  1 23:59:55 [initandlisten] MongoDB starting : pid=84640 port=27017 dbpath=./ 64-bit  host=MacBook-Pro.local
Mon Apr  1 23:59:55 [initandlisten] 
Mon Apr  1 23:59:55 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
Mon Apr  1 23:59:55 [initandlisten] db version v2.2.1, pdfile version 4.5
Mon Apr  1 23:59:55 [initandlisten] git version: d6764bf8dfe0685521b8bc7b98fd1fab8cfeb5ae
Mon Apr  1 23:59:55 [initandlisten] waiting for connections on port 27017

Have a look at the what the error might be and then tackle the problem displayed. It could be one of many.

Example issue

If it has:

exception in initAndListen: 10310 Unable to lock file: ./mongod.lock. Is a mongod instance already running?, terminating

Then restart your computer to kill any processes that might be using the file and if it still doesn't help use meteor reset to clear the directory at .meteor/local/db so your app uses a fresh database.

The errors are very helpful e.g low disk space (clear up the trash ;-) or cannot write to disk (permissions issue - use chmod/sudo).

Very obscure issues

If you find something very perplexing it might be a mongodb issue more than a meteor one, have a look around for the error you get here on stackoverflow and if you can't find it put a question up and swarms of helpful people are hopefully ready to help :)

Malayan answered 1/4, 2013 at 22:5 Comment(1)
This was helpful, thanks. In my case, I had another Mongo running on the same port. Killing the process was enough to solve the problem.Houle
E
10

I have very simple solution:

export LC_ALL="en_US.UTF-8"

and run meteor

If it is ok, you can add this line to

sudo vim /usr/local/bin/meteor

Edan answered 15/4, 2014 at 17:17 Comment(0)
R
5

If meteor reset isn't working for you, check your disk space usage.

If you don't have any free disk space, you will get this error. MongoDB takes up about 450MBs, so creating a few projects can fill up a partition quickly.

Resemblance answered 28/11, 2012 at 16:33 Comment(1)
You're a lifesaver, I had 420 MB free and was wondering why I keep getting this messageGluck
A
3

If your meteor project is in a DropBox-folder, check for file names that contain the words conflicted copy in .meteor/local/db/ in your project folder and remove them. That should free up Mongod to run.

Arette answered 2/8, 2012 at 3:22 Comment(1)
Also nb: on linux many files in the .meteor or symlinks to other locations. This causes epic-dropbox badness. I have disabled syncing on these files.Occam
M
3

This is what helped me to run meteor on Google Compute Engine:

export LC_ALL=C
Macron answered 11/8, 2014 at 22:23 Comment(1)
worked for Digital Ocean droplet too, i was using Ubuntu 14 configured for nodejsGatepost
C
2

Watch for accents in the path of your projects.

..\Système\MyMeteorProject will not work, ..\System\MyMeteorProject will work.

Carroty answered 1/7, 2015 at 18:48 Comment(0)
B
1

Forgive the obvious, but does netstat -antep | grep 3002 show anything? (assuming you're on *nix)

Bramble answered 11/4, 2012 at 13:12 Comment(1)
No, it doesn't show nothing. Apparently there ins't any proccess listening on port 3002Whoremaster
A
1

I know this question is rather old, however I just ran into this issue as well and thought this might be useful to someone. What worked in my case was to run "sudo meteor"

Aframe answered 21/12, 2014 at 2:39 Comment(0)
T
1

I got this error message:

MongoDB had an unspecified uncaught exception.
This can be caused by MongoDB being unable to write to a local database.
Check that you have permissions to write to .meteor/local. MongoDB does
not support filesystems like NFS that do not allow file locking.

...and it turned out that I had an instance of the same app running on a different port, so add "making sure you don't have any other instances of the app running on an alternate port" to the list of things that can cause this error.

Thusly answered 22/2, 2015 at 18:49 Comment(0)
P
1

I could solve the issue under Meteor 1.2.1 and recover my data by deleting the lock file, copying whats left of .meteor/local/db/ to a temporary location (you might call this a backup), issue meteor reset and copy the backup data back to .meteor/local/db/. Everything worked as before.

Physiological answered 4/2, 2016 at 18:47 Comment(0)
A
1

for those using vagrant and do not want to meteor reset, clearing out the db of your meteor's local directory resolved the conflict. from the terminal:

rm -rf .meteor/local/db/
Aleksandrovsk answered 11/4, 2016 at 23:44 Comment(0)
I
0
Thu Apr 12 19:27:39 listen(): bind() failed errno:98 Address already in use for port: 27017

Something else is already using the port 27017, so mongo startup is failing. Start mongo on a different port or kill whatever process is using 27017 first.

Interstice answered 12/4, 2012 at 20:58 Comment(1)
Yes, I can start mongo in other port, but the problem with meteor persists. Can't start mongod. Check for other processes listening on port 3002 or other meteors running in the same project. There is nothing in that port.Whoremaster
I
0

Meteor reset command did not work for me in DOS

I deleted all files and folder under <projectfolder>/.meteor/local/db to Recycle Bin

**DOS Log below:**

D:\Meteor\todos>meteor reset
Project reset.

D:\Meteor\todos>
Inartificial answered 13/7, 2012 at 5:6 Comment(0)
A
0

I found the same conflict issue from syncing. I was using Ubuntu One and a bunch of new files were created in .meteor/local/db/ with "u1_conflicted" appended. I deleted those, and the ones in .meteor/local/db/journal and was back up and running.

Apprehend answered 3/4, 2014 at 23:53 Comment(0)
C
0

I could recover the error by deleting the Local Mogo db lock.

Steps to remove the db lock :

  1. Navigate to your app directory(where you have Meteor application files)
  2. Remove file $ rm .meteor/local/db/mongod.lock

NOTE : $ meteor reset

WARNING: meteor reset erases everything in your local database.

Error occurs if Meteor Application is still running in background. Db lock is not released by the running application or due to improper system/application shutdown and unavailable for second instance of same application.

So take care to quit the application every time.

Corduroy answered 13/2, 2015 at 19:15 Comment(0)
Z
0

Same problem when I tried to create my project in a VMWare shared folder linking to a host folder...

cd /mnt/hgfs/Folder_in_C_host_drive

meteor create myapp

cd myapp

meteor

Unexpected mongo exit code 100. Restarting.

...

Solved by moving the project to a standard folder in my filesystem...VMWare Shared Folders are not capable of handling file security and any files are root:root owned...that was why it ended in those MongoDB errors

Zoellick answered 17/3, 2015 at 13:25 Comment(1)
Could you possibly clarify your answer, it is not clear how your solution works.Rowley
I
0

If you are using Vagrant, MongoDb won't run in the Vagrant shared directory: https://gist.github.com/gabrielhpugliese/5855677

If you using Windows for your dev work, Meteor now has a Windows installer: http://win.meteor.com/

Infliction answered 22/6, 2015 at 18:24 Comment(0)
F
0

You can just try to stop running your meteor app using this command: kill -9 ps ax | grep node | grep meteor | awk '{print $1}'

Femme answered 19/1, 2016 at 14:14 Comment(0)
W
0

I ran into the Unexpected mongo exit code 100. Restarting. error a while back.I ended up answering my own question here which seems to have done the trick for many facing the same issue.Most importantly is it doesn't require meteor resetwhich wipes the database.It's a simple and very quick three step fix so I'd recommend trying it before some of the more complicated suggestions.

Wench answered 13/6, 2016 at 12:57 Comment(0)
D
0

I had the same problem. Fixed with:

Fixed with:

  1. your project directory
  2. redirect to .meteor directory > .local > .db
  3. in .db folder remove all the files from here
  4. run command "meteor"

It's working fine for me.Try this, it really helps alot.

Devon answered 28/12, 2016 at 13:8 Comment(0)
E
0

Become a superuser:

# meteor --allow-superuser

Eckenrode answered 20/1, 2017 at 2:57 Comment(0)
M
0

run the command meteor reset on sudo user. It should work for you..

Michaella answered 4/1, 2018 at 12:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.