排查 Azure 数据工厂 和 Azure Synapse 中的 MongoDB 连接器问题

适用于:Azure 数据工厂 Azure Synapse Analytics

本文提供了一些建议,用于排查 Azure 数据工厂 和 Azure Synapse 中常见的 MongoDB 连接器问题。

错误代码:MongoDbUnsupportedUuidType

  • 消息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,'",

  • 原因:使用通用唯一标识符 (UUID) 字段从 Azure Cosmos DB MongoAPI 或 MongoDB 复制数据时,有两种方式来用二进制 JSON (BSON) 表示 UUID:UuidStandard 和 UuidLegacy。 默认使用 UuidLegacy 来读取数据。 如果 MongoDB 中的 UUID 数据是 UuidStandard,则会遇到错误。

  • 解决方法:在 MongoDB 连接字符串中,添加 uuidRepresentation=standard 选项。 有关详细信息,请参阅 MongoDB 连接字符串

迁移到新版本的 MongoDB 连接器

  • 症状:遇到以下错误代码和错误消息:

    • 错误代码:DeprecatedMongoDbOdbcConnector
    • 错误消息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
  • 原因:你的管道仍在导致错误的旧版 MongoDB 连接器上运行。

  • 解决方法:将 MongoDB 链接服务升级到最新版本。 请参阅此文章

尝试通过以下资源获得故障排除方面的更多帮助: