RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1710750 - Catch and translate LibraryError exceptions
Summary: Catch and translate LibraryError exceptions
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcs
Version: 7.6
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Tomas Jelinek
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-16 08:57 UTC by Tomas Jelinek
Modified: 2020-03-31 19:10 UTC (History)
6 users (show)

Fixed In Version: pcs-0.9.168-1.el7
Doc Type: Bug Fix
Doc Text:
Cause: LibraryError exceptions which pcs uses for passing errors internally were not always caught and processed to human-readable form. Consequence: Pcs crashed with a traceback. Fix: Catch LibraryError exceptions at the top level and translate them. Result: Pcs exits gracefully with a readable error message.
Clone Of:
Environment:
Last Closed: 2020-03-31 19:09:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed fix (7.09 KB, patch)
2019-06-28 16:01 UTC, Tomas Jelinek
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:0996 0 None None None 2020-03-31 19:10:00 UTC

Description Tomas Jelinek 2019-05-16 08:57:33 UTC
Description of problem:
When a new function which may raise a LibraryError exception is called from an old-architecture pcs code, the exception is not always caught and produces a traceback.

All LibrayError exceptions should be caught in app.py and translated to human-readable messages. This has already been done in pcs-0.10 branch.


Version-Release number of selected component (if applicable):
pcs-0.9.165-6.el7


How reproducible:
always, easily


Steps to Reproduce:
1. # mv /usr/sbin/crm_mon /usr/sbin/crm_mon_
2. # pcs status
3. # mv /usr/sbin/crm_mon_ /usr/sbin/crm_mon


Actual results:
Traceback (most recent call last):
  File "/usr/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.165', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 212, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 176, in <lambda>
    utils.get_modifiers()
  File "/usr/lib/python2.7/site-packages/pcs/status.py", line 28, in status_cmd
    full_status()
  File "/usr/lib/python2.7/site-packages/pcs/status.py", line 74, in full_status
    stdout, stderr, retval = utils.cmd_runner().run(monitor_command)
  File "/usr/lib/python2.7/site-packages/pcs/lib/external.py", line 428, in run
    reports.run_external_process_error(log_args, e.strerror)
pcs.lib.errors.LibraryError: ERROR RUN_EXTERNAL_PROCESS_ERROR: {'reason': 'No such file or directory', 'command': 'crm_mon --one-shot --inactive'} forceable: None


Expected results:
Error: unable to run command /usr/sbin/crm_mon --one-shot --inactive: No such file or directory: '/usr/sbin/crm_mon'


Additional info:
FAF reports:
https://retrace.fedoraproject.org/faf/reports/2407183/
https://retrace.fedoraproject.org/faf/reports/2402402/

Comment 1 Tomas Jelinek 2019-06-28 16:01:51 UTC
Created attachment 1585679 [details]
proposed fix

Test is in comment 0.

Comment 3 Ivan Devat 2019-08-05 11:24:05 UTC
After Fix:

[kid76 ~] $ rpm -q pcs
pcs-0.9.168-1.el7.x86_64

[kid76 ~] $ mv /usr/sbin/crm_mon /usr/sbin/crm_mon_
[kid76 ~] $ pcs status
Error: unable to run command /usr/sbin/crm_mon --one-shot --inactive: No such file or directory
[kid76 ~] $ mv /usr/sbin/crm_mon_ /usr/sbin/crm_mon

Comment 7 errata-xmlrpc 2020-03-31 19:09:37 UTC
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-2020:0996


Note You need to log in before you can comment on or make changes to this bug.