I’m facing an issue with Meteor and MongoDB. When I type npm start to run my project, I get the following error message:
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Can't start Mongo server.
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.
I checked on Google, did meteor reset but also rm -rf .meteor/local/db/mongod.lock but nothing changes. Any idea?
What operating system are you on? Do you have any data you need to be saved in the db?
If Linux, open your file manager, go to your projects directory, press CTRL H to view hidden files, go into .meteor/local/db and try to create a file there.
…and if you can see the dir .meteor/local/db and have not important data, run ‘meteor reset’ in the terminal, in your projects root directory, and see if he content of the db directory changes
I have no .meteor/local/db path. The path I have is C:\Users\Me\AppData\Local\lxss\home\Philippe\.meteor. I’m using Windows 10 and the Linux Subsystem. Then, in .meteor I have /package-metadata, /packages and a file called meteor.
Oh I see, that is just your home directory, you must check in your projects directory. There you have another .meteor folder, in there you have loca/db.
That’s the path to your WLS home/ directory as seen by Windows. You absolutely must not try changing linux files/folders via Windows - it can irretrievably damage the linux subsystem.
However, you can use your Windows C: drive as a shared drive in linux (it’s available as /mnt/c/).
Having said all that, you will have a .meteor/ folder within each of your meteor project folders. If you’re not used to using linux, you may not be aware they’re present, as by default the ls command doesn’t show “dotfiles”. You can use ll or ls -al to see them.
You’re right, I have this .meteor\local\db in my project. I did meteor reset, got the Project reset. message, but when I run meteor again, I still get this error message :
npm start
> pup@ start /mnt/c/Users/Philippe/Documents/Développement/BlockChainPartner/pocmaif-meteor
> meteor --settings settings-development.json
[[[[[ /mnt/c/Users/Philippe/Documents/Développement/BlockChainPartner/pocmaif-meteor ]]]]]
=> Started proxy.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Unexpected mongo exit code 100. Restarting.
Can't start Mongo server.
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 when I wanna reach C:\Users\Me\AppData\Local\lxss\home\Philippe\ I’m told that I don’t have the right to access this folder. I did sudo chown -R Philippe /home/Philippe but it doesn’t work.
Well, /mnt/c/... is your mapped Windows C: drive. There are known issues when running MongoDB on mapped drives, so I think this is just one of those.
When I start Ubuntu on Windows I’m launched straight into my /home/folder. I’ve had no issues running Meteor from there. I’m a little surprised to see that your project folder is at /mnt/c/Users/Philippe/Documents/Développement/BlockChainPartner/pocmaif-meteor, which suggests you did a cd to there to create your project?
Try creating a project in your home directory and running meteor from there. If it works, then the issue is with MongoDB and mapped drives. In which case you’ll need to move your project off your C: drive and into your linux /home/Phillipe/ folder.
My project is in C:/Users/Philippe/Documents/Développement/BlockChainPartner/pocmaif-meteor. This is a git clone from GitHub I did from Windows. It works without any issue under Ubuntu, but not under Windows with the Ubuntu subsystem.