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 1741586 - pcsd is unable to handle non-ASCII characters in corosync.conf
Summary: pcsd is unable to handle non-ASCII characters in corosync.conf
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pcs
Version: 8.1
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: 8.0
Assignee: Tomas Jelinek
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-15 13:41 UTC by Nina Hostakova
Modified: 2020-04-28 15:28 UTC (History)
6 users (show)

Fixed In Version: pcs-0.10.4-1.el8
Doc Type: Bug Fix
Doc Text:
Cause: The corosync.conf file contains utf-8 characters. Consequence: Various pcs and pcsd commands and functionalities do not work. Fix: When reading the corosync.conf file, set its encoding to utf-8. Result: Pcs and pcsd works.
Clone Of:
Environment:
Last Closed: 2020-04-28 15:27:56 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)
proposed fix (3.03 KB, patch)
2019-11-19 16:38 UTC, Tomas Jelinek
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2020:1568 0 None None None 2020-04-28 15:28:35 UTC

Description Nina Hostakova 2019-08-15 13:41:47 UTC
Description of problem:
When changing quorum device parameters and using non-ASCII characters in values, the values are passed into corosync.conf, however pcsd is unable to process them.

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

How reproducible:
always

Steps to Reproduce:
1. 
> Try to update qdevice using non-ASCII characters in a parameter's value, e.g. host
[root@virt-005 ~]# pcs quorum device update model host=virtč-004 algorithm=lms
Sending updated corosync.conf to nodes...
virt-005: Succeeded
virt-011: Succeeded
Warning: Error connecting to virt-005 (HTTP error: 500)
Warning: Error connecting to virt-011 (HTTP error: 500)
Error: Unable to perform operation on any available node/host, therefore it is not possible to continue
Error: Errors have occurred, therefore pcs is unable to continue

[root@virt-005 ~]# cat /etc/corosync/corosync.conf
...
quorum {
    provider: corosync_votequorum

    device {
        model: net

        net {
            algorithm: lms
            host: virtč-004
        }
    }
}
...

> This is also applicable to parameters with a predefined set of values to choose from, since the '--force' option can overwrite them
[root@virt-005 ~]# pcs quorum device update model host=virt-004 algorithm=lmsč --force
Warning: 'lmsč' is not a valid algorithm value, use 'ffsplit', 'lms'
Sending updated corosync.conf to nodes...
virt-005: Succeeded
virt-011: Succeeded
Warning: Error connecting to virt-005 (HTTP error: 500)
Warning: Error connecting to virt-011 (HTTP error: 500)
Error: Unable to perform operation on any available node/host, therefore it is not possible to continue
Error: Errors have occurred, therefore pcs is unable to continue

2. 
When trying to update the quorum device with an adjusted value (containing valid characters only), nodes are not able to be authenticated and pcsd does not communicate
[root@virt-005 ~]# pcs quorum device update model host=virt-004 algorithm=lms
Error: Hosts 'virt-005', 'virt-011' are not known to pcs, try to authenticate the hosts using 'pcs host auth virt-005 virt-011' command, use --skip-offline to override
Error: None of hosts is known to pcs.

[root@virt-005 ~]# pcs host auth virt-005 virt-011
Username: hacluster
Password: 
Error: Unable to communicate with pcsd

[root@virt-005 ~]# pcs quorum device update model host=virt-004 algorithm=lms --debug
...
--Debug Stderr Start--
/usr/lib/pcsd/corosyncconf.rb:115:in `split': invalid byte sequence in US-ASCII (ArgumentError)
	from /usr/lib/pcsd/corosyncconf.rb:115:in `parse_string'
	from /usr/lib/pcsd/pcs.rb:663:in `get_cluster_name'
	from /usr/lib/pcsd/pcsd-cli.rb:64:in `<main>'

--Debug Stderr End--
...


Actual results:
pcsd fails to proceed with corosync.conf containing non-ASCII characters. 
The characters then need to be manually removed from corosync.conf on all nodes

Expected results:
pcs should print out an error about non-valid characters or somehow handle them

Additional info:

Comment 2 Tomas Jelinek 2019-11-19 16:38:53 UTC
Created attachment 1637778 [details]
proposed fix

It turned out the presence of utf-8 characters in corosync.conf causes more issues than just an inability to edit corosync.conf via pcs as shown in comment 0. Some examples of what does not work:
* pcs host auth
* pcs cluster stop|start --all|<node>
* adding and removing cluster nodes
* config files syncing - exceptions are logged in pcsd log: WARNING -- : Config files sync exception: invalid byte sequence in US-ASCII

Comment 6 Miroslav Lisik 2019-11-29 08:54:32 UTC
Test:

[root@r81-node-01 pcs]# sed -i "s/ring0_addr: r81-node-02/ring0_addr: ř81-node-02/" /etc/corosync/corosync.conf
[root@r81-node-01 pcs]# grep ring0_addr /etc/corosync/corosync.conf
        ring0_addr: r81-node-01
        ring0_addr: ř81-node-02
[root@r81-node-01 pcs]# pcs host auth localhost
Username: hacluster
Password: 
localhost: Authorized
[root@r81-node-01 pcs]# echo $?
0
[root@r81-node-01 pcs]# pcs status pcsd localhost
  localhost: Online

Comment 10 errata-xmlrpc 2020-04-28 15:27:56 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, 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/RHEA-2020:1568


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