[SERVER-36088] Replica set connection strings trigger access violation on 4.0 shell + Windows Created: 12/Jul/18  Updated: 04/Sep/18  Resolved: 02/Aug/18

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 4.0.0
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Carlos Roberto Campos Assignee: Nick Brewer
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Win10 running on VMWare on Mac


Issue Links:
Duplicate
duplicates SERVER-35125 null pointer read access violation in... Closed
is duplicated by SERVER-36158 While connectng to Atlas, we get acce... Closed
is duplicated by SERVER-36348 unable to connect to cluster Closed
Problem/Incident
is caused by SERVER-35125 null pointer read access violation in... Closed
Participants:

 Description   

I am having this error while trying to use Shell to connect to the atlas server. This is running in a Virtual Windows 10, running from a MacBook using VMWare Fusion. I was able to connect to the local server from the Win10, plus I as able to install the Shell in the Mac itself and the same connection string worked fine. I tried giving more permissions do the mongodb directory plus running the Command Prompt with Administrative rights with no success. Here is the details for the error

C:\Program Files\MongoDB\Server\4.0>mongo "mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?replicaSet=Cluster0-shard-0" --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics
MongoDB shell version v4.0.0 connecting to: mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017/test?replicaSet=Cluster0-shard-0
2018-07-06T19:20:11.682-0600 I NETWORK [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-00-jxeqq.mongodb.net:27017,cluster0-shard-00-01-jxeqq.mongodb.net:27017,cluster0-shard-00-02-jxeqq.mongodb.net:27017
2018-07-06T19:20:12.113-0600 I CONTROL [js] ** unhandled exception (access violation) at 0x00007FF8CE72C517, terminating
2018-07-06T19:20:12.113-0600 I CONTROL [js] access violation was a read from 0x0
2018-07-06T19:20:12.114-0600 I CONTROL [js] *stack trace for unhandled exception:
2018-07-06T19:20:12.113-0600 I CONTROL [ReplicaSetMonitor-TaskExecutor] unhandled exception (access violation) at 0x00007FF8CE72C517, terminating
2018-07-06T19:20:12.115-0600 I CONTROL [ReplicaSetMonitor-TaskExecutor] **access violation was a read from 0x0
2018-07-06T19:20:12.115-0600 I CONTROL [ReplicaSetMonitor-TaskExecutor] ** stack trace for unhandled exception:
2018-07-06T19:20:12.117-0600 I - [js] VCRUNTIME140.dll memmove+0x87x mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? ucrtbase.dll o_strcat_s+0x94x KERNEL32.DLL BaseThreadInitThunk+0x20x
2018-07-06T19:20:12.119-0600 I CONTROL [js] writing minidump diagnostic file C:\Program Files\MongoDB\Server\4.2018-07-07T01-20-12.mdmp
2018-07-06T19:20:12.119-0600 I - [ReplicaSetMonitor-TaskExecutor] VCRUNTIME140.dll memmove+0x87x mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? mongo.exe ??? ucrtbase.dll o_strcat_s+0x94x KERNEL32.DLL BaseThreadInitThunk+0x20x
2018-07-06T19:20:12.120-0600 I CONTROL [ReplicaSetMonitor-TaskExecutor] failed to open minidump file C:\Program Files\MongoDB\Server\4.2018-07-07T01-20-12.mdmp : The process cannot access the file because it is being used by another process.
2018-07-06T19:20:12.123-0600 I CONTROL [ReplicaSetMonitor-TaskExecutor] __immediate exit due to unhandled exception



 Comments   
Comment by Carlos Roberto Campos [ 19/Jul/18 ]

Awesome Nick!!!

Comment by Nick Brewer [ 19/Jul/18 ]

ccamposh I've tested connecting to an Atlas cluster via a SRV record using the 4.0.1 shell on a Windows, and I can confirm that it's working. That error message does indicate a connectivity issue, and I can recreate it myself by disabling external access to my Atlas cluster - as a test, you could try temporarily whitelisting all external addresses on your Atlas cluster to verify this.

Since the underlying bug in this case has been resolved, I'm going to close this ticket. Thanks again for bringing this to our attention. 

Nick

Comment by Andrew Morrow (Inactive) [ 18/Jul/18 ]

Thanks ccamposh for trying out the newer shell. I'm quite confident now that the indicated SERVER ticket was the cause of your crash.

Comment by Carlos Roberto Campos [ 18/Jul/18 ]

After running this Mongo version, the exception has changed, but still having issues to connect. I verified the internet connection and the port access and everything is fine. At the same time, I ran the mongo 4.0 in the host mac machine and it is capable to connect, so it does not appear to be a network issue.  

C:\Users\ccamp>mongo "mongodb+srv://cluster0-dqa4s.mongodb.net/test" --username ccamposh
MongoDB shell version v4.0.0-106-g9c0c1bd5b8
Enter password:
connecting to: mongodb+srv://cluster0-dqa4s.mongodb.net/test
2018-07-18T14:31:16.104-0600 I NETWORK [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-00-dqa4s.mongodb.net.:27017,cluster0-shard-00-01-dqa4s.mongodb.net.:27017,cluster0-shard-00-02-dqa4s.mongodb.net.:27017
2018-07-18T14:31:16.704-0600 W NETWORK [ReplicaSetMonitor-TaskExecutor] Unable to reach primary for set Cluster0-shard-0
2018-07-18T14:31:16.705-0600 I NETWORK [ReplicaSetMonitor-TaskExecutor] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.
2018-07-18T14:31:17.789-0600 W NETWORK [js] Unable to reach primary for set Cluster0-shard-0
2018-07-18T14:31:17.790-0600 I NETWORK [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 2 checks in a row.
2018-07-18T14:31:18.814-0600 W NETWORK [js] Unable to reach primary for set Cluster0-shard-0
2018-07-18T14:31:18.815-0600 I NETWORK [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 3 checks in a row.
2018-07-18T14:31:19.849-0600 W NETWORK [js] Unable to reach primary for set Cluster0-shard-0
2018-07-18T14:31:19.850-0600 I NETWORK [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 4 checks in a row.
2018-07-18T14:31:21.215-0600 W NETWORK [js] Unable to reach primary for set Cluster0-shard-0
2018-07-18T14:31:21.215-0600 I NETWORK [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 5 checks in a row.
2018-07-18T14:31:22.389-0600 W NETWORK [js] Unable to reach primary for set Cluster0-shard-0
2018-07-18T14:31:22.389-0600 I NETWORK [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 6 checks in a row.
2018-07-18T14:31:23.435-0600 W NETWORK [js] Unable to reach primary for set Cluster0-shard-0
2018-07-18T14:31:23.436-0600 I NETWORK [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 7 checks in a row.
2018-07-18T14:31:24.462-0600 W NETWORK [js] Unable to reach primary for set Cluster0-shard-0
2018-07-18T14:31:24.462-0600 I NETWORK [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 8 checks in a row.
2018-07-18T14:31:25.625-0600 W NETWORK [js] Unable to reach primary for set Cluster0-shard-0
2018-07-18T14:31:25.625-0600 I NETWORK [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 9 checks in a row.
2018-07-18T14:31:27.176-0600 W NETWORK [js] Unable to reach primary for set Cluster0-shard-0
2018-07-18T14:31:27.177-0600 I NETWORK [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 10 checks in a row.
2018-07-18T14:31:28.028-0600 I NETWORK [js] Successfully connected to cluster0-shard-00-01-dqa4s.mongodb.net.:27017 (1 connections now open to cluster0-shard-00-01-dqa4s.mongodb.net.:27017 with a 5 second timeout)
2018-07-18T14:31:28.102-0600 I NETWORK [js] changing hosts to Cluster0-shard-0/cluster0-shard-00-00-dqa4s.mongodb.net:27017,cluster0-shard-00-01-dqa4s.mongodb.net:27017,cluster0-shard-00-02-dqa4s.mongodb.net:27017 from Cluster0-shard-0/cluster0-shard-00-00-dqa4s.mongodb.net.:27017,cluster0-shard-00-01-dqa4s.mongodb.net.:27017,cluster0-shard-00-02-dqa4s.mongodb.net.:27017
2018-07-18T14:31:29.658-0600 W NETWORK [js] Unable to reach primary for set Cluster0-shard-0
2018-07-18T14:31:29.659-0600 I NETWORK [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.
2018-07-18T14:31:30.690-0600 W NETWORK [js] Unable to reach primary for set Cluster0-shard-0
2018-07-18T14:31:30.692-0600 I NETWORK [js] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 2 checks in a row.
2018-07-18T14:31:30.705-0600 E QUERY [js] Error: connect failed to replica set Cluster0-shard-0/cluster0-shard-00-00-dqa4s.mongodb.net.:27017,cluster0-shard-00-01-dqa4s.mongodb.net.:27017,cluster0-shard-00-02-dqa4s.mongodb.net.:27017 :
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:6
exception: connect failed

Comment by Andrew Morrow (Inactive) [ 18/Jul/18 ]

ccamposh - Even better, please use this link to get the most recent v4.0.1-pre build of just the shell: https://s3.amazonaws.com/mciuploads/mongodb-mongo-v4.0/windows-64-2k8-ssl/9c0c1bd5b8cc3ba6b9990fb58cbdf5cde575c634/binaries/mongo-shell-mongodb_mongo_v4.0_windows_64_2k8_ssl_9c0c1bd5b8cc3ba6b9990fb58cbdf5cde575c634_18_07_13_23_36_00.zip

Comment by Andrew Morrow (Inactive) [ 18/Jul/18 ]

ccamposh - My apologies, v4.0.1 hasn't quite yet been released. However, you should be able to try the latest v4.0 nightly builds. You can download them from the downloads ceneter by selecting "v4.0 nightly" from https://www.mongodb.com/download-center#development.

Comment by Andrew Morrow (Inactive) [ 18/Jul/18 ]

Hi ccamposh - Would you please try the v4.0.1 shell? I suspect that you are encountering SERVER-35125, which was fixed in v4.0.1.

Comment by Nick Brewer [ 16/Jul/18 ]

ccamposh,

Thanks for your report. I've managed to recreate this in my testing, and I've passed this along to our platform team for additional investigation. In the meantime, you can use the version 3.6.6 shell to connect to your Atlas cluster.

Nick

Generated at Thu Feb 08 04:41:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.