Open mtrezza opened 4 days ago
It seems that there is an issue with mongo stop all
here a server created
> mongodb-runner start -t standalone
Server started and running at mongodb://127.0.0.1:54879/
Run the following command to stop the instance:
mongodb-runner stop --id=1ef1f912-597f-4e2e-9f2c-c63d4ed99801
Then an error on mongo stop all
> mongodb-runner stop --all
/Users/antoinecormouls/Desktop/Repos/parse/parse-server/node_modules/mongodb-runner/dist/cli.js:170
throw err;
^
MongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017
at Topology.selectServer (/Users/antoinecormouls/Desktop/Repos/parse/parse-server/node_modules/mongodb/lib/sdam/topology.js:303:38)
at async Topology._connect (/Users/antoinecormouls/Desktop/Repos/parse/parse-server/node_modules/mongodb/lib/sdam/topology.js:196:28)
at async Topology.connect (/Users/antoinecormouls/Desktop/Repos/parse/parse-server/node_modules/mongodb/lib/sdam/topology.js:158:13)
at async topologyConnect (/Users/antoinecormouls/Desktop/Repos/parse/parse-server/node_modules/mongodb/lib/mongo_client.js:223:17)
at async MongoClient._connect (/Users/antoinecormouls/Desktop/Repos/parse/parse-server/node_modules/mongodb/lib/mongo_client.js:236:13)
at async MongoClient.connect (/Users/antoinecormouls/Desktop/Repos/parse/parse-server/node_modules/mongodb/lib/mongo_client.js:161:13)
at async MongoClient.connect (/Users/antoinecormouls/Desktop/Repos/parse/parse-server/node_modules/mongodb/lib/mongo_client.js:322:16)
at async MongoServer.withClient (/Users/antoinecormouls/Desktop/Repos/parse/parse-server/node_modules/mongodb-runner/dist/mongoserver.js:221:24)
The stop system seems to try to connect to a 27017 port but there is no instances on this port
Edit
I found that Mongo instances are referenced or stored globally, such as under: /Users/antoinecormouls/.mongodb/runner2. There are some ghost references, causing the system to try to connect to and close already-closed runners.
Bug Report
Current Behavior
When running
mongodb-runner stop --all
, the following error is thrown and the MongoDB instance is not stopped:Code/Gist
Expected Behavior/Code
MongoDB instance should be stopped, no error thrown.
Environment