felipenoris / Mongoc.jl

MongoDB driver for the Julia Language
https://felipenoris.github.io/Mongoc.jl/stable
Other
80 stars 21 forks source link

OS PI and Ubuntu : BSONError: domain=15, code=13053, message=No suitable servers found #87

Open mackyo opened 2 years ago

mackyo commented 2 years ago

OS PI and Ubuntu : BSONError: domain=15, code=13053, message=No suitable servers found I only get this on OS pi and Ubuntu, windows never has this problem. I've tried the openssl things Original looks like this-- This works everywhere except it get the 13053 error after about 20 min on OS Pi and one Ubuntu sometimes:

ping = Mongoc.BSON("ok" => 0.0)

while ping["ok"] == 0.0 client = Mongoc.Client("mongodb://mack:texas23x@192.168.254.91/?authSource=test") ping = Mongoc.ping(client) end

esdatabase = client["espace"] msdatabase = client["msys"] eqdatabase = client["equipment"] progdatabase = client["programs"] commdatabase = client["comments"]

then I added this - same result: try s.temp6 = strip(read(hostname, String)) catch s.temp6 = "" end if length(s.temp6) >= 12 if s.temp6[1:11] == "raspberrypi" while ping["ok"] == 0.0 println("Raspberry PI") suffix = "?tlsCAFile=/home/pi/julia-1.6.3/share/julia/cert.pem" global client = Mongoc.Client("mongodb://mack:texas23x@192.168.254.91/?authSource=test"*suffix) global ping = Mongoc.ping(client) end end end

Then I thought maybe I had too much going on with just one client.. SO I did this - I don't really understand pools.. same result as original:

    REPLICA_SET_URL ="mongodb://mack:texas23x@192.168.254.91/?authSource=test"
    pool = Mongoc.ClientPool(REPLICA_SET_URL, max_size=10)
    client1 = Mongoc.Client(pool)
    client2 = Mongoc.Client(pool)
    client3 = Mongoc.Client(pool)
    client4 = Mongoc.Client(pool)
    client5 = Mongoc.Client(pool)
    global esdatabase         = client1["espace"]
    global msdatabase         = client2["msys"]
    global eqdatabase         = client3["equipment"]
    global progdatabase       = client4["programs"]
    global commdatabase       = client5["comments"]

I've seen where mongo suggests setting serverSelectionTryOnce=false, but I don't see this option in Mongoc.jl Any Ideas?

felipenoris commented 2 years ago

Is your OS 64-bit?

mackyo commented 2 years ago

OS PI 32 bit ..

mackyo commented 2 years ago

I can change to 64 bit .

felipenoris commented 2 years ago

The mongoc driver is 64bit only

mackyo commented 2 years ago

it works mostly... do I need a 64 bit version of Julia?

felipenoris commented 2 years ago

Yes, I think so.

mackyo commented 2 years ago

I've got it running on several 32 bit computers running 32 bit ubuntu .. it has some problems if I hit mongo a bunch of times rapidly , but that's the only problem .. I also have a 64 bit computer running all 64 bit os and julia nad it has the same "too rapid" problem.. I was thinking it was ubuntu

mackyo commented 2 years ago

64 bit works better: Pi OS 64 & 64-bit (AArch64) (GPG) Julia... BUT it still does the same thing. The fix is to get out of Julia and start the program back up. This also happens in 64 bit Ubuntu

mackyo commented 2 years ago

So is there a problem with Ubuntu?

felipenoris commented 2 years ago

The error No suitable servers found is not necessarily a driver problem, and might be an OS issue. So there's little we can do here to debug. All that said, you might be running on an ARM chip. So, please test again using the latest v0.7.0 release of this package.

mackyo commented 2 years ago

It is an ARM chip.. PI 4.. 64 bit.. Julia 1.6.3 .. Mongoc v0.7.0 ... Same thing ... I only get this on Ubuntu and Raspberry PI OS (versions of Linux) .. only on some functions on Ubuntu. (ones that do rapid multiple Mongo hits) .. I get it on all functions on the PI. I can restart Julia and it will run one of these functions, maybe as many as 5 of them before it gets the "No Server" error. So on the PI I restart Julia after each Function run and it will work every time...... It never has this problem on Windows..

mackyo commented 2 years ago

It works better on Manjaro than Pi OS.. Manjaro is based on ArchLinux .. still does the same thing, just not as often

mackyo commented 2 years ago

It happens on Ubuntu in Julia 1.7.0 more ... Julia 1.0.5 works fine

mackyo commented 2 years ago

Ubuntu 18.04, 20.04 & 20.10

danvinci commented 1 year ago

I get the same error on MacOS Ventura 13.1, M1, Julia 1.8.4 and latest Mongoc.

I pasted the URI string as I have it (working) in Compass, not sure how to proceed.

EDIT: I solved using pymongo through PythonCall