Error starting mongo -- "target machine actively refused it"

578 views
Skip to first unread message

George O'Gorman

unread,
Nov 13, 2018, 4:07:52 AM11/13/18
to mongodb-user
Hello. I'm doing a course on server-side apps and I'm stalled because I suddenly can't start Mongodb. It says, among other things: "No connection could be made because the target machine actively refused it." I did it before and it worked fine. I'm using Windows 10, which did an automatic update, and it could be this that messed it up. I attached a screen shot of the error. Thanks in advance!
Screenshot (33).png

Thibault BARTOLONE

unread,
Nov 13, 2018, 4:29:03 AM11/13/18
to mongod...@googlegroups.com
Check if a process already runs on that port

Run CMD as an administrator
Type : netstat -anb
Check if there's on process LISTENING to 0.0.0.0:27017 or 127.0.0.1:27017 


Le mar. 13 nov. 2018 à 10:07, 'George O'Gorman' via mongodb-user <mongod...@googlegroups.com> a écrit :
Hello. I'm doing a course on server-side apps and I'm stalled because I suddenly can't start Mongodb. It says, among other things: "No connection could be made because the target machine actively refused it." I did it before and it worked fine. I'm using Windows 10, which did an automatic update, and it could be this that messed it up. I attached a screen shot of the error. Thanks in advance!

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/bcd3f716-4bfa-4260-8918-3317d5283e37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

bibelo

unread,
Nov 13, 2018, 4:30:15 AM11/13/18
to mongodb-user
.

Check if a process already runs on that port

Run CMD as an administrator
Type : netstat -anb
Check if there's on process LISTENING to 0.0.0.0:27017 or 127.0.0.1:27017

Bob Cochran

unread,
Nov 13, 2018, 7:00:07 AM11/13/18
to mongod...@googlegroups.com
Assuming no one else has used your system and you think a Windows update is the culprit: Microsoft Windows 10 keeps a list of recent updates that it applied. You can check this list and examine what the update(s) have done. Possibly you can roll one or more updates back. Windows will set a restore point before applying updates so you can also restore your system from a restore point. 

Bob
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.

George O'Gorman

unread,
Nov 13, 2018, 5:44:34 PM11/13/18
to mongodb-user
There's a few LISTENING that are close to those addresses, but not exactly.

George O'Gorman

unread,
Nov 13, 2018, 5:53:12 PM11/13/18
to mongodb-user
Thanks, Bob. You think that's what happened? I'm just grasping at straws.

Robert Cochran

unread,
Nov 13, 2018, 6:08:30 PM11/13/18
to mongodb-user
Hi!

I am not sure what the cause of your issue is, since I can't be there with you to examine your system.

The issue could be very simple: MongoDB has to be installed on a 64 bit system, but you were trying to connect to it with command prompt that runs in 32 bit mode. I'm not sure since I do not run MongoDB on Windows 10. 

So you will need to do a little detective work. This link describes how to install MongoDB on Windows. Read it; perhaps that will refresh you on how you installed MongoDB and originally started it. 

The screen shot of the command prompt makes me wonder if you were trying to start MongoDB as a 32 bit process. It needs to run as a 64 bit process.

Thanks so much

Bob

George O'Gorman

unread,
Nov 13, 2018, 6:14:43 PM11/13/18
to mongodb-user
Hi, Bob. I got it to work that way before.

Robert Cochran

unread,
Nov 13, 2018, 7:23:33 PM11/13/18
to mongodb-user
Hi,

Let me correct an inaccuracy that I made in my earlier reply. Instead of saying 

"...if you were trying to start MongoDB as a 32 bit process..."

I should have said

"...if you were trying to connect to the mongod server through the mongo shell as a 32 bit process...". Maybe the mongo shell cannot run in a 32 bit command prompt. It might be a 64 bit process in addition to the server. I don't know.

There are 2 different ways to start the mongod server itself, which is one of the big reasons why I referred you to the installation documentation. You can do a little checking and discover how the server was installed and whether it starts as a service or on the command line. You can furthermore check whether the the server is running, by googling on how to check the status of a running process in Windows 10. You can check whether it was started but died, as well. I can't remember off the top of my head, but these are hints for you.

Then you can also check for another simple thing. Was the port number changed? Check the mongod.cfg file to discover what port the mongod server was told to connect to. You might need to connect to a different port than 27017. You can also check the Windows Firewall to find out if it shut down the port that mongod is listening on. If it has, then the server process will die, too, so you need to make sure the mongod port is open and available to the server for use e.g. it is not being shut down.

With some detective work I think you can find the cause of the issue. 

Thanks

Bob

George O'Gorman

unread,
Nov 13, 2018, 7:50:54 PM11/13/18
to mongodb-user
Ah, the Windows firewall was blocking it. I got it to work! Thanks, Bob!


On Tuesday, November 13, 2018 at 1:07:52 AM UTC-8, George O'Gorman wrote:

George O'Gorman

unread,
Nov 14, 2018, 6:50:22 PM11/14/18
to mongodb-user
Ug. Now I can't get it to work again.
Reply all
Reply to author
Forward
0 new messages