question

qing-8620 avatar image
0 Votes"
qing-8620 asked KranthiPakala-MSFT commented

Create linked service to MongoDB Connection Failed

I have a SelfHostIR in VM.
I can access MongoDB from the VM.
I created a linked service to MongoDB using SelfHostIR.
The connection test is always failed.

Error code
23404
Details

C

onnection to MongoDB server is timeout. A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : "1", ConnectionMode : "Automatic", Type : "Unknown", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/host:port" }", EndPoint: "Unspecified/host:port", State: "Disconnected", Type: "Unknown", HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure. at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult) at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result) at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MongoDB.Driver.Core.Connections.SslStreamFactory.<CreateStreamAsync>d_4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MongoDB.Driver.Core.Connections.BinaryConnection.<OpenHelperAsync>d51.MoveNext() --- End of inner exception stack trace --- at MongoDB.Driver.Core.Connections.BinaryConnection.<OpenHelperAsync>d51.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MongoDB.Driver.Core.Servers.ServerMonitor.<HeartbeatAsync>d28.MoveNext()", LastUpdateTimestamp: "2021-11-02T09:10:44.6183516Z" }, { ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/host:port" }", EndPoint: "Unspecified/host:port", State: "Disconnected", Type: "Unknown", HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> System.Net.Sockets.SocketException: No such host is known at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult) at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MongoDB.Driver.Core.Connections.TcpStreamFactory.<ConnectAsync>d7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MongoDB.Driver.Core.Connections.TcpStreamFactory.<CreateStreamAsync>d4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MongoDB.Driver.Core.Connections.SslStreamFactory.<CreateStreamAsync>d4.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MongoDB.Driver.Core.Connections.BinaryConnection.<OpenHelperAsync>d51.MoveNext() --- End of inner exception stack trace --- at MongoDB.Driver.Core.Connections.BinaryConnection.<OpenHelperAsync>d51.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MongoDB.Driver.Core.Servers.ServerMonitor.<HeartbeatAsync>d_28.MoveNext()", LastUpdateTimestamp: "2021-11-02T09:10:45.2119036Z" }] }. Activity ID: 14d7d4d1-659c-4aee-b488-2d965a119b25.

azure-data-factory
· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @qing-8620,

Welcome to Microsoft Q&A forum and thanks for posting your query.

Could you please confirm which among the belong connectors are you trying to establish a connection?

145952-image.png

Also please confirm what version of Mongo DB is yours?

But as per the error message The remote certificate is invalid according to the validation procedure - could you please make sure that you have installed the required certificates on the VMs hosting the integration runtime?



Thanks


0 Votes 0 ·
image.png (27.6 KiB)

I used the second connector.
The Mongo DB version is 4.4.6

0 Votes 0 ·

I can access the Mongo DB from the VM hosting the integration runtime.
I have added the VM IP to the whitelist of Mongo DB.
This integration runtime is being used by the other 23 linked services, they are all working fine.
I don't know what certificate should I install on the VM?

0 Votes 0 ·

Hi @qing-8620,

Thanks for your response.

"This integration runtime is being used by the other 23 linked services, they are all working fine." - Could you please confirm if any of those 23 linked services contain Mongo DB?
Other 2 things which I have noticed is :

  1. The ADF MongoDB connector supports versions up to 4.2 and I see that your version is 4.4.6, which could you be the reason you are receiving this issue.

  2. Also does your Mongo DB needs a certificate to validate the connection? If yes, the current ADF Mongo DB connector don’t support the connections requiring the certificates at this point (product limitation).

Thanks

0 Votes 0 ·
Show more comments

1 Answer

KranthiPakala-MSFT avatar image
0 Votes"
KranthiPakala-MSFT answered

Thanks for the update @qing-8620 .

As per official ADF connector documentation , the ADF MongoDB connector supports versions up to 4.2 and I see that your version is 4.4.6, which could you be the reason you are receiving this issue.

145838-image.png

Ref doc: Copy data from or to MongoDB using Azure Data Factory or Synapse Analytics

Also if your Mongo DB needs a certificate to validate, then as per internal team confirmation, the current ADF connector don’t support the connections requiring the certificates at this point. This is a product limitation.

If this is the case I would recommend you to please log a feedback in Azure Data Factory IDEAS forum - https://feedback.azure.com/d365community/forum/1219ec2d-6c26-ec11-b6e6-000d3a4f032c. All the feedback shared in this forum are actively monitored and reviewed by ADF Product team. Also please do share your feedback thread link once it is posted so that other with similar feedback can upvote and comment on it.

Hope this info helps.



  • Please don't forget to click on 130616-image.png and upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how

  • Want a reminder to come back and check responses? Here is how to subscribe to a notification

  • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators


image.png (23.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.