Boto的分段上传API在AWS eu-central-1区域中不起作用

时间:2016-11-10 05:44:24

标签: amazon-s3 boto multipart

我正在尝试在我的应用程序中使用boto的多部分上传API。但它失败了

  

我们计算的请求签名与您的签名不符   提供。检查您的密钥和签名方法

以下是错误详情

import boto

import boto3

s3_conn = boto.s3.connect_to_region('eu-central-1', aws_access_key_id=******, aws_secret_access_key=*****)

buckt = s3_conn.get_bucket('phoenix-4-147757042135')

mpuid = buckt.initiate_multipart_upload('4/5137/data_6000C298-a994-efe2-7e3b-efb3fd5a6c76/FULL/amar')

mpuid.copy_part_from_key('phoenix-4-147757042135', '4/5137/data_6000C298-a994-efe2-7e3b-efb3fd5a6c76/FULL/10000000', 1, 0, 1)


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/boto-2.39.0-py2.6.egg/boto/s3/multipart.py", line 306, in copy_part_from_key
    query_args=query_args)
  File "/usr/lib/python2.6/site-packages/boto-2.39.0-py2.6.egg/boto/s3/bucket.py", line 889, in copy_key
    response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message><AWSAccessKeyId>ASIAIZZPTQJ3AWY3WG2Q</AWSAccessKeyId><StringToSign>AWS4-HMAC-SHA256
20161110T051801Z
20161110/eu-central-1/s3/aws4_request
bb44a9b3366ce1702d2850188d998eab092746bea906b50481ffe814137efde9</StringToSign><SignatureProvided>2d8b63e0c6f29d602e34ab426bf5704fcaaf6ae15c19550f047931a1da351211</SignatureProvided><StringToSignBytes>41 57 53 34 2d 48 4d 41 43 2d 53 48 41 32 35 36 0a 32 30 31 36 31 31 31 30 54 30 35 31 38 30 31 5a 0a 32 30 31 36 31 31 31 30 2f 65 75 2d 63 65 6e 74 72 61 6c 2d 31 2f 73 33 2f 61 77 73 34 5f 72 65 71 75 65 73 74 0a 62 62 34 34 61 39 62 33 33 36 36 63 65 31 37 30 32 64 32 38 35 30 31 38 38 64 39 39 38 65 61 62 30 39 32 37 34 36 62 65 61 39 30 36 62 35 30 34 38 31 66 66 65 38 31 34 31 33 37 65 66 64 65 39</StringToSignBytes><CanonicalRequest>PUT
/4/5137/data_6000C298-a994-efe2-7e3b-efb3fd5a6c76/FULL/amar
partNumber=1&amp;uploadId=PMd350jeac8vLRuC7qf9CEBckNBqXGWdaEL32a.bCw3Zet.K1IInwYmDEEnkU98.xHSnlucJLeis49yMg2M.NoyOdwAVU8VMYcve6Sv5ExJ8Yh9pc7UJrxli5O2p6PqxH83.I_pcIGttaybTT0ul2nwc79DOUSIpKO8TlMosfNI-
host:phoenix-4-147757042135.s3.eu-central-1.amazonaws.com
user-agent:Boto/2.39.0 Python/2.6.6 Linux/2.6.32-431.20.3.el6.x86_64
x-amz-content-sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-copy-source:phoenix-4-147757042135/4/5137/data_6000C298-a994-efe2-7e3b-efb3fd5a6c76/FULL/10000000
x-amz-copy-source-range:bytes=0-1
x-amz-date:20161110T051801Z
x-amz-security-token:FQoDYXdzEFYaDOR7x87//+eMX2hqwyK9A6+FKe1SX8gN2bpcbRJPuJxLZC+zP62TnzqoXA1lPvdKhjWpJI0v0UZ46Y+IcvbflIQXq438R8kC5QHJZHLx/fsDC7lPYLuDPA3d43V+cc28cn44pjD34DQpy0RKGMc7GJljZR+ijOb3m8e6bxv4c4kN83Kv+Gs7UBBa5EoGeg4NHN3neNN8g2u68Ad0uouPDV1Wvuiijbfp6ZIaT4LZFbq3mE11ZXiBjQDSDTDcLpO+ek3VCck6bpzquT/jDc8Jzrm6/rS8Giqs/xWLiATa4VqxVXzvbQ2Pu4Tv0kfCU7uc6DWMrBMhejj97s/HKLU0b12mcQ65T+FcieYALPfM4qPf27ZZVsjXWkCzkrMu8qOAblqpVCG15A2snZn0Ke6T7JF6ONGKkr1jSQ3Tv93C5/j6HuQOIcsuRKDLkBLgffOAyIzDzY2xBQvBIABTk0ENcLkgYzNLKsWLFuI3Pry24qcXVCSzXruyEE2neqZp8ohAvVh0WPZOtxmPOTbGgqRn2xEgb3yODAyz7+KOemRvfyGgxBGmvvSnuLrr24vY/6Inm49Q736eT7d5xmzflbLG6cdtBejyKmgttcOpuiEo9f2PwQU=

