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

(vert.x-eventloop-thread-1) Unable to look up TXT record for host serverlessinstance0.oagmp.mongodb.net #23548

Closed
marcogutto opened this issue Feb 9, 2022 · 6 comments · Fixed by #23585
Labels
Milestone

Comments

@marcogutto
Copy link

Describe the bug

I get the error:
(vert.x-eventloop-thread-1) Unable to look up TXT record for host serverlessinstance0.oagmp.mongodb.net.

In my contaiver resolv.conf file:

bash-4.4$ cat /etc/resolv.conf
nameserver 127.0.0.11
options ndots:0

I'm using the native image quay.io/quarkus/quarkus-micro-image:1.0.

It comes with ndots:0 by default.

Thanks in advance!

Expected behavior

It find in native mode the look up TXT record for host serverlessinstance0.oagmp.mongodb.net.

Actual behavior

It doesn't find the look up TXT record for host serverlessinstance0.oagmp.mongodb.net.

How to Reproduce?

Steps to reproduce:

  1. Configure the application.properties
    application.properties
    quarkus.mongodb.connection-string=
    quarkus.mongodb.database=

quarkus.mongodb.native.dns.use-vertx-dns-resolver=true
quarkus.mongodb.native.dns.lookup-timeout=10s

  1. Build in native mode

  2. Start the application

Output of uname -a or ver

Linux 25cf03bb9077 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

command not found

GraalVM version (if different from Java)

I'm using quay.io/quarkus/centos-quarkus-maven:21.3.0-java11 to generate the native image

Quarkus version or git rev

2.7.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 7.3.3

Additional information

I'm using a mongo on Atlas cloud and it is a serverless instance.

@marcogutto marcogutto added the kind/bug Something isn't working label Feb 9, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Feb 9, 2022

/cc @evanchooly, @loicmathieu

@loicmathieu
Copy link
Contributor

/cc @cescoffier

@cescoffier
Copy link
Member

I'm aware of a few issues regarding the dns resolution. That's why the feature is experimental.
I don't have a good solution at the moment unfortunately.

@cescoffier
Copy link
Member

Got an idea, let me see if this is going to work or .... not

@cescoffier
Copy link
Member

Ok, I'm not able to test against an Atlas serverless instance, but I got a native application connecting to a shared instance using both the -micro and -native base images.

@bslatam
Copy link

bslatam commented Jun 6, 2023

Workaround:

  1. Reference:
    https://www.appsloveworld.com/mongodb/100/53/failed-to-import-the-uri-unable-to-look-up-txt-record-for-host-cluster0-ohzuo-mo

  2. application.properties template:

spring.data.mongodb.uri=mongodb://" + USER + ":" + PASS + "@" + HOST + ":" + PORT + "/" + DB
spring.data.mongodb.database=DB

  1. application.properties example:

spring.data.mongodb.uri=mongodb://userA:[email protected]:27017/db_name?ssl=true&replicaSet=atlas-rw4866-shard-0&authSource=admin&retryWrites=true&w=majority
spring.data.mongodb.database= db_name

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