Bug 659248

Summary: Incorrect signatures in AWS EC2 calls with python-boto
Product: [Fedora] Fedora Reporter: Vlastimil Holer <vlastimil.holer>
Component: python-botoAssignee: Lubomir Rintel <lkundrak>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: jsmith.fedora, lkundrak, redhat-bugzilla, walters
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-boto-1.9b-5.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-17 20:57:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vlastimil Holer 2010-12-02 10:13:14 UTC
Description of problem:

I'm using python-boto library in scripts to communicate with Amazon Web Services and since the Fedora 14 they have stopped working. The simple commands included in python-boto, e.g. list_instances fail as well. All returning same error:

$ list_instances 
ID                   Groups                         Hostname
Traceback (most recent call last):
  File "/usr/bin/list_instances", line 6, in <module>
    for r in ec2.get_all_instances():
  File "/usr/lib/python2.7/site-packages/boto/ec2/connection.py", line 378, in get_all_instances
    return self.get_list('DescribeInstances', params, [('item', Reservation)])
  File "/usr/lib/python2.7/site-packages/boto/connection.py", line 615, in get_list
    raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 403 Forbidden
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.</Message></Error></Errors><RequestID>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</RequestID></Response>

Version-Release number of selected component (if applicable):

python-2.7-8.fc14.1.x86_64
python-boto-1.9b-4.fc14.noarch (one year old stable version)
python-crypto-2.3-2.fc14.1.x86_64

Steps to Reproduce:
1. install python-boto
2. create a configuration in ~/.boto with your credentials in this format:
[Credentials]
aws_access_key_id=XXXXXXXXXXXXXXXXXXXX
aws_secret_access_key=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

3. execute $ /usr/bin/list_instances
  
Actual results:

All requests fails due to wrong signature.

Expected results:

Everything works and latest python-boto-2.x is part of Fedora.

Additional info:

There is problem with python-boto library and latest python-2.7, there isn't check for this python release in /usr/lib/python2.7/site-packages/boto/connection.py:

@@ -240,7 +240,7 @@ class AWSAuthConnection:
             # in the Host header and so we needed to make sure we
             # did the same when calculating the V2 signature.  In 2.6
             # it no longer does that.  Hence, this kludge.
-            if sys.version[:3] == "2.6" and port == 443:
+            if sys.version[:3] in ("2.6","2.7") and port == 443:
                 signature_host = self.host
             else:
                 signature_host = '%s:%d' % (self.host, port)

Comment 1 Fedora Update System 2010-12-02 10:27:45 UTC
python-boto-1.9b-5.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/python-boto-1.9b-5.fc14

Comment 2 Fedora Update System 2010-12-02 19:16:48 UTC
python-boto-1.9b-5.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update python-boto'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/python-boto-1.9b-5.fc14

Comment 3 Jared Smith 2010-12-09 19:11:38 UTC
I just wanted to say "thank you" -- the package in updates-testing definitely fixes the problem connecting to AWS using Python 2.7.  (And yes, I gave the package karma!)

Comment 4 Fedora Update System 2011-01-17 20:57:47 UTC
python-boto-1.9b-5.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.