name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
Describe the bug
On startup of the deployed azure function, spring fails with an exception about a TXT record not being found for the mongoDb url. Locally, on a desktop, the function could use an srv url and startup appropriately
To Reproduce
Steps to reproduce the behavior:
Checkout project on commit cc45ce0
Follow the instructions to build the project, taking care to set the mongoDb url to a replica set style url with mongodb+srv as the protocol
The app will be seen to start up correctly
Modify the MongoDB URI of a deployed function
Send a request to the function and it will respond with a 500 because Spring did not start-up successfully
Expected behavior
The function should startup successfully, making use of the appropriate dns lookup to resolve the mongo domain to the records for the 3 replica sets that sit beneath it
Screenshots
If applicable, add screenshots to help explain your problem.
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate
[org.springframework.data.mongodb.core.MongoDbFactorySupport]:
Factory method 'mongoDbFactory' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'mongoClient' defined in class path resource [io/mathdojo/useraccountservice/configuration/DBConfiguration.class]:
Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mongodb.client.MongoClient]:
Factory method 'mongoClient' threw exception; nested exception is com.mongodb.MongoConfigurationException: Unable to look up TXT record for host nonprodcluster.midgi.azure.mongodb.net
Environment Info (please complete the following information):
JVM:
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (Zulu 8.44.0.9-CA-win64) (build 1.8.0_242-b20)
OpenJDK 64-Bit Server VM (Zulu 8.44.0.9-CA-win64) (build 25.242-b20, mixed mode)
Azure Functions Runtime (please complete the following information):**
2.0
Additional context
Add any other context about the problem here.
name: Bug report about: Create a report to help us improve title: '' labels: '' assignees: ''
Describe the bug On startup of the deployed azure function, spring fails with an exception about a TXT record not being found for the mongoDb url. Locally, on a desktop, the function could use an srv url and startup appropriately
To Reproduce Steps to reproduce the behavior:
mongodb+srv
as the protocolExpected behavior The function should startup successfully, making use of the appropriate dns lookup to resolve the mongo domain to the records for the 3 replica sets that sit beneath it
Screenshots If applicable, add screenshots to help explain your problem.
Environment Info (please complete the following information): JVM:
Azure Functions Runtime (please complete the following information):**
Additional context Add any other context about the problem here.