AWS RDS 到 S3 错误。 "The XML WAS NOT WELL FORMED"

AWS RDS to S3 Error. "The XML WAS NOT WELL FORMED"

我正在尝试使用 AMAZON DATA PIPELINE 将特定数据从 RDS(MYSQL) 迁移到 S3。但我收到错误

"The XML you provided was not well-formed or did not validate against our published schema (Service: Amazon S3; Status Code: 400; Error Code: Malformed XML"

enter image description here

enter image description here

这可能是由于在S3 对象的某些部分使用了无效的-XML-字符造成的。参见 https://github.com/aws/aws-sdk-java/issues/333

要深入挖掘,请提供更多信息:

  • 这是 API 调用引起的吗?如果是的话,你用的是什么SDK,调用的到底是什么?
  • 能否分享管道配置?

我没有构建自定义架构,而是使用了 RDS - S3 完整副本模板。这似乎消除了错误。虽然还没有在 s3 存储桶中获取数据,但我可以访问空的 csv 文件。

您需要设置 LifecycleTransition 属性 Days 和 Storage Class。

LifecycleConfiguration newConfiguration = new LifecycleConfiguration
        {
            Rules = new List<LifecycleRule>
            {
                new LifecycleRule
                        {
                             Id = "some id here",
                             Filter = new LifecycleFilter()
                             {
                                 LifecycleFilterPredicate = new LifecyclePrefixPredicate()
                                 {
                                    
                                 }
                             },
                             Status = LifecycleRuleStatus.Enabled,
                             Transitions = new List<LifecycleTransition>
                             {
                                  new LifecycleTransition
                                  {
                                       Days = 0,
                                       StorageClass = S3StorageClass.Glacier
                                  }
                              },
                             Expiration = new LifecycleRuleExpiration()
                             {
                                   Days = 1
                             }
                        }
            }
        };