Problems to run examples in Meteor - mongodb

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!

I had the same problem. Fixed with:
WARNING: This erases your local database:
meteor reset

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

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!

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.

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

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

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.

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.

This is what helped me to run meteor on Google Compute Engine:
export LC_ALL=C

Watch for accents in the path of your projects.
..\Système\MyMeteorProject will not work,
..\System\MyMeteorProject will work.

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

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"

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.

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.

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/

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.

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>

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.

I could recover the error by deleting the Local Mogo db lock.
Steps to remove the db lock :
Navigate to your app directory(where you have Meteor application files)
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.

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

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/

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

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.

I had the same problem. Fixed with:
Fixed with:
your project directory
redirect to .meteor directory > .local > .db
in .db folder remove all the files from here
run command "meteor"
It's working fine for me.Try this, it really helps alot.

Become a superuser:
# meteor --allow-superuser

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

Related

MongoDB on a Windows 7 machine: No connection could be made

After I have started Mongo using mongod.exe on a Windows 7 machine, I tried to start the mongo shell that failed with the error:
Failed to connect to 127.0.0.1:27017, reason: errno:10061 No
connection could be made because the target machine actively refused
it.
...
Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1),
connection attempt failed at src/mongo/shell/mongo.js:146 exception:
connect failed
In the CMD where I running the mongod the output is:
C:\Users\Vera>mongod --dbpath c:\mongodb\mongodata
2014-05-18T17:10:10.135-0300 [initandlisten] MongoDB starting :
pid=3296 port=27017 dbpath=c:\mongodb\mongodata 64-bit host=Vera-PC
2014-05-18T17:10:10.136-0300 [initandlisten] targetMinOS: Windows
7/Windows Server 2008 R2
2014-05-18T17:10:10.136-0300 [initandlisten] db version v2.6.1
2014-05-18T17:10:10.136-0300 [initandlisten] git version:
4b95b086d2374bdcfcdf2249272fb552c9c726e8
2014-05-18T17:10:10.136-0300 [initandlisten] build info: windows
sys.getwindowsversion(major=6, minor=1, build=7601, platform=2,
service_pack='Service Pack 1')
BOOST_LIB_VERSION=1_49
2014-05-18T17:10:10.136-0300 [initandlisten] allocator: system
2014-05-18T17:10:10.136-0300 [initandlisten] options: { storage: {
dbPath: "c:\mongodb\mongodata" } }
2014-05-18T17:10:10.242-0300 [initandlisten] journal
dir=c:\mongodb\mongodata\journal
2014-05-18T17:10:10.243-0300 [initandlisten] recover : no journal
files present, no recovery needed
2014-05-18T17:10:11.077-0300 [initandlisten] waiting for connections
on port 27017
Any suggestion how to fix this issue?
I got the same error and fixed it with:
1) mkdir c:\data
2) cd data
3) mongod -dbpath .
4) Now in another command window I was able to connect from my client using the mongo command.
I got this problem. What fixed mine is:
Suppose you have a dir: "C:\mongo_databse"
Open Command Prompt and type (suppose you haved added the Mongo bin directory to PATH): mongod --dbpath=C:/mongo_database.
There will be some log to the command prompt.
Now open ANOTHER command prompt then type in mongo then it works.
What solved my issue was creating a file startmongo.conf that sets the bind_ip to 127.0.0.1 . After that, I just created a *.bat to start the mongo using something like:
mongod --config c:\mongodb\bin\startmongo.conf
More details could be seem at this post .
I assume your mongo.config file to be located inside the mongodb folder in the same level to the bin directory.The contents of the mongo.config file are:
dbpath=C:\mongodb\data
logpath=C:\mongodb\log\mongo.log
diaglog=3
don't forget to create the data folder and log folder in the same level of bin directory inside log folder create the mongo.log empty file.
Point your command prompt to C:\mongodb\bin wherever your mongo db bin folder is located.
create the mongo db service in windows typing
mongod.exe --storageEngine=mmapv1 --config=../mongo.config
from now unwards you can start the mongo db service as
net start mongodb
finally you can connect to the mongo db server from the mongo db client typing
mongo.exe
once you have gone successfully from step 1 to step 3 from the next time on wards you only need the step 4 and 5.to start the service and to connect.
it prompted me like this
1)So, i created a path
C:\data\db
2)Now run
mongod in your terminal
it solved me issue!
I got this error beacuse of not sufficient space in the disk.
Check your mongo log.
I was getting a similar error when I was trying to start my mongo db via cmd. However the difference was I had a config file which has the path to the db and log folders and wanted to use the same. I was using mongo few days back and it was running fine but when I started using it again today it was giving me the error :
2015-05-27T10:33:22.820-0400 I CONTROL Hotfix KB2731284 or later update is installed, no need to zero-out data files
MongoDB shell version: 3.0.2
connecting to: test
2015-05-27T10:33:23.854-0400 W NETWORK Failed to connect to 27.0.0.1:27017, reason: errno:10061 No connection could be made because the target machine actively refused it.
2015-05-27T10:33:23.857-0400 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at connect src/mongo/shell/mongo.js:179:14) at (connect):1:6 at src/mongo/shell/mongo.js:179 exception: connect failed
Here's how I fixed it :
Open cmd as admin and navigate to the bin folder of your MongoDB and type : mongod --config <path to your config file> --install
Now start your mongo db service : net start mongodb
you should get a message which says : The MongoDB service was started successfully.
close this command prompt and open another one as admin, navigate to the bin folder once again and type mongo
This will connect you to the mongodb test.
Press ctrl+c anytime to exit.
Hope this helps.
In Windows 10:
Executing below command restarts mongodb service (as administrator), required if there is a system restart after mongodb installation.
net start mongodb
Also make sure to check, if there is a MongoDBInstallation folder/data and /data/db folder created, same can be obtained at MongoDBInstallation\bin\mongod.cfg
mongod --dbpath=c:\MongoDBInstallation\data\db
Open task manager, click on the services tabs on the top. From the list right click on mongoDB then click start.
I had a very similar experience to #user1501382, but tweaked everything slightly in accordance with the documentation
1) cd c: //changes to C drive
2) mkdir data //creates directory data
3) cd data
4) mkdir db //creates directory db
5) cd db //changes directory so that you are in c:/data/db
6) run mongod -dbpath
7) close this terminal, open a new one and run mongod
for mongodb 3.0 versions use "--smallfiles".
e.g:-
mongod --dbpath="C:\Program Files\MongoDB\Server\3.0" --logpath="C:\Program Files\MongoDB\Server\3.0\data\log.txt" --smallfiles --install
I am not sure if there is a better way to run it.
For me, I use these settings to create a directory and to a determinate new path for the MongoDB.
The important thing for me is that I miss to run it as a server (mongod) and after that into another terminal I type mongo which provide me an option to use the database.
I hope this could help someone.
I found my answer on this page. https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-mongo-app?view=aspnetcore-3.1&tabs=visual-studio
So, first, make a folder for your data; then, open one command shell
mongod --dbpath <data_directory_path>
then, open another shell, do whatever you want to do. You can see in MongoDB Compass, there are collections if you had one before.
I tried the above answer
, and it worked, but had a very important problem: My previous collections were lost in another mongoDB data folder which I didn't know where they are and how to get them back.
Before I run in to this mongo error, I was running mongo with no problem. When my windows10 boot files got corrupted and My computer went into blue screen, mongo ran into this error. So I just tried to retrieve the previous condition which I just was running mongo in one terminal and not mongod in another, so
I repaired mongoDB with it's installation exe file, and now everything is ok.
This is my mongoDB specs: mongodb-win32-x86_64-2012plus-4.2.1
Hope this help you too.
Just type mongod in one command prompt and then run mongo in another.
Simply follow the following steps mostly your problem will be solved(Windows 10)
services->mongodb->change auto to run
you can go to services>>Mongo DB server .. right click and press start . This worked for me
By simple step ,I was resolve this problem
first step - make a New folder in C-drive in PC with name - "data"
second step- now open this "data" folder
Third step - Inside the "data" folder, again make a new "db" folder
Note - Just leave it this both folder empty, no need to add any content inside this,
and run "mongo" and "mongod" in PowerShell of your PC.
I got the same error, and this is how I resolved it,
follow the below steps:-
Open mongod.cfg file
Add the bindIpAll: true tag in the
net (Network Interfaces) section
restart the mongoDB services.
# network interfaces
net:
port: 27017
bindIpAll: true
#bindIp: 127.0.0.1

MongoDB won't start after server crash

My Ubuntu computer had crashed, and when I restarted it MongoDB wasn't working. I tried the following commands, and got the following output:
$ mongo
Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91
exception: connect failed
$ service mongodb status
mongodb stop/waiting
$ service mongodb restart
stop: Unknown instance:
start: Rejected send message, 1 matched rules; type="method_call",
sender=":1.57" (uid=1000 pid=2227 comm="start mongodb ")
interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)"
requested_reply="0"
destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
$ tail /var/log/mongodb/mongodb.log
[initandlisten] exception in initAndListen: 12596 old lock file, terminating
dbexit:
[initandlisten] shutdown: going to close listening sockets...
[initandlisten] shutdown: going to flush diaglog...
[initandlisten] shutdown: going to close sockets...
[initandlisten] shutdown: waiting for fs preallocator...
[initandlisten] shutdown: closing all files...
[initandlisten] closeAllFiles() finished
dbexit: really exiting now
(Output reformatted to match website layout.)
What happened? How can I fix it?
The log file is telling you that you have an "old lock file". MongoDB keeps a lock file while it's running. It creates this file when it is started, and deletes it when it's stopped. When the computer crashes (or MongoDB crashes, e.g. via kill), this file is not deleted, and thus the database does not start. The existence of this file indicates unclean shutdown of MongoDB.
Two things can be done:
If this is a development machine and you haven't been using your database (and neither have your programs), you can remove the file manually. For MongoDB 2.2.2 running on Ubuntu 12.10, it's in /var/lib/mongodb/mongod.lock. For other versions, the file could be in a different path or it could be named mongo.lock.
The safer route is to follow MongoDB's Durability and Repair guide. In summary, for a machine with the above configuration, you should execute the following commands:
sudo -u mongodb mongod --repair --dbpath /var/lib/mongodb/
sudo service mongod start
all I had to do was run:
sudo mongod --repair
then:
sudo mongod
Based on my experience, I usually delete the "mongod.lock" file that is inside the database folder - In my case:
*I browse to where the database is installed on my ubuntu i.e. "data" folder.(cd data); list the files (ls)
*Then, I will remove the "mongod.lock" file that was automatically created when the database crashed, by issuing "rm mongod.lock" file.
After which I will either issue "./mongod" to start the mongo deamon or mongo to start the mongo shell. And everything will be fine.
Check to see if you have enough free space on your server. If there is no room left mongodb won't start.
If you did not use monitoring tools like Bluepill or Monit etc you will have to face this issue because after server crash due to some reason mongo didnot start its daemon automatically then you have to make it work manually, like sudo service mongod restart
I figured this issue but it needs some more tasks to be done, please make sure your dbpath at /etc/mongod.conf before starting your mongo daemon.
For me it was
storage:
dbPath: /var/lib/mongodb
When i enter mongod command it shows me MongoDB starting : pid=10795 port=27017 dbpath=/data/db 64-bit host=xyz.com make sure your dbpath is as same as mentioned in /etc/mongod.conf
To do this you can type sudo mongod --dbpath /var/lib/mongodb and then use mongod command to start your mongo process at your desired dbpath.
FYI: start your mongo process with mongod command
This is probably not the best solution, but if you're desperate you can try this. It seemed that only the journal was a problem for me, so I took these steps:
Create a new data directory. Possibly /var/lib/mongodb2
Update your mongod.conf to point to the new data dir.
Start mongoDB.
If it starts successfully, then you can shut down mongo again and proceed, otherwise you can stop reading here.
Locate your previous data dir and copy the files for your database(s) to your new data directory (example, admin.0 admin.1 admin.ns, etc)
Start mongoDB again (still using the new data directory)
After completing these steps (took less than 5 min), I was up and running and all data appeared to be ok.
Thank's guys. We also faced an issue where MongoDB was restarting over and over again an it was complaining about old lock file. I stopped MongoDB from Windows service list and then I deleted the mongod.lock file. After that I was able to start MongoDB service correctly and it worked fine.
Removing .lock file from mongo data directory dbpath works for me.
e.g sudo sudo rm {data-directory}/mongod.lock

