Closed postor closed 6 years ago
当然是有考虑兼容的,可能是个 bug,你的调用代码发一下? 上面这个请求到 cgi 的 XML 数据是
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<CompleteMultipartUpload/>
代码:https://gist.github.com/postor/c0449b5b80d403b98a70e23a3238cef3 广州机房的参数依次变更:china-south -> cn-south -> ap-guangzhou 最新的这次变更,appid不要了,非要加到bucket后面,加上了还是报错 过一阵不能用了要升级SDK,升级SDK不能用了还要再看API,你说是不是很添堵
确实很堵,不过 region 和 appid 的更改过程 SDK 都尽可能的做好兼容的。 测试了一遍你发的代码,没有报错。另外用老的方式也是没有报错,只是有一个 AppId 用法的提示。 打印的是:
done!
result { result: true }
$ babel-node test-upload.js --presets es2015,stage-2 AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "te st-1250000000"). { error: { Code: 'MalformedXML', Message: 'The XML you provided was not well-formed or did not validate agai nst our published schema.', Resource: 'backup0-1253554307.cos.ap-guangzhou.myqcloud.com/a.txt', RequestId: 'NWE0MWU4Y2RfMTBiYjk0MGFfYzk3YV80MmU5YTU=', TraceId: 'OGVmYzZiMmQzYjA2OWNhODk0NTRkMTBiOWVmMDAxODc0OWRkZjk0ZDM1NmI1M2E2M TRlY2MzZDhmNmI5MWI1OTI5MWRkM2I1ZDU3ZWE5Y2YzNDYzZTEzY2JlMjU3NDQ0MTAzNGQyNTFiM2NjY jgzZjgwNGNmNTRjMmM3OWNhZGM=' }, statusCode: 400, headers: { 'content-type': 'application/xml', 'content-length': '531', connection: 'close', date: 'Tue, 26 Dec 2017 06:14:37 GMT', server: 'tencent-cos', 'x-cos-request-id': 'NWE0MWU4Y2RfMTBiYjk0MGFfYzk3YV80MmU5YTU=', 'x-cos-trace-id': 'OGVmYzZiMmQzYjA2OWNhODk0NTRkMTBiOWVmMDAxODc0OWRkZjk0ZDM1 NmI1M2E2MTRlY2MzZDhmNmI5MWI1OTI5MWRkM2I1ZDU3ZWE5Y2YzNDYzZTEzY2JlMjU3NDQ0MTAzNGQy NTFiM2NjYjgzZjgwNGNmNTRjMmM3OWNhZGM=' } } { result: false } Done in 1.47s.
TraceId是用来跟踪错误的把,能帮看一下是什么原因么?
RequestId 是可以查询日志定位问题,查出来是:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<CompleteMultipartUpload/>
也就是 sdk 传的时候已经是空的 CompleteMultipartUpload
我知道问题了,你传的文件是空的文件,sdk 没做好提示,谢谢反馈,我尽快补充提示
OK,加上内容之后确实可以传了,我先关了这个,有问题再来提
{ error: { Code: 'MalformedXML', Message: 'The XML you provided was not well-formed or did not validate agai nst our published schema.', Resource: 'backup0-1253554307.cos.ap-guangzhou.myqcloud.com/a.txt', RequestId: 'NWE0MWI5MjdfMTliYjk0MGFfZDI5MV80MTBkM2I=', TraceId: 'OGVmYzZiMmQzYjA2OWNhODk0NTRkMTBiOWVmMDAxODc0OWRkZjk0ZDM1NmI1M2E2M TRlY2MzZDhmNmI5MWI1OTI5MWRkM2I1ZDU3ZWE5Y2YzNDYzZTEzY2JlMjU3NDQ0MTAzNGQyNTFiM2NjY jgzZjgwNGNmNTRjMmM3OWNhZGM=' }, statusCode: 400, headers: { 'content-type': 'application/xml', 'content-length': '531', connection: 'close', date: 'Tue, 26 Dec 2017 02:51:19 GMT', server: 'tencent-cos', 'x-cos-request-id': 'NWE0MWI5MjdfMTliYjk0MGFfZDI5MV80MTBkM2I=', 'x-cos-trace-id': 'OGVmYzZiMmQzYjA2OWNhODk0NTRkMTBiOWVmMDAxODc0OWRkZjk0ZDM1 NmI1M2E2MTRlY2MzZDhmNmI5MWI1OTI5MWRkM2I1ZDU3ZWE5Y2YzNDYzZTEzY2JlMjU3NDQ0MTAzNGQy NTFiM2NjYjgzZjgwNGNmNTRjMmM3OWNhZGM=' } }