POSTing a sample with a badly formatted timestamp raises 500 when it should raise a 400

Bug #1428624 reported by Chris Dent
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Undecided
Chris Dent
WSME
Fix Released
Undecided
Stéphane Bisinger

Bug Description

The following request results in a 500 (due to the bad timestamp) but ought to result in a 400. The is caused by an apparently uncaught exception when processing the timestring. Most likely in WSME but potentially in the way Ceilometer is using WSME.

    - name: post counter with bad timestamp
      desc: bad timestamp results in 500
      xfail: true
      url: /v2/meters/apples
      method: POST
      request_headers:
          content-type: application/json
      data:
          - counter_name: apples
            counter_type: gauge
            counter_unit: instance
            counter_volume: 3
            resource_id: aa9431c1-8d69-4ad3-803a-8d4a6b89fdaa
            timestamp: "2013-01-bad 23:23:20"

Revision history for this message
Stéphane Bisinger (kjir) wrote :

This is fixed in the master branch.

Reviewed: https://review.openstack.org/177026
Committed: https://git.openstack.org/cgit/stackforge/wsme/commit/?id=f66cf4c3cc1323ec563bdb22d26fb5c6b585b32f
Submitter: Jenkins
Branch: master

commit f66cf4c3cc1323ec563bdb22d26fb5c6b585b32f
Author: Stéphane Bisinger <email address hidden>
Date: Fri Apr 24 00:55:09 2015 +0200

    Raise an InvalidInput if you get a ValueError from JSON data.

    When you parse JSON, if some parts of the message have the wrong type of data
    you would get a ValueError, returning a 500 HTTP status code. Now the
    ValueError gets wrapped in an InvalidInput which will result in a 400 HTTP
    response sent back to the client.

    Closes-Bug: #1392409
    Change-Id: I7702b824a98185d194a29d593b23e47dfd9bca3e

Changed in wsme:
assignee: nobody → Stéphane Bisinger (kjir)
status: New → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

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

Changed in ceilometer:
assignee: nobody → Mehdi Abaakouk (sileht)
status: New → In Progress
Changed in wsme:
milestone: none → 0.8.0
status: Fix Committed → Fix Released
Changed in ceilometer:
assignee: Mehdi Abaakouk (sileht) → Chris Dent (chdent)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/208467
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=d7428b7c3873bb47683c4f4d547fce138b79a74b
Submitter: Jenkins
Branch: master

commit d7428b7c3873bb47683c4f4d547fce138b79a74b
Author: Mehdi Abaakouk <email address hidden>
Date: Mon Aug 3 14:41:42 2015 +0200

    Update tests to reflect WSME 0.8 fixes

    All these bugs are now fixed in wsme 0.8.0

    Closes-bug: #1424642
    Closes-bug: #1423634
    Closes-bug: #1419110
    Closes-bug: #1428185
    Closes-bug: #1428628
    Closes-bug: #1428658
    Closes-bug: #1428624

    Change-Id: Iea8507ebc54f42786a44bfcd96246b88dd998bf0

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: liberty-3 → 5.0.0
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.