Bug 460216 - fence_apc fail after repeating port selection
fence_apc fail after repeating port selection
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: cman (Show other bugs)
5.2
All Linux
medium Severity high
: rc
: ---
Assigned To: Marek Grac
Cluster QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-26 16:30 EDT by Matt Harrington
Modified: 2009-04-16 18:40 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-20 16:51:57 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matt Harrington 2008-08-26 16:30:19 EDT
Description of problem:
fence_apc repeats the port selection argument inadvertently entering an unexpected menu when the port <= 2.  This is harmless for ports > 2, but raises an "unknown screen encountered" exception otherwise.


Version-Release number of selected component (if applicable):
cman-2.0.84-2.el5
apc aos 3.5.9


How reproducible:
Always
use fence_apc to power-down port 1 or 2.


Steps to Reproduce:
1. Use fence_apc to power-down port 1 or 2 (/sbin/fence_apc -a <ip> -l <user> -p <pass> -n 2 -o off)
2. Wait for error
  
Actual results:
[root@fs102 ~]# /sbin/fence_apc -a 10.10.1.201 -l pdu -p pdu -n 2 -o status
Status check successful. Port 2 is ON
[root@fs102 ~]# /sbin/fence_apc -a 10.10.1.201 -l pdu -p pdu -n 2 -o off
Traceback (most recent call last):
 File "/sbin/fence_apc", line 829, in ?
   main()
 File "/sbin/fence_apc", line 303, in main
   do_power_off(sock)
 File "/sbin/fence_apc", line 813, in do_power_off
   x = do_power_switch(sock, "off")
 File "/sbin/fence_apc", line 611, in do_power_switch
   result_code, response = power_off(txt + ndbuf)
 File "/sbin/fence_apc", line 817, in power_off
   x = power_switch(buffer, False, "2", "3");
 File "/sbin/fence_apc", line 810, in power_switch
   raise "unknown screen encountered in \n" + str(lines) + "\n"
unknown screen encountered in
['2', '', '', '------- Configure Outlet ------------------------------------------------------', '', '    #  State  Ph  Name                     Pwr On Dly  Pwr Off Dly  Reboot Dur.', '   ----------------------------------------------------------------------------', '    2  ON     1   fs103                    0 sec       0 sec        5 sec', '', '     1- Outlet Name         : fs103', '     2- Power On Delay(sec) : 0', '     3- Power Off Delay(sec): 0', '     4- Reboot Duration(sec): 5', '     5- Accept Changes      : ', '', '     ?- Help, <ESC>- Back, <ENTER>- Refresh, <CTRL-L>- Event Log'] 


Expected results:
Power is disabled on the specified port.


Additional info:
The repetition of arguments can be seen in the verbose log for high number ports.  Repeating the port number is harmless if a corresponding menu item does not exist.

###############################################
Telnetting to apc switch 10.10.1.200
Tue Aug 26 15:40:10 2008
socket open to 10.10.1.200

User Name : Sending login: pdu
pdu
Password  : Sending password: pdu
***


American Power Conversion               Network Management Card AOS      v3.5.9
(c) Copyright 2008 All Rights Reserved  Rack PDU APP                     v3.5.8
-------------------------------------------------------------------------------
Name      : pdu101                                    Date : 08/26/2008
Contact   : servers@eons.com                          Time : 15:39:52
Location  : Server Room                               User : Administrator
Up Time   : 0 Days 0 Hours 20 Minutes                 Stat : P+ N+ A+

Switched Rack PDU: Communication Established

------- Control Console -------------------------------------------------------

     1- Device Manager
     2- Network
     3- System
     4- Logout

     <ESC>- Main Menu, <ENTER>- Refresh, <CTRL-L>- Event Log
> 1

------- Device Manager --------------------------------------------------------

     1- Phase Management
     2- Outlet Management
     3- Power Supply Status

     <ESC>- Back, <ENTER>- Refresh, <CTRL-L>- Event Log
> 2

------- Outlet Management -----------------------------------------------------

     1- Outlet Control/Configuration
     2- Outlet Restriction

     <ESC>- Back, <ENTER>- Refresh, <CTRL-L>- Event Log
> 1

------- Outlet Control/Configuration ------------------------------------------

     1- Outlet 1                 ON
     2- build                    ON
     3- www103                   ON
     4- www102                   ON
     5- Outlet 5                 ON
     6- Outlet 6                 ON
     7- Outlet 7                 ON
     8- fs102                    ON
     9- build                    ON
    10- app102                   ON
    11- Outlet 11                ON
    12- db103                    ON
    13- fs103                    ON
    14- Outlet 14                ON
    15- Outlet 15                ON
    16- Outlet 16                ON
    17- Master Control/Configuration

     <ESC>- Back, <ENTER>- Refresh, <CTRL-L>- Event Log
> 

------- Outlet Control/Configuration ------------------------------------------

     1- Outlet 1                 ON
     2- build                    ON
     3- www103                   ON
     4- www102                   ON
     5- Outlet 5                 ON
     6- Outlet 6                 ON
     7- Outlet 7                 ON
     8- fs102                    ON
     9- build                    ON
    10- app102                   ON
    11- Outlet 11                ON
    12- db103                    ON
    13- fs103                    ON
    14- Outlet 14                ON
    15- Outlet 15                ON
    16- Outlet 16                ON
    17- Master Control/Configuration

     <ESC>- Back, <ENTER>- Refresh, <CTRL-L>- Event Log
> 13

------- fs103 -----------------------------------------------------------------

        Name         : fs103
        Outlet       : 13
        State        : ON

     1- Control Outlet    
     2- Configure Outlet  

     ?- Help, <ESC>- Back, <ENTER>- Refresh, <CTRL-L>- Event Log
> 13   <<< DUPLICATE MENU SELECTION HERE

------- fs103 -----------------------------------------------------------------

        Name         : fs103
        Outlet       : 13
        State        : ON

     1- Control Outlet    
     2- Configure Outlet  

     ?- Help, <ESC>- Back, <ENTER>- Refresh, <CTRL-L>- Event Log
> 1
... (complete successfully)
Comment 1 Matt Harrington 2008-08-26 17:26:18 EDT
I don't see it now, but I recall there once being pagination on the "Outlet Control/Configuration" listing.  Could this be related?
Comment 2 Marek Grac 2008-08-27 09:25:13 EDT
Can you test our new fence agent for APC? You can find it in git repository (available also from web http://git.fedorahosted.org/git/cluster.git) in branch RHEL5 (also in master, stable2, ...). Just download package pexpect, fence/agents/apc/fence_apc.py and fence/agents/lib/fencing.py.py (rename to fencing.py); and try to run it from command-line (./fence_apc.py -h).Please let me know the results.
Comment 3 Matt Harrington 2008-08-27 09:34:06 EDT
I believe the new version is working:

[root@fs102 tmp]# ./fence_apc.py -a 10.10.1.201 -l pdu -p pdu -n 2 -o status
Status: ON
[root@fs102 tmp]# ./fence_apc.py -a 10.10.1.201 -l pdu -p pdu -n 2 -o off
Success: Powered OFF
[root@fs102 tmp]# ./fence_apc.py -a 10.10.1.201 -l pdu -p pdu -n 2 -o status
Status: OFF
[root@fs102 tmp]# ./fence_apc.py -a 10.10.1.201 -l pdu -p pdu -n 2 -o on
Success: Powered ON

Would it be possible to get this new version released in the next cman package?
Comment 4 Marek Grac 2008-08-27 09:42:32 EDT
New fence agents should be part of Cluster 2.99.X branch (announced weekly on cluster list) and will be part of the next update.
Comment 5 RHEL Product and Program Management 2008-08-27 09:51:47 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 8 errata-xmlrpc 2009-01-20 16:51:57 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0189.html

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