MongoDB Atas Connection Error

Yesterday, I ran some code on my own computer that successfully connected to MongoDB Atlas. Next, I transferred my project to the virtual server and then added the IP address of my virtual server to Atlas’ Network Access. Then I tried to run my code on my virtual server, but I got an error like in the image I added. Then I did research on Atlas’ forums. It was written there that there might be some problems due to proxy/VPN, but already 2 more projects connected to Atlas are running without errors on the same virtual server. Again, while browsing the forum, a user wrote that he received a similar error and that his problem was resolved when he opened an account with another Gmail account. I tried the same thing but my problem was not solved. And yes I tried 0.0.0.0/0 and got the connection error again.

I tried older versions of Mongoose and MongoDB. There, the connection was successful only once and then I started getting the same error. Then I updated to the latest version and the problem fixed itself. I didn’t understand anything, but my problem resolved itself.