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 2026725 - booth: pcs should check that '/etc/booth' exists
Summary: booth: pcs should check that '/etc/booth' exists
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: pcs
Version: 9.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: 9.1
Assignee: Tomas Jelinek
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1791670
TreeView+ depends on / blocked
 
Reported: 2021-11-25 15:54 UTC by Tomas Jelinek
Modified: 2022-11-15 10:02 UTC (History)
10 users (show)

Fixed In Version: pcs-0.11.3-3.el9
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.
Clone Of: 1791670
Environment:
Last Closed: 2022-11-15 09:48:38 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CLUSTERQE-5759 0 None None None 2022-05-23 16:03:00 UTC
Red Hat Issue Tracker RHELPLAN-103974 0 None None None 2021-11-25 15:58:12 UTC
Red Hat Product Errata RHSA-2022:7935 0 None None None 2022-11-15 09:48:58 UTC

Description Tomas Jelinek 2021-11-25 15:54:53 UTC
+++ This bug was initially created as a clone of Bug #1791670 +++

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

--- Additional comment from Tomas Jelinek on 2020-01-16 12:04:03 CET ---

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 1 Tomas Jelinek 2021-11-26 09:17:29 UTC
This has been fixed upstream by community.

Upstream patch: https://github.com/ClusterLabs/pcs/commit/bc4e287d3a48a3215cc86e7e0cc8a09442b22ef9

Test:
[root@rh90-node1:~]# ls /etc/booth
ls: cannot access '/etc/booth': No such file or directory
[root@rh90-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@rh90-node1:~]# pcs booth pull rh90-node2
Fetching booth config from node 'rh90-node2'...
Error: Configuration directory for booth '/etc/booth' is missing. Is booth installed?
Error: Errors have occurred, therefore pcs is unable to continue

Comment 3 Miroslav Lisik 2022-05-19 17:18:51 UTC
DevTestResults:

[root@r91-1 ~]# rpm -q pcs
pcs-0.11.2-1.el9.x86_64

### booth setup sites

[root@r91-1 ~]# rpm -q booth
package booth is not installed
[root@r91-1 ~]# test -d /etc/booth; echo $?
1

[root@r91-1 ~]# 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@r91-2 ~]# rpm -qa | grep booth
booth-core-1.0-251.2.bfb2f92.git.el9.x86_64
booth-site-1.0-251.2.bfb2f92.git.el9.noarch
booth-1.0-251.2.bfb2f92.git.el9.x86_64
[root@r91-2 ~]# ls -l /etc/booth
total 0

root@r91-2 ~]# pcs booth setup sites 127.0.0.1 127.0.0.2 127.0.0.3
[root@r91-2 ~]# echo $?
0
[root@r91-2 ~]# ls -l /etc/booth
total 8
-rw-r--r--. 1 root      root     83 May 17 17:28 booth.conf
-rw-------. 1 hacluster haclient 64 May 17 17:28 booth.key
[root@r91-2 ~]# 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@r91-1 ~]# pcs booth pull r91-2
Fetching booth config from node 'r91-2'...
Error: Configuration directory for booth '/etc/booth' is missing. Is booth installed?
Error: Errors have occurred, therefore pcs is unable to continue

Comment 10 Tomas Jelinek 2022-07-19 11:14:44 UTC
Additional patch to fix the error message in 'pcs booth sync': https://github.com/ClusterLabs/pcs/commit/0848ff3798269c6e361982ec349d308af5acc64e

Comment 12 Miroslav Lisik 2022-07-29 09:01:46 UTC
DevTestResults:

[root@r91-1 ~]# rpm -qa pcs booth*
booth-core-1.0-251.2.bfb2f92.git.el9.x86_64
booth-arbitrator-1.0-251.2.bfb2f92.git.el9.noarch
booth-site-1.0-251.2.bfb2f92.git.el9.noarch
booth-1.0-251.2.bfb2f92.git.el9.x86_64
pcs-0.11.3-3.el9.x86_64

[root@r91-1 ~]# test -d /etc/booth;  echo $?
0

[root@r91-1 ~]# pcs booth setup sites 127.0.0.{1..3}
[root@r91-1 ~]# pcs booth config
authfile = /etc/booth/booth.key
site = 127.0.0.1
site = 127.0.0.2
site = 127.0.0.3


[root@r91-2 ~]# test -d /etc/booth;  echo $?
1

[root@r91-1 ~]# pcs booth sync
Sending booth configuration to cluster nodes...
r91-1: Booth config saved
Error: r91-2: 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 17 errata-xmlrpc 2022-11-15 09:48:38 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:7935


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