Error in Mongodb/Mongoose?

Asked

Viewed 123 times

0

I am trying to start my server, however while trying to start it accuses error in Mongodb, and I have been for hours looking for the solution to this problem and so far found nothing.

What’s even more complicated is the fact that I didn’t create this server, and I never used Mongoose, only Mongodb itself.

Follow error that appears in the console when I try to start the server:

{ MongoError: failed to connect to server [127.0.0.1:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
at Pool.<anonymous> (C:\Projetos\Server\node_modules\mongodb-core\lib\topologies\server.js:328:35)
at emitOne (events.js:96:13)
at Pool.emit (events.js:188:7)
at Connection.<anonymous> (C:\Projetos\Server\node_modules\mongodb-core\lib\connection\pool.js:280:12)
at Connection.g (events.js:292:16)
at emitTwo (events.js:106:13)
at Connection.emit (events.js:191:7)
at Socket.<anonymous> (C:\Projetos\Server\node_modules\mongodb-core\lib\connection\connection.js:177:49)
at Socket.g (events.js:292:16)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at emitErrorNT (net.js:1277:8)
at _combinedTickCallback (internal/process/next_tick.js:80:11)
at process._tickCallback (internal/process/next_tick.js:104:9)
name: 'MongoError',
message: 'failed to connect to server [127.0.0.1:27017] on first connect 
[MongoError: connect ECONNREFUSED 127.0.0.1:27017]' }
(node:8348) UnhandledPromiseRejectionWarning: Unhandled promise rejection 
(rejection id: 1): MongoError: failed to connect to server [127.0.0.1:27017] 
on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
  • 1

    First point is to see which process is running at the door that Ngo should be running

1 answer

0


The problem has been solved.

What happened was the following: the person who had the DB on her machine gave a commit on the server files, and for it was configured to try to access the Mongo on ip 127.0.0.1, and ended up configuring the same ip on my machine, giving error in access to the Mongo.

Childish mistake on my part...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.