host;user-agent;x-amz-content-sha256;x-amz-copy-source;x-amz-copy-source-range;x-amz-date;x-amz-security-token
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855</CanonicalRequest><CanonicalRequestBytes>50 55 54 0a 2f 34 2f 35 31 33 37 2f 64 61 74 61 5f 36 30 30 30 43 32 39 38 2d 61 39 39 34 2d 65 66 65 32 2d 37 65 33 62 2d 65 66 62 33 66 64 35 61 36 63 37 36 2f 46 55 4c 4c 2f 61 6d 61 72 0a 70 61 72 74 4e 75 6d 62 65 72 3d 31 26 75 70 6c 6f 61 64 49 64 3d 50 4d 64 33 35 30 6a 65 61 63 38 76 4c 52 75 43 37 71 66 39 43 45 42 63 6b 4e 42 71 58 47 57 64 61 45 4c 33 32 61 2e 62 43 77 33 5a 65 74 2e 4b 31 49 49 6e 77 59 6d 44 45 45 6e 6b 55 39 38 2e 78 48 53 6e 6c 75 63 4a 4c 65 69 73 34 39 79 4d 67 32 4d 2e 4e 6f 79 4f 64 77 41 56 55 38 56 4d 59 63 76 65 36 53 76 35 45 78 4a 38 59 68 39 70 63 37 55 4a 72 78 6c 69 35 4f 32 70 36 50 71 78 48 38 33 2e 49 5f 70 63 49 47 74 74 61 79 62 54 54 30 75 6c 32 6e 77 63 37 39 44 4f 55 53 49 70 4b 4f 38 54 6c 4d 6f 73 66 4e 49 2d 0a 68 6f 73 74 3a 70 68 6f 65 6e 69 78 2d 34 2d 31 34 37 37 35 37 30 34 32 31 33 35 2e 73 33 2e 65 75 2d 63 65 6e 74 72 61 6c 2d 31 2e 61 6d 61 7a 6f 6e 61 77 73 2e 63 6f 6d 0a 75 73 65 72 2d 61 67 65 6e 74 3a 42 6f 74 6f 2f 32 2e 33 39 2e 30 20 50 79 74 68 6f 6e 2f 32 2e 36 2e 36 20 4c 69 6e 75 78 2f 32 2e 36 2e 33 32 2d 34 33 31 2e 32 30 2e 33 2e 65 6c 36 2e 78 38 36 5f 36 34 0a 78 2d 61 6d 7a 2d 63 6f 6e 74 65 6e 74 2d 73 68 61 32 35 36 3a 65 33 62 30 63 34 34 32 39 38 66 63 31 63 31 34 39 61 66 62 66 34 63 38 39 39 36 66 62 39 32 34 32 37 61 65 34 31 65 34 36 34 39 62 39 33 34 63 61 34 39 35 39 39 31 62 37 38 35 32 62 38 35 35 0a 78 2d 61 6d 7a 2d 63 6f 70 79 2d 73 6f 75 72 63 65 3a 70 68 6f 65 6e 69 78 2d 34 2d 31 34 37 37 35 37 30 34 32 31 33 35 2f 34 2f 35 31 33 37 2f 64 61 74 61 5f 36 30 30 30 43 32 39 38 2d 61 39 39 34 2d 65 66 65 32 2d 37 65 33 62 2d 65 66 62 33 66 64 35 61 36 63 37 36 2f 46 55 4c 4c 2f 31 30 30 30 30 30 30 30 0a 78 2d 61 6d 7a 2d 63 6f 70 79 2d 73 6f 75 72 63 65 2d 72 61 6e 67 65 3a 62 79 74 65 73 3d 30 2d 31 0a 78 2d 61 6d 7a 2d 64 61 74 65 3a 32 30 31 36 31 31 31 30 54 30 35 31 38 30 31 5a 0a 78 2d 61 6d 7a 2d 73 65 63 75 72 69 74 79 2d 74 6f 6b 65 6e 3a 46 51 6f 44 59 58 64 7a 45 46 59 61 44 4f 52 37 78 38 37 2f 2f 2b 65 4d 58 32 68 71 77 79 4b 39 41 36 2b 46 4b 65 31 53 58 38 67 4e 32 62 70 63 62 52 4a 50 75 4a 78 4c 5a 43 2b 7a 50 36 32 54 6e 7a 71 6f 58 41 31 6c 50 76 64 4b 68 6a 57 70 4a 49 30 76 30 55 5a 34 36 59 2b 49 63 76 62 66 6c 49 51 58 71 34 33 38 52 38 6b 43 35 51 48 4a 5a 48 4c 78 2f 66 73 44 43 37 6c 50 59 4c 75 44 50 41 33 64 34 33 56 2b 63 63 32 38 63 6e 34 34 70 6a 44 33 34 44 51 70 79 30 52 4b 47 4d 63 37 47 4a 6c 6a 5a 52 2b 69 6a 4f 62 33 6d 38 65 36 62 78 76 34 63 34 6b 4e 38 33 4b 76 2b 47 73 37 55 42 42 61 35 45 6f 47 65 67 34 4e 48 4e 33 6e 65 4e 4e 38 67 32 75 36 38 41 64 30 75 6f 75 50 44 56 31 57 76 75 69 69 6a 62 66 70 36 5a 49 61 54 34 4c 5a 46 62 71 33 6d 45 31 31 5a 58 69 42 6a 51 44 53 44 54 44 63 4c 70 4f 2b 65 6b 33 56 43 63 6b 36 62 70 7a 71 75 54 2f 6a 44 63 38 4a 7a 72 6d 36 2f 72 53 38 47 69 71 73 2f 78 57 4c 69 41 54 61 34 56 71 78 56 58 7a 76 62 51 32 50 75 34 54 76 30 6b 66 43 55 37 75 63 36 44 57 4d 72 42 4d 68 65 6a 6a 39 37 73 2f 48 4b 4c 55 30 62 31 32 6d 63 51 36 35 54 2b 46 63 69 65 59 41 4c 50 66 4d 34 71 50 66 32 37 5a 5a 56 73 6a 58 57 6b 43 7a 6b 72 4d 75 38 71 4f 41 62 6c 71 70 56 43 47 31 35 41 32 73 6e 5a 6e 30 4b 65 36 54 37 4a 46 36 4f 4e 47 4b 6b 72 31 6a 53 51 33 54 76 39 33 43 35 2f 6a 36 48 75 51 4f 49 63 73 75 52 4b 44 4c 6b 42 4c 67 66 66 4f 41 79 49 7a 44 7a 59 32 78 42 51 76 42 49 41 42 54 6b 30 45 4e 63 4c 6b 67 59 7a 4e 4c 4b 73 57 4c 46 75 49 33 50 72 79 32 34 71 63 58 56 43 53 7a 58 72 75 79 45 45 32 6e 65 71 5a 70 38 6f 68 41 76 56 68 30 57 50 5a 4f 74 78 6d 50 4f 54 62 47 67 71 52 6e 32 78 45 67 62 33 79 4f 44 41 79 7a 37 2b 4b 4f 65 6d 52 76 66 79 47 67 78 42 47 6d 76 76 53 6e 75 4c 72 72 32 34 76 59 2f 36 49 6e 6d 34 39 51 37 33 36 65 54 37 64 35 78 6d 7a 66 6c 62 4c 47 36 63 64 74 42 65 6a 79 4b 6d 67 74 74 63 4f 70 75 69 45 6f 39 66 32 50 77 51 55 3d 0a 0a 68 6f 73 74 3b 75 73 65 72 2d 61 67 65 6e 74 3b 78 2d 61 6d 7a 2d 63 6f 6e 74 65 6e 74 2d 73 68 61 32 35 36 3b 78 2d 61 6d 7a 2d 63 6f 70 79 2d 73 6f 75 72 63 65 3b 78 2d 61 6d 7a 2d 63 6f 70 79 2d 73 6f 75 72 63 65 2d 72 61 6e 67 65 3b 78 2d 61 6d 7a 2d 64 61 74 65 3b 78 2d 61 6d 7a 2d 73 65 63 75 72 69 74 79 2d 74 6f 6b 65 6e 0a 65 33 62 30 63 34 34 32 39 38 66 63 31 63 31 34 39 61 66 62 66 34 63 38 39 39 36 66 62 39 32 34 32 37 61 65 34 31 65 34 36 34 39 62 39 33 34 63 61 34 39 35 39 39 31 62 37 38 35 32 62 38 35 35</CanonicalRequestBytes><RequestId>3EDF2BFB155307CF</RequestId><HostId>q5lLYag9EJC/liFWejbNHWgFPZUDMLG3bBP5xM2+u87HlsO4alkoEu5r7xIcOih+YPcGFeCVJ20=</HostId></Error>

1 个答案:

答案 0 :(得分:0)

感谢John Rotenstein&amp; Jordon Phillips的帮助。 我的问题通过使用boto3 for multipart解决了。我在欧洲中部地区的多部分上遇到了boto问题