ec2 api does not work for aws-java-sdk

Bug #1156445 reported by MotoKen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
MotoKen
Grizzly
Fix Released
Low
Vish Ishaya

Bug Description

ec2 api does not work for aws-java-sdk anymore since commit cb72ff1fa700f5a8be172df5a14dd479bf75fa36

I try to use aws-java-sdk-1.0.11.jar and aws-java-sdk-1.4.1.jar to make queries to nova. However, it always causes "Timestamp is invalid" error for any aws-java-sdk requests.

2013-03-18 12:19:29.242 ERROR nova.api.ec2.ec2utils [req-0e4d4c31-2c5e-439e-9030-9161abc47a8d 1458120d63784bb49858437c275dc59e 7dd8607e7d294efc845ccf68f8d282b7] Timestamp is invalid.
2013-03-18 12:19:29.242 1458 TRACE nova.api.ec2.ec2utils Traceback (most recent call last):
2013-03-18 12:19:29.242 1458 TRACE nova.api.ec2.ec2utils File "/usr/lib/python2.7/dist-packages/nova/api/ec2/ec2utils.py", line 200, in is_ec2_timestamp_expired
2013-03-18 12:19:29.242 1458 TRACE nova.api.ec2.ec2utils "%Y-%m-%dT%H:%M:%SZ")
2013-03-18 12:19:29.242 1458 TRACE nova.api.ec2.ec2utils File "/usr/lib/python2.7/dist-packages/nova/openstack/common/timeutils.py", line 61, in parse_strtime
2013-03-18 12:19:29.242 1458 TRACE nova.api.ec2.ec2utils return datetime.datetime.strptime(timestr, fmt)
2013-03-18 12:19:29.242 1458 TRACE nova.api.ec2.ec2utils File "/usr/lib/python2.7/_strptime.py", line 325, in _strptime
2013-03-18 12:19:29.242 1458 TRACE nova.api.ec2.ec2utils (data_string, format))
2013-03-18 12:19:29.242 1458 TRACE nova.api.ec2.ec2utils ValueError: time data '2013-03-18T04:16:35.924Z' does not match format '%Y-%m-%dT%H:%M:%SZ'
2013-03-18 12:19:29.242 1458 TRACE nova.api.ec2.ec2utils

If revert commit cb72ff1fa700f5a8be172df5a14dd479bf75fa36, it can work well for aws-java-sdk-1.0.11.jar and aws-java-sdk-1.4.1.jar

Tags: ec2
Revision history for this message
Chuck Short (zulcss) wrote :

Which ec2 api version are you using?

tags: added: ec2
Changed in nova:
status: New → Incomplete
MotoKen (motokentsai)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/24967

Changed in nova:
assignee: nobody → MotoKen (motokentsai)
status: Incomplete → In Progress
Joe Gordon (jogo)
tags: added: grizzly-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/24967
Committed: http://github.com/openstack/nova/commit/69e940c661731c8ac3cc0cf4e874929c86dcdeb2
Submitter: Jenkins
Branch: master

commit 69e940c661731c8ac3cc0cf4e874929c86dcdeb2
Author: MotoKen <email address hidden>
Date: Wed Mar 20 13:46:42 2013 +0800

    Accepts aws-sdk-java timestamp format

    The aws-sdk-java timestamp format is "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
    which contains millisecond representation. However, the current
    implementation does not accept this kind of format.

    References:
    https://github.com/aws/aws-sdk-java/blob/master/src/main/java/com/amazonaws/auth/QueryStringSigner.java#L173

    Adds ability to parse this format in ec2utils.is_ec2_timestamp_expired.

    Fixes bug 1156445.

    Change-Id: I389ff8b9c6c91b699538b889add264d66dbb8131

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
importance: Undecided → Low
tags: removed: grizzly-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/grizzly)

Fix proposed to branch: stable/grizzly
Review: https://review.openstack.org/26878

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/grizzly)

Reviewed: https://review.openstack.org/26878
Committed: http://github.com/openstack/nova/commit/6c01eee9da2dae3522670877b3405dc9c4558062
Submitter: Jenkins
Branch: stable/grizzly

commit 6c01eee9da2dae3522670877b3405dc9c4558062
Author: MotoKen <email address hidden>
Date: Wed Mar 20 13:46:42 2013 +0800

    Accepts aws-sdk-java timestamp format

    The aws-sdk-java timestamp format is "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
    which contains millisecond representation. However, the current
    implementation does not accept this kind of format.

    References:
    https://github.com/aws/aws-sdk-java/blob/master/src/main/java/com/amazonaws/auth/QueryStringSigner.java#L173

    Adds ability to parse this format in ec2utils.is_ec2_timestamp_expired.

    Fixes bug 1156445.

    Change-Id: I389ff8b9c6c91b699538b889add264d66dbb8131
    (cherry picked from commit 69e940c661731c8ac3cc0cf4e874929c86dcdeb2)

Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.