Failure to push data through CLI

Bug #1619065 reported by Tim Hinrichs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
congress
Triaged
Medium
Unassigned

Bug Description

Could be user error, but pushing data via the CLI seems to not work. Didn't test the API directly with curl.

(openstack) congress datasource create doctor push
+-------------+--------------------------------------+
| Field | Value |
+-------------+--------------------------------------+
| config | None |
| description | None |
| driver | doctor |
| enabled | True |
| id | 71eba7e6-560d-48a9-a591-cd23ce58eef6 |
| name | push |
| type | None |
+-------------+--------------------------------------+

(openstack) congress datasource row update push data '[ ["data1", "data2"], ["data3", "data4"]]'
Bad Request::translator: data is not in the datasource driver

Revision history for this message
Tim Hinrichs (thinrichs) wrote :

Managed to get this working, but it was a struggle. As a user I didn't know what the schema should be for pushing data, so I used the 'congress driver schema show' command. That doesn't give me the right answer because it's the schema for the data *after* it has been translated. So then I looked up the schema used to do the pushing in the source code. Not sure exactly how to make the user experience better.

$ openstack congress datasource row update push events '[{"id": "0", "time": "2016", "type": "compute.host.down", "details": {"hostname": "a", "status": "down", "monitor": "up", "monitor_event_id": "beta"}}]'
styra@ubuntu:/opt/stack/python-congressclient$ openstack congress datasource row list push events
+----+------+-------------------+----------+--------+---------+------------------+
| id | time | type | hostname | status | monitor | monitor_event_id |
+----+------+-------------------+----------+--------+---------+------------------+
| 0 | 2016 | compute.host.down | a | down | up | beta |
+----+------+-------------------+----------+--------+---------+------------------+

I also hit another 500 error..

$ openstack congress datasource row update push events '[{"id": "0", "time": "2016", "type": "compute.host.down", "hostname": "bob", "status": "up", "monitor": "here", "monitor_event_id": "there", "details": "whatever"}]'
Internal server error (HTTP 500) (Request-ID: req-d492b373-dc09-4b91-86d0-2048b2a1979f)

Changed in congress:
importance: High → Medium
Revision history for this message
Tim Hinrichs (thinrichs) wrote :

Changed the priority back to Medium so that we can improve the error handling.

Also so that we can think about whether we can make the UX better for pushing.

Revision history for this message
Tim Hinrichs (thinrichs) wrote :

There's also a weird return value, where we're capturing the stack trace (presumably by accident):

$ openstack congress datasource row update push events '[{"id": "0", "time": "2016", "type": "compute.host.down", "hostname": "bob", "status": "up", "monitor": "here", "monitor_event_id": "there"}]'

u'\'details\'\nTraceback (most recent call last):\n\n File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/server.py", line 133, in _process_incoming\n res = self.dispatcher.dispatch(message)\n\n File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 150, in dispatch\n return self._do_dispatch(endpoint, method, ctxt, args)\n\n File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 121, in _do_dispatch\n result = func(ctxt, **new_args)\n\n File "/opt/stack/congress/congress/datasources/datasource_driver.py", line 1257, in update_entire_data\n return self.service.update_entire_data(table_id, objs)\n\n File "/opt/stack/congress/congress/datasources/datasource_driver.py", line 1232, in update_entire_data\n tablename, PushedDataSourceDriver.convert_objs(objs, translator))\n\n File "/opt/stack/congress/congress/datasources/datasource_driver.py", line 1043, in convert_objs\n obj_list = translator[cls.OBJECTS_EXTRACT_FN](objects)\n\n File "/opt/stack/congress/congress/datasources/doctor_driver.py", line 80, in flatten_events\n details = event.pop(\'details\')\n\nKeyError: \'details\'\n' (HTTP 400) (Request-ID: req-d789ba64-6bc8-46f3-ae23-95b09d26360d)

Anusha (anusha-iiitm)
Changed in congress:
assignee: nobody → Anusha (anusha-iiitm)
Anusha (anusha-iiitm)
Changed in congress:
assignee: Anusha (anusha-iiitm) → nobody
Eric K (ekcs)
Changed in congress:
status: New → Confirmed
status: Confirmed → Triaged
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.