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

CosmosDB MongoAPI not working with Elixir MongoDB driver #260

Open
kkerezsi opened this issue Dec 10, 2024 · 0 comments
Open

CosmosDB MongoAPI not working with Elixir MongoDB driver #260

kkerezsi opened this issue Dec 10, 2024 · 0 comments

Comments

@kkerezsi
Copy link
Contributor

I'm currently integrating our service stack in Azure and I've noticed that the elixir services fails to connect to CosmosDB (MongoDB API) due to a wrong DNS record handling during the connection string parsing.

The existing Url_parser uses the :inet_res.getbyname to lookup the srv and txt records and it fails with {error, nxdomain} when trying to lookup the :txt record. The txt record contains connection related metadata and it isn't a mandatory record for the connection to happen.

Checking the .NET libraries for the mongo driver, the TXT records only used when the lookup finds at most one record.

The proposed fix is to follow the same pattern and ensure the connection is not failing when a TXT record is not defined. It's also worth mentioning that the driver could use the :inet_res.lookup method instead of the inet_res.getbyname for :txt since we are only interested in reading the record value.

@kkerezsi kkerezsi changed the title CosmosDB MongoAPI not working with Elixir driver CosmosDB MongoAPI not working with Elixir MongoDB driver Dec 10, 2024
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

1 participant