Bug 1613946
| Summary: | RFE: Enhanced Python error reporting | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Richard W.M. Jones <rjones> | |
| Component: | nbdkit | Assignee: | Richard W.M. Jones <rjones> | |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | |
| Severity: | high | Docs Contact: | ||
| Priority: | high | |||
| Version: | 7.6 | CC: | jherrman, juzhou, mtessun, mxie, mzhan, tzheng, xiaodwan, zili | |
| Target Milestone: | rc | Keywords: | FutureFeature, ZStream | |
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | V2V | |||
| Fixed In Version: | nbdkit-1.2.6-1.el7.2 | Doc Type: | Enhancement | |
| Doc Text: |
The Python plug-in for the nbdkit tool suite has been enhanced to print full stack traces when errors occur in Python scripts. As a result, certain error messages that can be generated when converting a virtual machine to Red Hat Virtualization using the virt-v2v utility now provide significantly more information.
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 1614750 1647740 (view as bug list) | Environment: | ||
| Last Closed: | 2019-08-06 12:02:10 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | 1557273 | |||
| Bug Blocks: | 1647740 | |||
|
Description
Richard W.M. Jones
2018-08-08 15:32:36 UTC
Reproducer:
(1) Create a file called 'test.py' containing:
def function():
raise RuntimeError("error")
def config(key, value):
function()
def open(readonly):
raise RuntimeError("open")
def get_size(h):
raise RuntimeError("get_size")
def pread(h, count, offset):
raise RuntimeError("pread")
(2) Run this command:
$ nbdkit -fv python ./test.py foo=bar
When the RFE has not been implemented you will see only this:
nbdkit: error: ./test.py: config: error: error
With the RFE implemented you will see a full traceback:
nbdkit: error: ./test.py: config: error: ['Traceback (most recent call last):\n', ' File "./test.py", line 4, in config\n function()\n', ' File "./test.py", line 2, in function\n raise RuntimeError("error")\n', 'RuntimeError: error\n']
*** Bug 1614187 has been marked as a duplicate of this bug. *** Requesting exception for RHEL 7.6. It's a small change and easily tested, and it will greatly improve the logs/errors collected from customer machines deploying IMS 1.0. Verify the bug with builds:
nbdkit-plugin-python-common-1.8.0-1.el7.x86_64
nbdkit-plugin-python2-1.8.0-1.el7.x86_64
nbdkit-1.8.0-1.el7.x86_64
nbdkit-plugin-vddk-1.8.0-1.el7.x86_64
Steps:
1.Create a file called 'test.py' with below content:
$ cat test.py
def function():
raise RuntimeError("error")
def config(key, value):
function()
def open(readonly):
raise RuntimeError("open")
def get_size(h):
raise RuntimeError("get_size")
def pread(h, count, offset):
raise RuntimeError("pread")
2.Run command:
$ nbdkit -fv python2 ./test.py foo=bar
nbdkit: debug: TLS disabled: could not load TLS certificates
nbdkit: debug: registering plugin /usr/lib64/nbdkit/plugins/nbdkit-python2-plugin.so
nbdkit: debug: registered plugin /usr/lib64/nbdkit/plugins/nbdkit-python2-plugin.so (name python)
nbdkit: debug: python: load
nbdkit: debug: python: config key=script, value=./test.py
nbdkit: debug: python: config key=foo, value=bar
nbdkit: error: ./test.py: config: error: ['Traceback (most recent call last):\n', ' File "./test.py", line 4, in config\n function()\n', ' File "./test.py", line 2, in function\n raise RuntimeError("error")\n', 'RuntimeError: error\n']
Result:
nbdkit can get full traceback when a Python call fails, so move the bug from ON_QA to VERIFIED
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:2015 |