vkarpov15 / run-rs

Zero-config MongoDB runner. Starts a replica set with no non-Node dependencies, not even MongoDB.
Apache License 2.0
265 stars 36 forks source link

ECONNRESET on Windows #45

Open andreialecu opened 4 years ago

andreialecu commented 4 years ago

See below:

PS D:\> run-rs --keep --host 192.168.100.5
Skipping purge
Running 'C:\Users\x\AppData\Roaming\nvm\v12.8.0\node_modules\run-rs\4.0.12\mongod.exe' [ 27017, 27018, 27019 ]
Restarting replica set...
events.js:180
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:183:27)
Emitted 'error' event at:
    at Socket.<anonymous> (C:\Users\x\AppData\Roaming\nvm\v12.8.0\node_modules\run-rs\node_modules\mongodb-core\lib\connection\connection.js:321:10)
    at Object.onceWrapper (events.js:291:20)
    at Socket.emit (events.js:203:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at processTicksAndRejections (internal/process/task_queues.js:77:11) {
  name: 'MongoNetworkError',
  errorLabels: [ 'TransientTransactionError' ],
  [Symbol(mongoErrorContextSymbol)]: {}
}
andreialecu commented 4 years ago

Same without the --host option. I only added it to troubleshoot.

andreialecu commented 4 years ago

Seems to be some sort of error with the data directory, the same data directory works when using Windows Subsystem for Linux. Maybe there's some incompatibility between Mongo for Linux and Win32's data directories.

Running it without --keep seems to make it start properly.

Would be nice to print the actual error that stopped the replica set from starting.

JadenH commented 4 years ago

I also came across this issue, and it only occurred the first time I used run-rs. After a data directory gets created you can use the -k flag again and it works. Might have something to do with the purging and/or creating a data directory?

markmacumber commented 4 years ago

thanks for commenting @JadenH - this worked for me too

paglias commented 4 years ago

We're having a similar issue but in our case even the second time the command is run we get the same error, the only way to get it working is to first run it without --keep and then with