Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

oscapd-cli error when attempting to display results of a notexisting task #95

Open
jan-cerny opened this issue Sep 8, 2016 · 1 comment
Milestone

Comments

@jan-cerny
Copy link
Member

Hi, when I accidentally tried to get results of a task that does not exist on my system (and never existed), I got a beautiful error with a lovely traceback, which can be seen below.

However as a user I would expect some ugly error message instead, eg. "Task number 8 does not exist".

[root@localhost ~]# oscapd-cli result 8 1 > results.xml
Traceback (most recent call last):
  File "/usr/bin/oscapd-cli", line 821, in <module>
    main()
  File "/usr/bin/oscapd-cli", line 813, in main
    cli_result(dbus_iface, args)
  File "/usr/bin/oscapd-cli", line 433, in cli_result
    arf = dbus_iface.GetARFOfTaskResult(args.task_id, args.result_id)
  File "/usr/lib64/python3.5/site-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib64/python3.5/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Python.KeyError: Traceback (most recent call last):
  File "/usr/lib64/python3.5/site-packages/dbus/service.py", line 707, in _message_cb
    retval = candidate_method(self, *args, **keywords)
  File "/usr/lib/python3.5/site-packages/openscap_daemon/dbus_daemon.py", line 341, in GetARFOfTaskResult
    return self.system.get_xml_of_task_result(task_id, result_id)
  File "/usr/lib/python3.5/site-packages/openscap_daemon/system.py", line 607, in get_xml_of_task_result
    task = self.tasks[task_id]
KeyError: dbus.Int64(8)

I am using openscap-daemon-0.1.6-1.fc25.noarch on Fedora 25 Server alpha.

@jan-cerny jan-cerny added the bug label Sep 8, 2016
@mpreisler mpreisler added this to the 0.1.7 milestone Sep 8, 2016
@mpreisler mpreisler added enhancement and removed bug labels Nov 23, 2016
@jan-cerny jan-cerny modified the milestones: 0.1.8, 0.1.7 Jul 17, 2017
@mpreisler
Copy link
Member

I wanted to fix this but it would be a large change, would need refactoring of most methods in the system.System class. Let's postpone this.

@mpreisler mpreisler modified the milestones: 0.1.8, 0.1.9 Sep 28, 2017
@matejak matejak modified the milestones: 0.1.9, 0.1.10 Jan 16, 2018
@matejak matejak modified the milestones: 0.1.10, 0.1.11 Feb 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants