Incorrect payload in notification results in running status forever

Bug #1808513 reported by jayashri bidwe on 2018-12-14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
jayashri bidwe

Bug Description

Bug Description:
Create a notification using empty payload.

curl -g -i -X POST http://<IP>/instance-ha/v1/<Project_ID>/notifications -H "Content-Type: application/json" -H "User-Agent: masakari keystoneauth1/3.11.1 python-requests/2.20.0 CPython/2.7.12" -H "X-Auth-Token: <AUTH _TOKEN>" -d '{"notification": {"hostname": "ABC", "type": "PROCESS", "payload": {}, "generated_time": "2018-12-06 16:47:55"}}'

It creates a notification successfully but notification status goes into running state forever.

Actual Result:
It creates a notification successfully.

Expected Result:
It should fail if payload is empty or not as per the API ref document [1]


Changed in masakari:
status: New → Confirmed

Fix proposed to branch: master

Changed in masakari:
assignee: nobody → jayashri bidwe (jayashrib)
status: Confirmed → In Progress
Changed in masakari:
assignee: jayashri bidwe (jayashrib) → Shilpa Devharakar (shilpasd)
Changed in masakari:
assignee: Shilpa Devharakar (shilpasd) → jayashri bidwe (jayashrib)

Submitter: Zuul
Branch: master

commit 70ecfe946e679c432676a09ed31daeaffca73359
Author: jayashri bidwe <email address hidden>
Date: Mon Dec 10 11:57:08 2018 +0530

    Return 400 if notification payload is incorrect

    This patch validates the notification payload at schema level as per
    API ref document[1]. Raises BadRequest(400) if payload is incorrect
    based on notification type.

    BadRequest(400) is returned if payload is incorrect instead of 202
    during notification create.

    Closes-Bug: #1808513


    Change-Id: Iccad15a955be1b11f31d829624d43b6ea915305c

Changed in masakari:
status: In Progress → Fix Released

This issue was fixed in the openstack/masakari release candidate.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers