Unable to use mongo shell on Windows 10


I keep on getting an error trying mongo --nodb

C:\WINDOWS\system32>mongo --nodb
MongoDB shell version v4.2.0
2019-08-19T21:31:24.463+0200 F CONTROL [main] *** unhandled exception 0xE06D7363 at 0x00007FFE6BAEA839, terminating
2019-08-19T21:31:24.463+0200 F CONTROL [main] *** stack trace for unhandled exception:
2019-08-19T21:31:24.464+0200 I - [main] KERNELBASE.dll RaiseException+0x69
VCRUNTIME140.dll CxxThrowException+0xad
mongo.exe MallocExtension::GetMemoryReleaseRate+0x1ece40
mongo.exe MallocExtension::GetMemoryReleaseRate+0x1ecc1f
mongo.exe tc_mallopt+0xa52c
mongo.exe mozilla::detail::MutexImpl::~MutexImpl+0x866f
mongo.exe mozilla::detail::MutexImpl::~MutexImpl+0x2317
mongo.exe mozilla::detail::MutexImpl::~MutexImpl+0x8de5
mongo.exe tcmalloc::Log+0xaaf14
KERNEL32.DLL BaseThreadInitThunk+0x14
2019-08-19T21:31:24.465+0200 I CONTROL [main] writing minidump diagnostic file C:\Program Files\MongoDB\Server\4.2019-08-19T19-31-24.mdmp
2019-08-19T21:31:24.639+0200 F CONTROL [main] *** immediate exit due to unhandled exception

Any suggestion on how to fix this ?

This looks to be your Windows issue
What version you are using
May be this helps


It did not fix my issue.
I keep on getting the same error.

Please help

Hi @smaindron,

As @Ramachandra_37567 mentioned, this is an operating system related issue.

As you can see in the error message, KERNELBASE.dll file is throwing an exception. Please refer this post and see if any of the solution provided here works for you or not.

Please let me know if the issue still persists.

Shubham Ranjan
Curriculum Support Engineer

If anyone still have this problem here how i solved it,

when you follow the instructions you gonna get this string to copy
$ mongo "mongodb+srv://sandbox-XXXX.mongodb.net/test" --username m001-student
1 - Click on the cluster name (e.g. Sandbox if you followed the instructions).
2 - You gonna see three shards.
3 - Modify the connection string as follow:

mongo “mongodb://sandbox-shard-00-00-XXX.mongodb.net:27017,sandbox-shard-00-01-XXX.mongodb.net:27017,sandbox-shard-00-02-XXX.mongodb.net:27017/?replicaSet=Sandbox-shard-0” --authenticationDatabase admin --username m001-student --password m001-mongodb-basics --tls

The string part in Bold are the shards found in step 3, separated by comma.

Why would you want to use the old style (mongodb://) connection string when the new one (mongodb+srv://) is more convenient?

Only a single server may be specified with a mongo+srv:// url.

You should read about https://docs.mongodb.com/manual/reference/connection-string/#connections-dns-seedlist.

Use of the +srv connection string modifier automatically sets the tls (or the equivalent ssl ) option to true for the connection. You can override this behavior by explicitly setting the tls (or the equivalent ssl ) option to false with tls=false (or ssl=false ) in the query string.

in my answer i added the --tls flag so i don’t see where is the problem.

The convenience of a DNS SRV record has nothing to do with tls or ssl.

It is about having not to know on the client side the list of hosts/ports member of the cluster. This way this list can change while having no impact on how the clients connect.

1 Like

Hi @Abdelmounaim_50221,

I agree with what @steevej-1495 has suggested. By the way, what issue did you face with the srv connection string ?

~ Shubham