Troubleshoot the MongoDB connector in Azure Data Factory and Azure Synapse
APPLIES TO:
Azure Data Factory
Azure Synapse Analytics
This article provides suggestions to troubleshoot common problems with the MongoDB connector in Azure Data Factory and Azure Synapse.
Message:
Failed to read data via MongoDB client., Source=Microsoft.DataTransfer.Runtime.MongoDbV2Connector,Type=System.FormatException, Message=The GuidRepresentation for the reader is CSharpLegacy which requires the binary sub type to be UuidLegacy not UuidStandard.,Source=MongoDB.Bson,'",
Cause: When you copy data from Azure Cosmos DB MongoAPI or MongoDB with the universally unique identifier (UUID) field, there are two ways to represent the UUID in Binary JSON (BSON): UuidStandard and UuidLegacy. By default, UuidLegacy is used to read data. You will receive an error if your UUID data in MongoDB is UuidStandard.
Resolution: In the MongoDB connection string, add the uuidRepresentation=standard option. For more information, see MongoDB connection string.
Symptoms: You meet the following error code and error message:
- Error code:
DeprecatedMongoDbOdbcConnector
- Error message:
The legacy MongoDB connector has been deprecated. To ensure your pipeline works, please create a new MongoDB linked service. Detailed instructions can be found in this documentation: https://docs.azure.cn/data-factory/connector-mongodb#upgrade-the-mongodb-linked-service
- Error code:
Cause: Your pipeline is still running on a legacy MongoDB connector that causes the error.
Resolution: Upgrade your MongoDB linked service to the latest version. Refer to this article.
For more troubleshooting help, try these resources: