因此,這裏是我的S3桶第一次測試使用博託:我與博託第一次測試失敗,SignatureDoesNotMatch
import boto
user_name, access_key, secret_key = "testing-user", "xxxxxxxxxxxxx", "xxxxxxxx/xxxxxxxxxxxx/xxxxxxxxxx(xxxxx)"
conn = boto.connect_s3(access_key, secret_key)
buckets = conn.get_all_buckets()
我收到以下錯誤:
Traceback (most recent call last):
File "test-s3.py", line 9, in <module>
buckets = conn.get_all_buckets()
File "xxxxxx/lib/python2.7/site-packages/boto/s3/connection.py", line 440, in get_all_buckets
response.status, response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 403 Forbidden
<?xml version="1.0" encoding="UTF-8"?>
<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>AKIAJMHSZXU6MORWA5GA</AWSAccessKeyId><StringToSign>GET
Mon, 18 May 2015 06:21:58 GMT
/</StringToSign><SignatureProvided>c/+YJAZVInsfmd5giMQmrh81DPA=</SignatureProvided><StringToSignBytes>47 45 54 0a 0a 0a 4d 6f 6e 2c 20 31 38 20 4d 61 79 20 32 30 31 35 20 30 36 3a 32 31 3a 35 38 20 47 4d 54 0a 2f</StringToSignBytes><RequestId>5733F9C8926497E6</RequestId><HostId>FXPejeYuvZ+oV2DJLh7HBpryOh4Ve3Mmj8g8bKA2f/4dTWDHJiG8Bpir8EykLYYW1OJMhZorbIQ=</HostId></Error>
我應該怎麼解決這個問題?
Boto版本是2.38.0
仔細檢查您的訪問密鑰和密鑰以驗證它們是否正確。另外,請檢查客戶端計算機上的時間,並確保它是正確的。 – garnaat
好的,我剛纔注意到提供一個錯誤的密碼導致了相同的錯誤信息......我認爲認證很好,因爲在boto.connect_s3成功執行後引發了錯誤。我明白,也許涉及懶惰的操作... –
直到實際進行調用後纔會檢查憑據。 – garnaat