Bug 1927394

Summary: New web UI - cleanup of resource and fence device doesn't work
Product: Red Hat Enterprise Linux 8 Reporter: Michal Mazourek <mmazoure>
Component: pcsAssignee: Ivan Devat <idevat>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: medium Docs Contact: Steven J. Levine <slevine>
Priority: medium    
Version: 8.4CC: cfeist, cluster-maint, idevat, kmalyjur, mlisik, mpospisi, nhostako, omular, tojeline
Target Milestone: rcKeywords: TechPreview, Triaged
Target Release: 8.5   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.10.8-2.el8 Doc Type: Bug Fix
Doc Text:
Cause: Web ui uses unsupported flag "force" in resource cleanup request to backend. Consequence: Request fails on backend. Fix: Web ui don't use flag "force" anymore. Result: It is possible to cleanup resource from web ui.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-09 17:34:53 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:    
Bug Blocks: 1552470, 1996067, 1999014    
Attachments:
Description Flags
proposed fix none

Description Michal Mazourek 2021-02-10 16:24:34 UTC
Description of problem:
It is not possible to cleanup failed operations from history of the resource and fence agent in the new web UI. 


Version-Release number of selected component (if applicable):
pcs-0.10.8-1.el8


How reproducible:
always


Steps to Reproduce:
- In specific resource page, click 'Cleanup' under the three dots at top right corner and confirm the cleanup (tried on ocf:heartbeat:Dummy)
- The same goes for fence devices


Actual results:
Message appears:
"Danger alert:Communication error while: cleanup resource "resource-1". Details in the browser console."

In console:
Invalid value undefined supplied to : ({ success: "true" } | { error: "true", stdout: string, stderror: string })/0: { success: "true" }/success: "true"
Invalid value [] supplied to : ({ success: "true" } | { error: "true", stdout: string, stderror: string })/1: { error: "true", stdout: string, stderror: string }/stdout: string
Invalid value ["Error: Specified option '--force' is not supported in this command\n"] supplied to : ({ success: "true" } | { error: "true", stdout: string, stderror: string })/1: { error: "true", stdout: string, stderror: string }/stderror: string

This is hinting, that the back end used the cleanup command with --force option, which generates the same error in cli.
[root@virt-058 ~]# pcs resource cleanup r1 --force
Error: Specified option '--force' is not supported in this command
[root@virt-058 ~]# pcs stonith cleanup fence-virt-058 --force
Error: Specified option '--force' is not supported in this command


Expected results:
Cleanup of resources and fence devices works

Comment 2 Ivan Devat 2021-06-10 14:30:04 UTC
Created attachment 1789876 [details]
proposed fix

Comment 3 Miroslav Lisik 2021-06-14 14:22:08 UTC
Test:

[root@r8-node-01 ~]# rpm -q pcs
pcs-0.10.8-2.el8.x86_64

[root@r8-node-01 ~]# crm_resource --resource d-01 --fail -H r8-node-01
Waiting for 1 reply from the controller
... got reply (done)
[root@r8-node-01 ~]# crm_resource --resource fence-r8-node-01 --fail -H r8-node-01
Waiting for 1 reply from the controller
... got reply (done)
[root@r8-node-01 ~]# pcs resource failcount show
Failcounts for resource 'd-01'
  r8-node-01: 1
Failcounts for resource 'fence-r8-node-01'
  r8-node-01: 1

Web UI:
- In resource detail of d-01 resource we see issues:
Warning alert:Failed to asyncmon d-01 on Fri Jun 11 11:30:30 2021 on node r8-node-01: Simulated failure
Danger alert:Resource failed

- After clicking on Cleanup button, confirmation diallog shows up:
Cleanup resource?
This makes the cluster forget failed operations from history of the resource and re-detects its current state.

- After clicking on "Cleanup button" failure is cleaned.

- In Fence Devices detail of fence-r8-node-01 device we see issues:
Warning alert:Failed to asyncmon fence-r8-node-01 on Fri Jun 11 11:30:39 2021 on node r8-node-01: Simulated failure

- After clicking on Cleanup button, confirmation diallog shows up:
Cleanup fence device?
This makes the cluster forget failed operations from history of the fence device and re-detects its current state.

- After clicking on "Cleanup button" failure is cleaned.

[root@r8-node-01 ~]# pcs resource failcount show
No failcounts

Comment 10 errata-xmlrpc 2021-11-09 17:34:53 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 (Low: pcs security, 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/RHSA-2021:4142