Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serverless Mongo (Atlas) is not supported = A TXT record is only permitted to contain the keys [authsource, replicaset] #221

Open
ZivotJeKrasny opened this issue Oct 3, 2022 · 1 comment

Comments

@ZivotJeKrasny
Copy link

I found that connecting to MongoDB Serverless Atlas cluster is not supported by the used mongo driver.

(ns my-namespace (:require [monger.core :as mg]))
(let [uri "mongodb+srv://dbUser:[email protected]/db?retryWrites=true&w=majority"
      {:keys [conn db]} (mg/connect-via-uri uri)])
Execution error (MongoConfigurationException) at com.mongodb.ConnectionString/<init> (ConnectionString.java:388).
A TXT record is only permitted to contain the keys [authsource, replicaset], but the TXT record for 'hostname.tbtin.mongodb.net' contains the keys [loadbalanced, authsource]
dig hostname.tbtin.mongodb.net TXT

; <<>> DiG 9.18.1-1ubuntu1.1-Ubuntu <<>> hostname.tbtin.mongodb.net TXT
;; ANSWER SECTION:
hostname.tbtin.mongodb.net. 60 IN TXT "authSource=admin&loadBalanced=true"

I think the solution is to use a newer version of mongo driver org.mongodb/mongodb-driver-core "4.7.1" ? https://mvnrepository.com/artifact/org.mongodb/mongodb-driver-core
Right?

@johanhaleby
Copy link

I have the same problem unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants