boto/boto — Issue #582: Token problem with boto 2.2.1 and python 2.5
Author: mynameisfiber
Created: 2012-02-14 21:08:19+00:00
State: open

I'm trying to connect to a dynamo DB table with boto 2.2.1 and python 2.5. There are two exceptions that happen, first in the "get_session_token" and then later in layer1's "make_request". The exceptions are:

```python
Traceback (most recent call last):
File "/local/lib/python2.5/site-packages/tornado/web.py", line 861, in _execute
getattr(self, self.request.method.lower())(*args, **kwargs)
File "/mnt/local/dragoneye/app/data.py", line 92, in get
dynamo_conn, dynamo_table = tracking_db()
File "/mnt/local/dragoneye/app/data.py", line 26, in tracking_db
dynamo_conn = boto.connect_dynamodb(aws_access_key_id=settings.get("aws_access_key"), aws_secret_access_key=settings.get("aws_secret_access_key"))
File "/local/lib/python2.5/site-packages/boto/__init__.py", line 519, in connect_dynamodb
return Layer2(aws_access_key_id, aws_secret_access_key, **kwargs)
File "/local/lib/python2.5/site-packages/boto/dynamodb/layer2.py", line 71, in __init__
host, debug, session_token)
File "/local/lib/python2.5/site-packages/boto/dynamodb/layer1.py", line 79, in __init__
session_token = self._get_session_token()
File "/local/lib/python2.5/site-packages/boto/dynamodb/layer1.py", line 99, in _get_session_token
return sts.get_session_token()
File "/local/lib/python2.5/site-packages/boto/sts/connection.py", line 103, in get_session_token
token = self._check_token_cache(token_key, duration)
File "/local/lib/python2.5/site-packages/boto/sts/connection.py", line 64, in _check_token_cache
expires = boto.utils.parse_ts(token.expiration)
File "/local/lib/python2.5/site-packages/boto/utils.py", line 251, in parse_ts
dt = datetime.datetime.strptime(ts, ISO8601_MS)
File "/local/lib/python2.5/_strptime.py", line 320, in strptime
(bad_directive, format))
ValueError: 'f' is a bad directive in format '%Y-%m-%dT%H:%M:%S.%fZ'
```

and

```python
Traceback (most recent call last):
File "/local/lib/python2.5/site-packages/tornado/web.py", line 861, in _execute
getattr(self, self.request.method.lower())(*args, **kwargs)
File "/mnt/local/dragoneye/app/data.py", line 92, in get
dynamo_conn, dynamo_table = tracking_db()
File "/mnt/local/dragoneye/app/data.py", line 27, in tracking_db
dynamo_table = dynamo_conn.get_table(settings.get("dynamodb_ghash_to_keywords"))
File "/local/lib/python2.5/site-packages/boto/dynamodb/layer2.py", line 293, in get_table
response = self.layer1.describe_table(name)
File "/local/lib/python2.5/site-packages/boto/dynamodb/layer1.py", line 180, in describe_table
return self.make_request('DescribeTable', json_input)
File "/local/lib/python2.5/site-packages/boto/dynamodb/layer1.py", line 116, in make_request
retry_handler=self._retry_handler)
File "/local/lib/python2.5/site-packages/boto/connection.py", line 746, in _mexe
status = retry_handler(response, i, next_sleep)
File "/local/lib/python2.5/site-packages/boto/dynamodb/layer1.py", line 143, in _retry_handler
json_response)
DynamoDBResponseError: DynamoDBResponseError: 400 Bad Request
{'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.', '__type': 'com.amazon.coral.service#InvalidSignatureException'}
```
Any ideas?

Thanks!