Failed to connect to cluster

While connecting to Cluster I am getting following error
Failed global initialization: BadValue need to either provide sslCAFile or specify sslAllowInvalidCertificates

Hi,

How are you connecting to the Atlas cluster? It might be that you are using a virtual machine … I would recommend to just use the mongo shell in your local PC, no VMs or containers are needed, just the mongo shell.

José Carlos

Hello

I am connecting thru normal terminal. Not using any VM

VEDAGGUB-M-D2BV:~ vedaggub$ 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/aggregations?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --ssl

Failed global initialization: BadValue need to either provide sslCAFile or specify sslAllowInvalidCertificates

I also tried using while mongo started

VEDAGGUB-M-D2BV:~ vedaggub$ mongo

MongoDB shell version: 3.0.15

connecting to: test

Server has startup warnings:

2018-10-20T13:50:38.402-0400 I CONTROL [initandlisten]

2018-10-20T13:50:38.402-0400 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000

> 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/aggregations?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --ssl

2018-10-22T07:38:07.269-0400 E QUERY SyntaxError: Unexpected string

I have installed Mongo 3.x.y as I am also taking mongo for java.

I don’t see any other difference

thanks for your help

Hi,

I would upgrade to version 3.6 or later, it looks like you are using an old version:

Anyway, try adding the --sslAllowInvalidCertificates option.

José Carlos

HI José Carlos,

tried with extra option now I am getting different error.

giving stack trace here.

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/aggregations?replicaSet=Cluster0-shard-0
2018-10-22T10:29:13.146-0400 I - Assertion failure _setName.size() src/mongo/client/dbclientinterface.h 240
2018-10-22T10:29:13.152-0400 I CONTROL
0x1054564ca 0x1053faf0e 0x1053e6498 0x1052df59f 0x1052cc446 0x1053ab64d 0x10539e712 0x10555ddf2 0xf0a67006362
----- BEGIN BACKTRACE -----
{“backtrace”:[{“b”:“105289000”,“o”:“1CD4CA”,“s”:"_ZN5mongo15printStackTraceERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEE"},{“b”:“105289000”,“o”:“171F0E”,“s”:"_ZN5mongo10logContextEPKc"},{“b”:“105289000”,“o”:“15D498”,“s”:"_ZN5mongo12verifyFailedEPKcS1_j"},{“b”:“105289000”,“o”:“5659F”,“s”:“ZN5mongo16ConnectionStringC2ENS0_14ConnectionTypeERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA”},{“b”:“105289000”,“o”:“43446”,“s”:“ZN5mongo16ConnectionString5parseERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERS7”},{“b”:“105289000”,“o”:“12264D”,“s”:"_ZN5mongo17mongoConsExternalEPNS_7V8ScopeERKN2v89ArgumentsE"},{“b”:“105289000”,“o”:“115712”,“s”:"_ZN5mongo7V8Scope10v8CallbackERKN2v89ArgumentsE"},{“b”:“105289000”,“o”:“2D4DF2”,“s”:"_ZN2v88internalL30Builtin_HandleApiCallConstructENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE"},{“b”:“0”,“o”:“F0A67006362”}],“processInfo”:{ “mongodbVersion” : “3.0.15”, “gitVersion” : “b8ff507269c382bc100fc52f75f48d54cd42ec3b”, “uname” : { “sysname” : “Darwin”, “release” : “16.7.0”, “version” : “Darwin Kernel Version 16.7.0: Tue Jan 30 11:27:06 PST 2018; root:xnu-3789.73.11~1/RELEASE_X86_64”, “machine” : “x86_64” }, “somap” : [ { “path” : “/usr/local/bin/mongo”, “machType” : 2, “b” : “105289000”, “vmaddr” : “100000000”, “buildId” : “3F3AE461D5F53ECDBDC417726793A0F8” }, { “path” : “/usr/lib/libssl.0.9.8.dylib”, “machType” : 6, “b” : “7FFF8BCC3000”, “vmaddr” : “7FFF8A899000”, “buildId” : “3B6EAD4BF7FA369CAB54755B08219D2A” }, { “path” : “/usr/lib/libcrypto.0.9.8.dylib”, “machType” : 6, “b” : “7FFF8ACAF000”, “vmaddr” : “7FFF89885000”, “buildId” : “B34BC0FA18ED37C59D46393803CADEBB” }, { “path” : “/usr/lib/libSystem.B.dylib”, “machType” : 6, “b” : “7FFF8AA10000”, “vmaddr” : “7FFF895E6000”, “buildId” : “F3BF9DA97FF13B43A33F3481DF9C8A82” }, { “path” : “/usr/lib/libc++.1.dylib”, “machType” : 6, “b” : “7FFF8AB4A000”, “vmaddr” : “7FFF89720000”, “buildId” : “0B43BB5DE6EB34648DE9B41AC8ED9D1C” }, { “path” : “/System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/TrustEvaluationAgent”, “machType” : 6, “b” : “7FFF8947E000”, “vmaddr” : “7FFF88054000”, “buildId” : “EBE65DD5173237478C6C7BECEBF089A4” }, { “path” : “/usr/lib/libz.1.dylib”, “machType” : 6, “b” : “7FFF8BEBD000”, “vmaddr” : “7FFF8AA93000”, “buildId” : “46E3FFA24328327A8D34A03E20BFFB8E” }, { “path” : “/usr/lib/system/libcache.dylib”, “machType” : 6, “b” : “7FFF8BEDD000”, “vmaddr” : “7FFF8AAB3000”, “buildId” : “093A4DAB83853D47A350E20CB7CCF7BF” }, { “path” : “/usr/lib/system/libcommonCrypto.dylib”, “machType” : 6, “b” : “7FFF8BEE2000”, “vmaddr” : “7FFF8AAB8000”, “buildId” : “8A64D1B0C70E385C92F0E669079FDA90” }, { “path” : “/usr/lib/system/libcompiler_rt.dylib”, “machType” : 6, “b” : “7FFF8BEED000”, “vmaddr” : “7FFF8AAC3000”, “buildId” : “55D47421772A32ABB5291A46C2F43B4D” }, { “path” : “/usr/lib/system/libcopyfile.dylib”, “machType” : 6, “b” : “7FFF8BEF5000”, “vmaddr” : “7FFF8AACB000”, “buildId” : “819BEA3CDF113E3DA1A15A51C5BF1961” }, { “path” : “/usr/lib/system/libcorecrypto.dylib”, “machType” : 6, “b” : “7FFF8BEFE000”, “vmaddr” : “7FFF8AAD4000”, “buildId” : “65D7165E2E71335DA2D633F78E2DF0C1” }, { “path” : “/usr/lib/system/libdispatch.dylib”, “machType” : 6, “b” : “7FFF8BF82000”, “vmaddr” : “7FFF8AB58000”, “buildId” : “6582BAD6ED273B30B62090B1C5A4AE3C” }, { “path” : “/usr/lib/system/libdyld.dylib”, “machType” : 6, “b” : “7FFF8BFB4000”, “vmaddr” : “7FFF8AB8A000”, “buildId” : “00117F795DB837D99AAFBEE7B1601E75” }, { “path” : “/usr/lib/system/libkeymgr.dylib”, “machType” : 6, “b” : “7FFF8BFBA000”, “vmaddr” : “7FFF8AB90000”, “buildId” : “7AA011A9DC213488BF733B5B14D1FDD6” }, { “path” : “/usr/lib/system/liblaunch.dylib”, “machType” : 6, “b” : “7FFF8BFC8000”, “vmaddr” : “7FFF8AB9E000”, “buildId” : “B856ABD2896E3DE0B2C8146A6AF8E2A7” }, { “path” : “/usr/lib/system/libmacho.dylib”, “machType” : 6, “b” : “7FFF8BFC9000”, “vmaddr” : “7FFF8AB9F000”, “buildId” : “17D5D855F6C33B04B680E9BF02EF8AED” }, { “path” : “/usr/lib/system/libquarantine.dylib”, “machType” : 6, “b” : “7FFF8BFCF000”, “vmaddr” : “7FFF8ABA5000”, “buildId” : “12448CC2378E35F3BE339DC395A5B970” }, { “path” : “/usr/lib/system/libremovefile.dylib”, “machType” : 6, “b” : “7FFF8BFD2000”, “vmaddr” : “7FFF8ABA8000”, “buildId” : “38D4CB9C10CD30D38B7BA515EC75FE85” }, { “path” : “/usr/lib/system/libsystem_asl.dylib”, “machType” : 6, “b” : “7FFF8BFD4000”, “vmaddr” : “7FFF8ABAA000”, “buildId” : “096E42283B7C30A68B13EC909A64499A” }, { “path” : “/usr/lib/system/libsystem_blocks.dylib”, “machType” : 6, “b” : “7FFF8BFED000”, “vmaddr” : “7FFF8ABC3000”, “buildId” : “10DC540473AB35B3A277A8AFECB476EB” }, { “path” : “/usr/lib/system/libsystem_c.dylib”, “machType” : 6, “b” : “7FFF8BFEE000”, “vmaddr” : “7FFF8ABC4000”, “buildId” : “E5AE52447D0C36AC8BB6C7AE7EA52A4B” }, { “path” : “/usr/lib/system/libsystem_configuration.dylib”, “machType” : 6, “b” : “7FFF8C07C000”, “vmaddr” : “7FFF8AC52000”, “buildId” : “BECC01A2CA8D31E6BCDFD452965FA976” }, { “path” : “/usr/lib/system/libsystem_coreservices.dylib”, “machType” : 6, “b” : “7FFF8C080000”, “vmaddr” : “7FFF8AC56000”, “buildId” : “7D26DE79B424345085E1F7FAB32714AB” }, { “path” : “/usr/lib/system/libsystem_coretls.dylib”, “machType” : 6, “b” : “7FFF8C084000”, “vmaddr” : “7FFF8AC5A000”, “buildId” : “EC6FCF07DCFB3A039CC96DD3709974C6” }, { “path” : “/usr/lib/system/libsystem_dnssd.dylib”, “machType” : 6, “b” : “7FFF8C09D000”, “vmaddr” : “7FFF8AC73000”, “buildId” : “CC9602150B1B3822A13A3DDE96FA796F” }, { “path” : “/usr/lib/system/libsystem_info.dylib”, “machType” : 6, “b” : “7FFF8C0A4000”, “vmaddr” : “7FFF8AC7A000”, “buildId” : “611DB84CBF703F928702B9F28A900920” }, { “path” : “/usr/lib/system/libsystem_kernel.dylib”, “machType” : 6, “b” : “7FFF8C0CE000”, “vmaddr” : “7FFF8ACA4000”, “buildId” : “77F5E77CFE5F3C5B8074D1FEEC85BD91” }, { “path” : “/usr/lib/system/libsystem_m.dylib”, “machType” : 6, “b” : “7FFF8C0F1000”, “vmaddr” : “7FFF8ACC7000”, “buildId” : “86D499B5BBDC3D3B8A4E97AE8E6672A4” }, { “path” : “/usr/lib/system/libsystem_malloc.dylib”, “machType” : 6, “b” : “7FFF8C139000”, “vmaddr” : “7FFF8AD0F000”, “buildId” : “A3D15F1799A633678C7E4280E8619C95” }, { “path” : “/usr/lib/system/libsystem_network.dylib”, “machType” : 6, “b” : “7FFF8C158000”, “vmaddr” : “7FFF8AD2E000”, “buildId” : “369D022156CA3C3E9EDE94B41CAE77B7” }, { “path” : “/usr/lib/system/libsystem_networkextension.dylib”, “machType” : 6, “b” : “7FFF8C1B2000”, “vmaddr” : “7FFF8AD88000”, “buildId” : “B021F2B38A753633ABB0FC012B8E9B0C” }, { “path” : “/usr/lib/system/libsystem_notify.dylib”, “machType” : 6, “b” : “7FFF8C1BC000”, “vmaddr” : “7FFF8AD92000”, “buildId” : “B8160190A0693B3ABDF62AA408221FAE” }, { “path” : “/usr/lib/system/libsystem_platform.dylib”, “machType” : 6, “b” : “7FFF8C1C6000”, “vmaddr” : “7FFF8AD9C000”, “buildId” : “897462FDB318321BA554E61982630F7E” }, { “path” : “/usr/lib/system/libsystem_pthread.dylib”, “machType” : 6, “b” : “7FFF8C1CF000”, “vmaddr” : “7FFF8ADA5000”, “buildId” : “B8FB5E20329539E2B5EBB464D1D4B104” }, { “path” : “/usr/lib/system/libsystem_sandbox.dylib”, “machType” : 6, “b” : “7FFF8C1DA000”, “vmaddr” : “7FFF8ADB0000”, “buildId” : “19320A422E3B361BBBDA2F5F2E87B100” }, { “path” : “/usr/lib/system/libsystem_secinit.dylib”, “machType” : 6, “b” : “7FFF8C1DE000”, “vmaddr” : “7FFF8ADB4000”, “buildId” : “F78B847B35653E4B98A6F7AD40392E2D” }, { “path” : “/usr/lib/system/libsystem_symptoms.dylib”, “machType” : 6, “b” : “7FFF8C1E0000”, “vmaddr” : “7FFF8ADB6000”, “buildId” : “3390E07CC1CE348FADBD2C5440B45EAA” }, { “path” : “/usr/lib/system/libsystem_trace.dylib”, “machType” : 6, “b” : “7FFF8C1E8000”, “vmaddr” : “7FFF8ADBE000”, “buildId” : “AC63A7FE50D93A3096E6F6B7FF16E465” }, { “path” : “/usr/lib/system/libunwind.dylib”, “machType” : 6, “b” : “7FFF8C1FC000”, “vmaddr” : “7FFF8ADD2000”, “buildId” : “3D50D8A8C460334DA5192DA841102C6B” }, { “path” : “/usr/lib/system/libxpc.dylib”, “machType” : 6, “b” : “7FFF8C202000”, “vmaddr” : “7FFF8ADD8000”, “buildId” : “BF896DF0D8E931A8A4B301120BFEEE52” }, { “path” : “/usr/lib/libobjc.A.dylib”, “machType” : 6, “b” : “7FFF8B6BE000”, “vmaddr” : “7FFF8A294000”, “buildId” : “70614861034032E285EDFE65759CDFFA” }, { “path” : “/usr/lib/libc++abi.dylib”, “machType” : 6, “b” : “7FFF8ABA1000”, “vmaddr” : “7FFF89777000”, “buildId” : “BC271AD3831B362A9DA7E8C51F285FE4” } ] }}
mongo(_ZN5mongo15printStackTraceERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEE+0x3A) [0x1054564ca]
mongo(_ZN5mongo10logContextEPKc+0x10E) [0x1053faf0e]
mongo(_ZN5mongo12verifyFailedEPKcS1_j+0x1D8) [0x1053e6498]
mongo(ZN5mongo16ConnectionStringC2ENS0_14ConnectionTypeERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA+0x17F) [0x1052df59f]
mongo(ZN5mongo16ConnectionString5parseERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERS7+0x76) [0x1052cc446]
mongo(_ZN5mongo17mongoConsExternalEPNS_7V8ScopeERKN2v89ArgumentsE+0x12D) [0x1053ab64d]
mongo(_ZN5mongo7V8Scope10v8CallbackERKN2v89ArgumentsE+0x52) [0x10539e712]
mongo(_ZN2v88internalL30Builtin_HandleApiCallConstructENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE+0x232) [0x10555ddf2]
??? [0xf0a67006362]
----- END BACKTRACE -----
2018-10-22T10:29:13.155-0400 E QUERY Error: assertion src/mongo/client/dbclientinterface.h:240
at connect (src/mongo/shell/mongo.js:181:14)
at (connect):1:6 at src/mongo/shell/mongo.js:181
exception: connect failed

