3
$\begingroup$

The problem

How to access my MongoDB on Atlas from a Wolfram Notebook?

Following the Wolfram doc, I try this:

MongoConnect[<|
"Host"->"mongodb+srv://blu:[email protected]/",
"CAFile"->$MongoDefaultCAFile
|>].

Unfortunately, this ends up in an error message from the Mongo C Driver saying:

$\color{red}{\text{No suitable servers found}}$,
$\color{red}{\text{Timeout calling ismaster on 'cluster0-shard-00-01.wdvmm.mongodb.net:27017}}$

Debug

1)Error in the Connection String? No.

According to the Mongo Shell, the Connection String is OK:

"mongodb+srv://blu:[email protected]/"

Wolfram Notebook

2)Something on the local network?

According to HostLookup[] and Ping[], the Wolfram Notebook process is able to access the Mongo Server. enter image description here

3)Does is work with Mathematica? Yes

I don't have Mathematica on my machine, but according to @Domen (see comment), the call reach the Mongo Server that replies "Authentication failed".

An idea: when executed with Mathematica, the request to the MongoDB server comes from the local computer, but when executed with Wolfram Cloud, it comes from a Wolfram server. Can someone confirm this?

$\endgroup$
5
  • $\begingroup$ I think it is indeed Wolfram Cloud that is problematic. I get a different error (authentication failed) if I run your code in the desktop version of Mathematica. I strongly suggest you test your code on the desktop to see if the same problem appears. $\endgroup$ Commented May 5, 2024 at 9:42
  • $\begingroup$ I suggest you update your question with all the information you have about your troubleshooting process. Share the code you used to test and the response you get. Use the edit button. The comments should not become a long list of updates, so please delete the comments that become obsolete after your update. I will delete my comments. Think this Question should be useful not only for you but also for future readers. $\endgroup$ Commented May 5, 2024 at 10:45
  • $\begingroup$ I can confirm that MongoConnect to Atlas works fine on desktop, but it doesn't work on the Cloud (even after allowing access from any IP in Atlas). I suggest you contact Wolfram Technical Support, since the issue is specific to the Cloud, and it is unlikely we will be able to find a solution on our own ... $\endgroup$ Commented May 5, 2024 at 12:08
  • $\begingroup$ Thks Domen for your investigation. I'll refer to WTS! $\endgroup$ Commented May 5, 2024 at 12:56
  • $\begingroup$ Unfortunately, neither WTS nor the two authors of the package ever responded... $\endgroup$ Commented May 13, 2024 at 9:49

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.