Bug 1791670

Summary: booth: pcs should check that '/etc/booth' exists
Product: Red Hat Enterprise Linux 8 Reporter: Tomas Jelinek <tojeline>
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: low Docs Contact:
Priority: low    
Version: 8.3CC: cluster-maint, idevat, mlisik, mmazoure, mpospisi, nhostako, omular, svalasti, tojeline
Target Milestone: rcKeywords: Reopened, Triaged
Target Release: 8.7   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.10.14-2.el8 Doc Type: Bug Fix
Doc Text:
Cause: User tries to setup booth when booth is not installed. Consequence: Pcs complains about missing booth config file. That is misleading, as the command is supposed to create the booth config file. Fix: Print an error message saying booth config directory is missing and asking the user to make sure booth is installed. Result: The error message clearly says what's wrong and provides recommended course of action.
Story Points: ---
Clone Of:
: 2026725 (view as bug list) Environment:
Last Closed: 2022-11-08 09:12: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: 2026725    
Bug Blocks:    

Description Tomas Jelinek 2020-01-16 11:02:28 UTC
Description of problem:
If /etc/booth does not exist, the user get a slightly misleading error message:

# pcs booth setup sites 127.0.0.1 127.0.0.2 127.0.0.3
Error: Unable to write Booth key '/etc/booth/booth.key': No such file or directory: '/etc/booth/booth.key'
Error: Errors have occurred, therefore pcs is unable to continue

It would be better to get something like this:
Configuration directory for booth, /etc/booth, is missing. Is booth installed?


Version-Release number of selected component (if applicable):
pcs-0.10.4-3.el8


How reproducible:
always, easily


Steps to Reproduce:
1. make sure /etc/booth does not exist
2. run 'pcs booth setup' or 'pcs booth pull'


Actual results:
Error: Unable to write Booth key '/etc/booth/booth.key': No such file or directory: '/etc/booth/booth.key'


Expected results:
Error: Configuration directory for booth, /etc/booth, is missing. Is booth installed?


Additional info:
reported upstream https://github.com/ClusterLabs/pcs/issues/225

Comment 1 Tomas Jelinek 2020-01-16 11:04:03 UTC
The error message comes form a system call for opening a file. To get this resolved, pcs would have to check for existence of /etc/booth specifically before it tries to write files in there.

Comment 4 RHEL Program Management 2021-07-16 07:30:42 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 7 Tomas Jelinek 2021-11-26 11:48:14 UTC
This has been fixed upstream by community.

Upstream patch: https://github.com/ClusterLabs/pcs/commit/5e8e1b8aa4a2b98218a3dc09f619b5b089b590d1

[root@rh85-node1:~]# ls /etc/booth
ls: cannot access '/etc/booth': No such file or directory
[root@rh85-node1:~]# pcs booth setup sites 127.0.0.1 127.0.0.2 127.0.0.3
Error: Configuration directory for booth '/etc/booth' is missing. Is booth installed?
Error: Errors have occurred, therefore pcs is unable to continue
[root@rh85-node1:~]# pcs booth pull rh85-node2
Fetching booth config from node 'rh85-node2'...
Error: Configuration directory for booth '/etc/booth' is missing. Is booth installed?
Error: Errors have occurred, therefore pcs is unable to continue

Comment 10 Miroslav Lisik 2022-05-26 08:31:24 UTC
DevTestResults:

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


### booth setup sites
[root@r8-node-01 ~]# rpm -q booth
package booth is not installed
[root@r8-node-01 ~]# test -d /etc/booth; echo $?
1

[root@r8-node-01 ~]# pcs booth setup sites 127.0.0.1 127.0.0.2 127.0.0.3
Error: Configuration directory for booth '/etc/booth' is missing. Is booth installed?
Error: Errors have occurred, therefore pcs is unable to continue

### booth pull

First, create booth config using command 'pcs booth setup sites' on the second node.

[root@r8-node-02 ~]# rpm -qa booth*
booth-site-1.0-199.1.ac1d34c.git.el8.noarch
booth-1.0-199.1.ac1d34c.git.el8.x86_64
booth-core-1.0-199.1.ac1d34c.git.el8.x86_64
[root@r8-node-02 ~]# ls -l /etc/booth
total 0
[root@r8-node-02 ~]# pcs booth setup sites 127.0.0.1 127.0.0.2 127.0.0.3
[root@r8-node-02 ~]# echo $?
0
[root@r8-node-02 ~]# ls -l /etc/booth
total 8
-rw-r--r--. 1 root      root     83 May 24 18:05 booth.conf
-rw-------. 1 hacluster haclient 64 May 24 18:05 booth.key
[root@r8-node-02 ~]# pcs booth config
authfile = /etc/booth/booth.key
site = 127.0.0.1
site = 127.0.0.2
site = 127.0.0.3

Try to pull booth config from the second node on the first node where /etc/booth directory is missing

[root@r8-node-01 ~]# pcs booth pull r8-node-02
Fetching booth config from node 'r8-node-02'...
Error: Configuration directory for booth '/etc/booth' is missing. Is booth installed?
Error: Errors have occurred, therefore pcs is unable to continue

Comment 21 Tomas Jelinek 2022-07-19 11:14:01 UTC
Additional patch to fix the error message in 'pcs booth sync': https://github.com/ClusterLabs/pcs/commit/2745088dd993b2d213ef309fbbe98c6e777cee84

Comment 23 Miroslav Lisik 2022-07-29 09:10:31 UTC
[root@r8-node-01 ~]# rpm -qa pcs booth*
booth-core-1.0-199.1.ac1d34c.git.el8.x86_64
pcs-0.10.14-2.el8.x86_64
booth-site-1.0-199.1.ac1d34c.git.el8.noarch
booth-1.0-199.1.ac1d34c.git.el8.x86_64

[root@r8-node-01 ~]# test -d /etc/booth;  echo $?
0
[root@r8-node-01 ~]# pcs booth setup sites 127.0.0.{1..3}
[root@r8-node-01 ~]# pcs booth config
authfile = /etc/booth/booth.key
site = 127.0.0.1
site = 127.0.0.2
site = 127.0.0.3


[root@r8-node-02 ~]# test -d /etc/booth; echo $?
1

[root@r8-node-01 ~]# pcs booth sync
Sending booth configuration to cluster nodes...
r8-node-01: Booth config saved
Error: r8-node-02: Unable to save booth configuration: Configuration directory for booth '/etc/booth' is missing. Is booth installed?, use --skip-offline to override
Error: Errors have occurred, therefore pcs is unable to continue

Comment 27 errata-xmlrpc 2022-11-08 09:12: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 (Moderate: 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-2022:7447