Hello ,

I have upgraded MongoDB to 3.6. now I am able to cluster. thanks for your help.

thanks
Veeranjaneyulu

Glad you managed to solve it!

Hi All,

Greetings,

I am new to this space…

My issue is somewhere related to this , hence pasting here, can someone please help me to understand…what’s going wrong, as sometimes I get it fixed after upgrading mongo shell client version to > 3.6

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

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:2701
7/test?replicaSet=Cluster0-shard-0” --authenticationDatabase admin --ssl --username m001-student --password m001-mongodb-basics
MongoDB shell version: 2.6.10
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.ne
t:27017/test?replicaSet=Cluster0-shard-0
2019-06-19T08:11:02.307+0000 Assertion failure _setName.size() src/mongo/client/dbclientinterface.h 231
2019-06-19T08:11:02.307+0000 0x6b75c9 0x659e9f 0x636a32 0x5013b8 0x4fa7f1 0x6006fd 0x5eb869 0x7fd9f202fd76 0xb89a2606362
mongo(_ZN5mongo15printStackTraceERSo+0x39) [0x6b75c9]
mongo(_ZN5mongo10logContextEPKc+0x21f) [0x659e9f]
mongo(_ZN5mongo12verifyFailedEPKcS1_j+0x142) [0x636a32]
mongo(ZN5mongo16ConnectionStringC1ENS0_14ConnectionTypeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9+0x208) [0x5013b8]
mongo(ZN5mongo16ConnectionString5parseERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERS6+0x201) [0x4fa7f1]
mongo(_ZN5mongo17mongoConsExternalEPNS_7V8ScopeERKN2v89ArgumentsE+0x11d) [0x6006fd]
mongo(_ZN5mongo7V8Scope10v8CallbackERKN2v89ArgumentsE+0xa9) [0x5eb869]
/usr/lib/libv8.so.3.14.5(+0x99d76) [0x7fd9f202fd76]
[0xb89a2606362]
2019-06-19T08:11:02.309+0000 Error: assertion src/mongo/client/dbclientinterface.h:231 at src/mongo/shell/mongo.js:148
exception: connect failed
mongo --version
MongoDB shell version: 2.6.10

db.version()
4.0.10

Above pasted the log, which I am trying to connect to the Atlas cluster for some queries.

Thanks :slight_smile:

@pathakpk

Please notice that this thread is almost a year old and has been closed. If you have a problem, open a new thread. Thanks.