Can no longer connect to my M220 Cluster (can't run tests or access via Compass)

Starting just today, I am no longer able to run any tests, even tests that I have previously run and passed. When I attempt, I get this error

 FAIL  test/user-management.test.js
  ● Test suite failed to run

    TypeError: Cannot read property 'close' of undefined

      17 | 
      18 |   async teardown() {
    > 19 |     await
         |                                   ^
      20 |     await super.teardown()
      21 |   }
      22 | 

      at MongoEnvironment.teardown (test/config/mongoEnvironment.js:19:35)
          at Generator.throw (<anonymous>)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        0.315s
Ran all test suites matching /user-management/i.
Teardown Mongo Connection
npm ERR! Test failed.  See above for more details.

I also cannot access my M220 Cluster via Compass. When I attempt, I get this error:

Oddly enough, if I attempt to access the cluster via the Mongo Shell, using the Standard Connection String provided on Atlas, I am able to access the database.

I am 99.99% confident that my URI string is correct inside of my projects .env file, and when connecting via Compass. This was all working just fine this whole past week.

Any ideas what might be going wrong here?

Hi @Damon_Bolesta_86576,

This may seem like a silly question, but did you check to make sure that the connection string that you are running via the Mongo Shell is the same as the one that you have saved in your .env file?

If so, with Compass opened (and running), if you copy your connection string from your .env file, Compass will (or should) automatically detect your connection string and prompt you with a question asking if you would like to connect.

Hope this helps :grinning:

1 Like

So, without having changed anything, my connection seems to be working again.

The only difference is that previously I was using the wifi in a Starbucks, and now I am using my home’s wifi.

…is there any reason why that would have been preventing my Cluster from connecting?

Internet at public Wifi probably only allow traffic from and to some ports.

1 Like

…and speaking of public wifi, I always use a VPN when I’m online in a public place. I’m not sure if this pertains to this particular issue, but I’ve noticed that sometimes it can act as a sort of firewall that blocks some connections.

1 Like

Ah, thanks guys. Seems as though this was a silly oversight on my part :sweat_smile:

1 Like

I have the same problem!
I have tried everything to connect via my compass.
I’m connecting to internet using my phone shared network.
I think this is the only reason I can’t connect.
By the way I suggest to show users better error message.

Have you allowed access from anywhere for your cluster?

If you only allowed from your current IP and your ISP provider gave you another address you must allowed the new address. For training, it is better to allow from anywhere.

Thats not an issue, its correctly configured to
Its not only compass problem.
I cant connect via node js to mflix app and continue my learning courses.

Post a screenshot of the what your are doing that shows the error you are having.

I get the same error is compass :
bad auth : Authentication failed.

And here is connection string for compass :
PS: My password AND username both are : Telamy20


The error bad auth : Authentication failed means wrong user name or password.

If your password is Telamy20, it is Telamy20 rather than <Telamy20>.

It is customary to using the less-than and greater-than to indicate a placeholder.

I thought <> is a part of the mongodb standard connection string format, now that <> are removed, it works like a charm everywhere.
I was about to getting VPN services to continue my learning path as I thought its connection related.
You saved my time and money, thank you so much dear [steevej-1495]! :slight_smile: