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 2086559 - fence_apc, fence_ilo_moonshot, fence_lpar: missing "import logging" (RHEL9)
Summary: fence_apc, fence_ilo_moonshot, fence_lpar: missing "import logging" (RHEL9)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: fence-agents
Version: 9.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 9.1
Assignee: Oyvind Albrigtsen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On: 2080729
Blocks: 2086839
TreeView+ depends on / blocked
 
Reported: 2022-05-16 12:35 UTC by Oyvind Albrigtsen
Modified: 2022-11-15 10:31 UTC (History)
8 users (show)

Fixed In Version: fence-agents-4.10.0-24.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2080729
: 2086839 (view as bug list)
Environment:
Last Closed: 2022-11-15 09:59:10 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-122115 0 None None None 2022-05-16 12:47:11 UTC
Red Hat Product Errata RHBA-2022:7981 0 None None None 2022-11-15 09:59:48 UTC

Description Oyvind Albrigtsen 2022-05-16 12:35:39 UTC
+++ This bug was initially created as a clone of Bug #2080729 +++

Description of problem:
My setup uses a APC master switch (Specificly a RackPDU 7800.) to fence it's hosts. The APC unit configured for telnet access. The apc fence type is used by oVirt to handle this fencing type.

When /usr/bin/fence_apc is invoked by the user, the command succeeds. When the engine invokes the command, we see that the it has appended an extra string, (in this case a " -6"), to the open command given to the telnet binary. The extra string results in failure to fence the host. Although an IP address is used below, the same result occurs if the engine is given a DNS hostname.

---snip---
May 01 07:02:05 azura.codenet /fence_apc[18208]: Timeout exceeded.
                                                 <fencing.fspawn object at 0x7f6ffd503048>
                                                 command: /usr/bin/telnet
                                                 args: [b'/usr/bin/telnet']
                                                 buffer (last 100 chars): 'net> open 192.168.9.50 -6\r\ntelnet: 192.168.9.50: Address family for hostname not supported\r\nt>
                                                 before (last 100 chars): 'net> open 192.168.9.50 -6\r\ntelnet: 192.168.9.50: Address family for hostname not supported\r\nt>
                                                 after: <class 'pexpect.exceptions.TIMEOUT'>
                                                 match: None
                                                 match_index: None
                                                 exitstatus: None
                                                 flag_eof: False
                                                 pid: 18210
                                                 child_fd: 6
                                                 closed: False
                                                 timeout: 30
                                                 delimiter: <class 'pexpect.exceptions.EOF'>
                                                 logfile: None
                                                 logfile_read: None
                                                 logfile_send: None
                                                 maxread: 2000
                                                 ignorecase: False
                                                 searchwindowsize: None
                                                 delaybeforesend: 0.05
                                                 delayafterclose: 0.1
                                                 delayafterterminate: 0.1
                                                 searcher: searcher_re:
                                                     0: re.compile('(login\\s*: )|((?!Last )Login Name:  )|(username: )|(User Name :)')
May 01 07:02:05 azura.codenet /fence_apc[18208]: Unable to connect/login to fencing device

Version-Release number of selected component (if applicable):
ovirt-host-4.5.0-3.el8.x86_64
vdsm-4.50.0.13-1.el8.x86_64
fence-agents-apc-4.2.1-89.el8.noarch

How reproducible:
Always.

Steps to Reproduce:
1. Set up power management for a host in oVirt 4.5 to use the "apc" fence type, do not enable the secure option.

2. Attempt to fence the host. Or test the fence agent's configuration in the admin UI.

Actual results:
Failure to fence the host. Failure to get power management status. Test configuration fails.

Expected results:
Host can be fenced, power management status is retrievable, test configuration passes.

Additional info:
There seems to be a similar issue described in an old discussion on the oVirt users mailing list: https://lists.ovirt.org/archives/list/users@ovirt.org/thread/GBD7MUJKXDZE56TYUCBJNDE7TWS7CHTZ/

--- Additional comment from Patrick Hibbs on 2022-05-01 15:48:37 CEST ---

In the process of debugging this, I've found that the logging python library wasn't included by the fence_apc script despite it's use. Altering script to include the missing library seems to have fixed the issue.

I.e. adding "import logging" to the other import lines at the top of /usr/sbin/fence_apc.

--- Additional comment from Eli Mesika on 2022-05-15 10:27:10 CEST ---

I understood that you workaround that manually by adding the missing import to the agent python file.

Which version of fence-agents package are installed on the host that serves as a proxy to the fencing operation.
We have to check the sources and open a bug if the problem is a missing import in the Python code

--- Additional comment from Patrick Hibbs on 2022-05-16 04:20:39 CEST ---

According to the rpm -qa output on the host the fence-agents packages have these version numbers:

$ rpm -qa | grep fence-agent
fence-agents-brocade-4.2.1-93.el8.noarch
fence-agents-heuristics-ping-4.2.1-93.el8.noarch
fence-agents-intelmodular-4.2.1-93.el8.noarch
fence-agents-sbd-4.2.1-93.el8.noarch
fence-agents-apc-4.2.1-93.el8.noarch
fence-agents-eaton-snmp-4.2.1-93.el8.noarch
fence-agents-ilo-mp-4.2.1-93.el8.noarch
fence-agents-rhevm-4.2.1-93.el8.noarch
fence-agents-common-4.2.1-93.el8.noarch
fence-agents-apc-snmp-4.2.1-93.el8.noarch
fence-agents-cisco-ucs-4.2.1-93.el8.noarch
fence-agents-emerson-4.2.1-93.el8.noarch
fence-agents-ibmblade-4.2.1-93.el8.noarch
fence-agents-ilo-ssh-4.2.1-93.el8.noarch
fence-agents-ipmilan-4.2.1-93.el8.noarch
fence-agents-rsa-4.2.1-93.el8.noarch
fence-agents-vmware-rest-4.2.1-93.el8.noarch
fence-agents-kdump-4.2.1-93.el8.x86_64
fence-agents-bladecenter-4.2.1-93.el8.noarch
fence-agents-compute-4.2.1-93.el8.noarch
fence-agents-eps-4.2.1-93.el8.noarch
fence-agents-ifmib-4.2.1-93.el8.noarch
fence-agents-ilo2-4.2.1-93.el8.noarch
fence-agents-mpath-4.2.1-93.el8.noarch
fence-agents-rsb-4.2.1-93.el8.noarch
fence-agents-vmware-soap-4.2.1-93.el8.noarch
fence-agents-all-4.2.1-93.el8.x86_64
fence-agents-amt-ws-4.2.1-93.el8.noarch
fence-agents-drac5-4.2.1-93.el8.noarch
fence-agents-ilo-moonshot-4.2.1-93.el8.noarch
fence-agents-redfish-4.2.1-93.el8.x86_64
fence-agents-wti-4.2.1-93.el8.noarch
fence-agents-cisco-mds-4.2.1-93.el8.noarch
fence-agents-hpblade-4.2.1-93.el8.noarch
fence-agents-ipdu-4.2.1-93.el8.noarch
fence-agents-scsi-4.2.1-93.el8.noarch

--- Additional comment from Eli Mesika on 2022-05-16 09:41:51 CEST ---

Checked latest fence-agents code on github
I found all scripts affected 

I have opened an issue in fence-agents github [1] 

workaround :

Either downgrade to version 4.2.1-53 or fix manually until a new release fixing that is available and distributed 


[1] https://github.com/ClusterLabs/fence-agents/issues/485

--- Additional comment from Oyvind Albrigtsen on 2022-05-16 11:06:00 CEST ---

Fix: https://github.com/ClusterLabs/fence-agents/pull/486

fence_lpar patch that makes it use fail_usage() intead: https://github.com/ClusterLabs/fence-agents/pull/474.

Comment 7 errata-xmlrpc 2022-11-15 09:59:10 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 (fence-agents bug fix and enhancement update), 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-2022:7981


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