Mongodb not starting

I installed mongodb a few days ago on my ubuntu machine and I was using it without any problems. Today I had to restart my PC. After that, mongo simply wont start. It says:
Wed Sep 12 21:41:21 [initandlisten] exception in initAndListen: 10296 dbpath (/data/db/) does not exist, terminating
It was working fine just a few hours ago and now it's all screwed up on reboot. I had a lot of important data stored there and I really hope it's not all lost! I need to find that data and run mongodb on that data again. I use pymongo to interract with mongodb.
I just saw the config file and it's storing the data in /var/lib/mongod as the dpath. Now how do I start mongodb specifying this dpath?
You can start mongodb with the following switch.
mongod --dbpath /path/to/mongodb/data
Or edit the config file.
/etc/mongod.conf
Change dbpath to your data directory.
dbpath = /path/to/mongodb/data
There's a lot more you can add and change in the config file go here for more details.
Use this command to create your directory tree.
mkdir -p data/{db}
Use the following command to start mongod:
sudo service mongodb start
This will pass your system configuration file as an argument to mongod, which (as you saw) will cause it to use the correct path.
you need a path to store your database. by default it is /data/db/. if it does not exist you have to create it first
One of the reason for this error can be the fact that you are starting the mongodb with user as yourself. If you execute the command with sudo, the mongodb should start without error:
sudo mongod --dbpath /path/to/mongodb/data
One can find the path to mongodb data in file such as /etc/mongod.conf

