Bug 2102292
Summary: | stonith_admin --validate seems to be broken | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | Tomas Jelinek <tojeline> |
Component: | pacemaker | Assignee: | Chris Lumens <clumens> |
Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> |
Severity: | medium | Docs Contact: | |
Priority: | urgent | ||
Version: | 9.0 | CC: | cluster-maint, jrehova, kgaillot, mjuricek, msmazova, nwahl, toneata |
Target Milestone: | rc | Keywords: | Regression, Triaged |
Target Release: | 9.1 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
Fixed In Version: | pacemaker-2.1.4-3.el9 | Doc Type: | No Doc Update |
Doc Text: |
There currently is no pcs interface to the affected command, and the average user will never see it
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2022-11-15 09:49:38 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: | 1553712, 1816852, 2112270, 2112271 |
Description
Tomas Jelinek
2022-06-29 15:18:20 UTC
This is working as I expect in pacemaker 2.0: # stonith_admin --output-as=xml --validate --agent fence_apc <pacemaker-result api-version="2.2" request="stonith_admin --output-as=xml --validate --agent fence_apc"> <validate agent="fence_apc" valid="false"> <command code="-201"> <output source="stderr">2022-06-29 17:29:05,499 ERROR: Failed: You have to set login name 2022-06-29 17:29:05,500 ERROR: Failed: You have to enter fence address 2022-06-29 17:29:05,500 ERROR: Failed: You have to enter password, password script or identity file 2022-06-29 17:29:05,500 ERROR: validate-all failed 2022-06-29 17:29:05,500 ERROR: Please use '-h' for usage </output> </command> </validate> <status code="1" message="Error occurred"/> </pacemaker-result> # echo $? 1 # rpm -q pacemaker pacemaker-2.0.4-6.el8.x86_64 At least the first issue here is a regression: Since commit 91a2b2e417 in the Pacemaker 2.0.5 release (RHEL 8.4), the sense of "valid" in the XML output was accidentally flipped. I.e. the XML output has valid="true" if the options are invalid and valid="false" if they are valid :-/ Pacemaker currently doesn't have regression tests for stonith_admin --validate, so that obviously needs to be added. The second issue (regarding the error messages) requires more investigation. The "not connected" issue began with this commit: - Low: libcrmservice: always set rc/status when executing files (https://github.com/ClusterLabs/pacemaker/pull/2512/commits/b441925e2da6b938db0674b98783d1dfb3d2a096) The fix was merged in the upstream main branch as of commit 81e83683 Bumping the DTM one week. The build is actually done but there is an unrelated issue affecting gating with a fix working its way through the system Bumping the DTM another week. The gating fix is done but all the jobs haven't been rerun yet. :-/ If it's not done by early next week I may waive that test. Version of pacemaker: > [root@node_01 ~]# rpm -q pacemaker > pacemaker-2.1.4-5.el9.x86_64 Run a fence agent directly in such a way that validation fails: > [root@node_01 ~]# echo -e "action=validate-all\nport=node1" | fence_apc > 2022-08-24 09:02:25,407 ERROR: Failed: You have to set login name > > 2022-08-24 09:02:25,407 ERROR: Failed: You have to enter fence address > > 2022-08-24 09:02:25,408 ERROR: Failed: You have to enter password, password script or identity file > > 2022-08-24 09:02:25,408 ERROR: validate-all failed > > 2022-08-24 09:02:25,408 ERROR: Please use '-h' for usage > [root@node_01 ~]# echo $? > 1 Run a fence agent via stonith_admin in such a way that validation fails: > [root@node_01 ~]# stonith_admin --output-as=xml --validate --agent fence_apc > <pacemaker-result api-version="2.22" request="stonith_admin --output-as=xml --validate --agent fence_apc"> > <validate agent="fence_apc" valid="false"> > <command code="-201"> > <output source="stderr">2022-08-24 09:03:44,867 ERROR: Failed: You have to set login name > > 2022-08-24 09:03:44,867 ERROR: Failed: You have to enter fence address > > 2022-08-24 09:03:44,867 ERROR: Failed: You have to enter password, password script or identity file > > 2022-08-24 09:03:44,868 ERROR: validate-all failed > > 2022-08-24 09:03:44,868 ERROR: Please use '-h' for usage > > </output> > </command> > </validate> > <status code="1" message="Error occurred"/> > </pacemaker-result> > [root@node_01 ~]# echo $? > 1 Run a fence agent directly in such a way that validation passes: > [root@node_01 ~]# echo -e "action=validate-all\nport=node1\nusername=abc\npasswd=abc\nip=192.168.122.254" | fence_apc > [root@node_01 ~]# echo $? > 0 Run a fence agent via stonith_admin in such a way that validation passes: > [root@node_01 ~]# stonith_admin --output-as=xml --validate --agent fence_apc --option username=abc --option passwd=abc --option ip=192.168.122.254 > <pacemaker-result api-version="2.22" request="stonith_admin --output-as=xml --validate --agent fence_apc --option username=abc --option passwd=abc --option ip=192.168.122.254"> > <validate agent="fence_apc" valid="true"> > <command code="0"/> > </validate> > <status code="0" message="OK"/> > </pacemaker-result> > [root@node_01 ~]# echo $? > 0 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 (pacemaker 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:7937 |