Suddenly unable to connect: queryTxt ETIMEOUT

I have been able to connect to my MongoDB database until today, when I am suddenly unable to. Instead, the connection attempt times out after 10 seconds and I get the error queryTxt ETIMEOUT jblakdcluster.fti4a.mongodb.net

In order to isolate the bug, I have tried the following (but to no avail):

  1. Connecting after disabling my firewall completely
  2. Connecting from another network (using my phone’s wifi hotspot instead of my home wifi)
  3. Connecting from mongosh
  4. Connecting from MongoDB Compass
  5. Connecting from mongosh using another computer
  6. Terminating my existing cluster and creating a brand new one, and then connecting to the new one
  7. Quadruple-checking my database user credentials and access rights
  8. Quadruple-checking that network access is configured to 0.0.0.0/0 (theoretically able to connect from any IP address)

I believe I have taken a reasonable amount steps to try to solve the problem, and now I must ask for help. Please try connecting to my database using mongosh with the following information (the database is for my own educational purposes only and doesn’t have any sensitive information):
mongosh "mongodb+srv://jblakdcluster.fti4a.mongodb.net/myFirstDatabase" --username rwuser
password:
rwuserpw

If the wider community is getting the same error that I am having, then I can be pretty sure that either there is something wrong on MongoDB’s end, or there’s something I’ve missed from my (fairly exhaustive) troubleshooting process.

Thank you very much.

1 Like

This look like a dns resolution error. I queried the records for you cluster and they resolve okay.

You should be able to do the same, otherwise try different DNS resolvers, Google or OpenDNS being favourites.

  1. Resolves SRV to IPs:
    nslookup -query=srv _mongodb._tcp.jblakdcluster.fti4a.mongodb.net

Server: 192.168.1.254
Address: 192.168.1.254#53

Non-authoritative answer:
._mongodb._tcp.jblakdcluster.fti4a.mongodb.net service = 0 0 27017 jblakdcluster-shard-00-00.fti4a.mongodb.net.
_mongodb._tcp.jblakdcluster.fti4a.mongodb.net service = 0 0 27017 jblakdcluster-shard-00-01.fti4a.mongodb.net.
_mongodb._tcp.jblakdcluster.fti4a.mongodb.net service = 0 0 27017 jblakdcluster-shard-00-02.fti4a.mongodb.net.

  1. Reolves TXT to connection parameters:
    nslookup -query=txt jblakdcluster.fti4a.mongodb.net

Server: 192.168.1.254
Address: 192.168.1.254#53

Non-authoritative answer:
jblakdcluster.fti4a.mongodb.net text = “authSource=admin&replicaSet=atlas-dtrnwi-shard-0”

Your cluster is connectable, I’m not going to login.

5 Likes

Thanks Chris,

It is indeed a DNS issue on my end. I asked my friend to run the nslookup commands and they got the same result as you.

I am getting:

DNS request timed out.
timeout was 2 seconds.
Server: UnKnown
Address: 8.8.8.8

DNS request timed out.
timeout was 2 seconds.
DNS request timed out.
timeout was 2 seconds.
*** Request to UnKnown timed-out

I started off with my default IPv4 DNS, but since then I have tried using the Google DNS and OpenDNS, to no avail. All three DNS servers that I’ve tried works normally for other URLs, just not the MongoDB one.

Any more ideas from you are still welcome.

Looks like they are not being allowed out. Is this behind/inside a corporate environment?

No, this is from my home wifi network.

The domain name gets resolved if I use a free VPN to change my location to another country. Perhaps this workaround is the best that I am gonna get.

1 Like

Either your home network or your isp is blocking other dns services. Wherever they end up is not proxying the request(s) properly (at least for the TXT record).

You can get the connection string (non-srv version) from the connect button on you database in Atlas. Using an old version of shell. There are too may caveats to make that useful instruction so as we have all the pieces here we can build it.

mongodb://jblakdcluster-shard-00-00.fti4a.mongodb.net:27017,jblakdcluster-shard-00-02.fti4a.mongodb.net:27017,jblakdcluster-shard-00-01.fti4a.mongodb.net:27017/myFirstDatabse?authSource=admin&replicaSet=atlas-dtrnwi-shard-0&tls=true

8 Likes

Thanks Chris, that worked.

I was able to connect via mongosh by using the command
mongosh "mongodb://jblakdcluster-shard-00-00.fti4a.mongodb.net:27017,jblakdcluster-shard-00-02.fti4a.mongodb.net:27017,jblakdcluster-shard-00-01.fti4a.mongodb.net:27017/myFirstDatabse?authSource=admin&replicaSet=atlas-dtrnwi-shard-0&tls=true" --username <username>

I had to add quotation marks to enclose the connection string so that Windows cmd wouldn’t misinterpret ampersands as additional commands.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.