Moved Mongo Database to Different Drive: Unable to acquire lock for lockfilepath

I am in the process of moving my mongo data to a different drive. All of the data I want to move is stored in /data/db and I am moving it to a NAS (Network attached storage).
First step:
mongodump -d mydb -c mycollection -o nas/mongo-temp
This created a file tree in mongo-temp/ like so:
dump
`-- mydb
`-- mycollection.bson
1 directory, 1 file
I then stopped the mongod service and created a new /data/db directory:
/etc/init.d/mongod stop
mkdir mongo-temp/data/db
...and changed the dbpath line in /etc/mongodb.conf
dbpath=.../mongo-temp/data/db
I successfully restarted the mongo server using /etc/init.d/mongod start.
When I try to connect:
mongo
MongoDB shell version: 1.6.4
Thu May 3 09:53:23 *** warning: spider monkey build without utf8 support. consider rebuilding with utf8 support
connecting to: test
Thu May 3 09:53:24 Error: couldn't connect to server 127.0.0.1 (anon):1154
exception: connect failed
I've tried to start mongod with the command mongod --dbpath .../mongo-temp/data/db but I get an error that says:
Thu May 3 09:57:26 exception in initAndListen std::exception: Unable to acquire lock for lockfilepath: /home/dlpstats/nas-mnt/mongo-temp/data/db/mongod.lock
Removing the lockfile doesn't help. If I run the mongod command without --dbpath, the server starts fine and I am able to make queries on my old database.
First, you mentioned that you used mongodump to populate the new drive - was this just a method of backing things up or did you intend that to be the new database files? That is not how it works - mongodump output is not the same as a database file - it needs to be re-imported with mongoresore in fact. If you do a straight data file copy then the transfer will be seamless.
Then, as well as the permissions suggested by Wes in his answer, a few more things to check:
That you have shut down the old server successfully and completely - it's possible it's mis-reported error and you are getting it because it is trying to grab a port that is already open
You are using version 1.6.4 according to the mongo shell output, my guess is that you installed from the Ubuntu repo for 11.04 or similar, that is not a good option - 1.6 is very old at this point. Use the 10gen repos (http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages) or download the binaries and get a more recent version
Last but not least, when you start the mongod manually, make sure all the arguments are the same, like the port. When you connect via the mongo shell, specify the port you started the mongod on - don't rely on defaults when running into issues like this, be explicit.
I faced this problem and issuing following command solved my problem:
rm /var/lib/mongodb/mongod.lock
And then restart the mongod.
But I'm not sure is it a good solution or not.
Check the permissions for the directory and parent directories of mongo-temp. Presumably it's running as the mongodb user?
You need execute permissions on the directory (and parent directories) in order to create files there. Execute permissions on a directory allow you to list the files there, which is needed to be able to open the file for writing.

mongoDB test error

I came to know about mongoDB and looked for test.So I made it install and then for test when I used command mongo on terminal it showed an error like this
MongoDB shell version: 1.8.2
connecting to: test
Sun Jul 31 01:06:07 Error: couldn't connect to server 127.0.0.1 shell/mongo.js:79
exception: connect failed
So can someone tell me what is the problem.I am using ubuntu 11.04.For installation instruction I had used this site.I am newbie to this mongoDB so please helpe me.Any help will be highly appreciable.
All you need to do is open 2 terminal tabs. In one, run
mongod
which starts the MongoDB server.
In the other, run
mongo
which is the shell that connects to your MongoDB server.
It looks like MongoDB isn't running. Can you connect to the web interface in your browser?
http://localhost:28017
Also, do you see the process running on your machine? You should see an entry for mongod when running ...
$ top
or
$ ps aux
why not install mongodb from 10gen's own debian repository? much easier and more likely to work
http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages
To see if mongodb is running, this also helps:
sudo service mongodb status
if it is running, and you still get the same error, then it must be the weird localhost bug that mongodb has. it assumes localhost is 127.0.1.1 for some reason. try
mongo 127.0.1.1
I had the same problem. Just try to create folder c:\data and next c:\data\db