You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
kkerezsi
changed the title
CosmosDB MongoAPI not working with Elixir driver
CosmosDB MongoAPI not working with Elixir MongoDB driver
Dec 10, 2024
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.
The text was updated successfully, but these errors were encountered: