If you’re trying to run Meteor in a Vagrant VirtualBox, and getting an error like this when starting the local server:
vagrant@precise32:/vagrant$ meteor [[[[[ /vagrant ]]]]] Unexpected mongo exit code 100. Restarting. Unexpected mongo exit code 100. Restarting. Unexpected mongo exit code 100. Restarting. Can't start mongod 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.
As the error message suggests, the problem is caused by the way Vagrant is sharing the src folder with the VM. The easiest solution (suggested here) is to move the Mongo DB data folder to somewhere on the VM, with a symlink in the Meteor folder:
vagrant@precise32:/vagrant/.meteor/local$ ln -s ~/db/ vagrant@precise32:/vagrant/.meteor/local$ ls -la total 12 drwxr-xr-x 1 vagrant vagrant 4096 Jun 17 2013 . drwxr-xr-x 1 vagrant vagrant 4096 Jun 17 21:47 .. lrwxrwxrwx 1 vagrant vagrant 17 Jun 17 2013 db -> /home/vagrant/db/
And you should be back in business!
vagrant@precise32:/vagrant$ meteor [[[[[ /vagrant ]]]]] => Meteor server running on: http://localhost:3000/
UPDATE: this won’t work on a Windows host, apparently; due to the lack of support for symlinks. Sorry!
You saved my day. Thank you!
Worked for me, but I had to ln ‘local’ rather than ‘db’. Many thanks.
I’ve been stuck on this problem for hours. I saw this blog post but no luck; then I tried your suggestion and it works! Thanks a ton to you and Graham!!
Here dont work it. I’m trying in Centos 6.4 (64), local folder dont exists in “/home/vagrant/.meteor”. Any idea? Thank you.
It’s in /vagrant, when you’re ssh’d in to the box
Tnks for reply but still dont work, take a look http://pastebin.com/jr7AZzD7 Thank you.
that db file doesn’t look like a symlink. it should be like this:
lrwxrwxrwx 1 vagrant vagrant 17 Jun 17 2013 db -> /home/vagrant/db/
I belive that i cant create symlinks:
[vagrant@meteor local]$ ln -s /home/vagrant/db/ db
ln: creating symbolic link `db’: Protocol error
Vagrant is the shared folder. Are you using Windows with Vagrant?
No, I’m using linux as both guest and host.
Thanks a lot !
Worked for me. Thank you!
You can use the rsync option and ignore the `local` directory and avoid manually creating a symbolic link, e.g., in your Vagrantfile
config.vm.synced_folder ‘.’, ‘/vagrant’, type: ‘rsync’, rsync__exclude: [‘.meteor/local’, ‘packages’]
N.b. I had to also excluded the packages directory too as rsync was not happy about symbolic links in that.
The to automatically sync your edits you will need to run
vagrant rsync-auto
Sir Its not working for me…
When I am executing ln -s ~/db/ an error : cannot overwritethe directory occurs.
help me out.
does the ~/db/ folder already exist?
Could you please write exactly what I am supposed to write in order to symlink?
as stated above: if you’re in the “/vagrant/.meteor/local” folder, then you need to run “ln -s ~/db/”; which should create a symlink to the vagrant home dir (/home/vagrant/db).
Genius, thanks. :-)