Mongodb - ADF connection error

Kiran Joka 0 Reputation points
2024-04-29T04:29:20.4233333+00:00

I am facing the below issue while connecting to MongoDB. In the dataset, I am able to see preview data, but in the pipeline copy activity, I am getting the below error.

Error: Failure happened on 'Source' side. 'Type=System.InvalidCastException,Message=Invalid cast from 'System.Int64' to 'System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'.,Source=mscorlib,'

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,715 questions
{count} votes

2 answers

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,126 Reputation points Microsoft Employee
    2024-04-29T16:51:57.2733333+00:00

    Hi Kiran Joka,

    Thank you for posting query in Microsoft Q&A Platform.

    From the error message, it seems error is related to data. Preview data will fetch the partial data whereas copy activity loads data from source to sink and while loading if there is any data compatibility issue, then it will throw error.

    It seems in your data somewhere null is getting converted to Int as per source or sink table formats and resulting in error. Kindly check your data for same.

    Please note, under copy activity settings you can try skip in compatible rows option to avoid this error. But this skips the non-compatible rows.

    Hope this helps. Please let me know how it goes. Thank you.


  2. Kiran Joka 0 Reputation points
    2024-05-07T04:29:41.76+00:00

    Looks like issue is with driver version(In Linked Service) and special character in the connection string(when we add to key vault)