Bug 2036633

Summary: Error: Agent 'ocf:linbit:drbd' is not installed or does not provide valid metadata: Element content failed to validate content, line 117, use --force to override
Product: Red Hat Enterprise Linux 8 Reporter: Marco Fortina <marco_fortina>
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.6CC: bstinson, cluster-maint, idevat, jwboyer, kmalyjur, mlisik, mmazoure, mpospisi, nhostako, nwahl, omular, sbradley, tojeline
Target Milestone: rcKeywords: EasyFix, Triaged
Target Release: 8.6   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: pcs-0.10.12-3.el8 Doc Type: No Doc Update
Doc Text:
The affected packages were not released
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 14:50:48 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:

Description Marco Fortina 2022-01-03 13:13:26 UTC
Description of problem:

Configuring DRBD on Pacemaker cluster I got this error:

[root@node1 setup]# pcs resource create drbd ocf:linbit:drbd drbd_resource=resource0 promotable promoted-max=1 promoted-node-max=1 clone-max=3 clone-node-max=1 notify=true 
Error: Agent 'ocf:linbit:drbd' is not installed or does not provide valid metadata: Element content failed to validate content, line 117, use --force to override
Error: Errors have occurred, therefore pcs is unable to continue


Version-Release number of selected component (if applicable):

[root@node1 ~]# cat /etc/os-release 
NAME="CentOS Stream"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Stream 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"


[root@node1 ~]# rpm -q pcs
pcs-0.10.12-1.el8.x86_64       


[root@node1 ~]# rpm -q drbd
drbd90-utils-9.19.1-1.el8.elrepo.x86_64



How reproducible:

[root@node1 ~]# pcs resource create drbd ocf:linbit:drbd drbd_resource=resource0 promotable promoted-max=1 promoted-node-max=1 clone-max=3 clone-node-max=1 notify=true 



Steps to Reproduce:
1. Install new CentOS Stream 8 server
2. Install and configure drbd
3. Install pacemaker
4. Try to configure drbd resource


Actual results:

Error: Agent 'ocf:linbit:drbd' is not installed or does not provide valid metadata: Element content failed to validate content, line 117, use --force to override
Error: Errors have occurred, therefore pcs is unable to continue


Expected results:

Cluster resource created.


Additional info:

Downgrading to pcs-0.10.11-1.el8 the issue is not present.

Comment 1 Tomas Jelinek 2022-01-04 09:16:35 UTC
pcs-0.10.12 adds support for OCF 1.1 resource agents. In order to be able to distinguish OCF 1.0 and OCF 1.1 agents and process them correctly, pcs validates agents' metadata against OCF schema. This prevents pcs from crashing due to accessing missing parts of metadata which are mandatory by the standard yet missing in the actual agent not complying to the standard.

The drbd agent specifies <content type="numeric"/> for parameter 'wfc_timeout'. This is not in compliance with OCF 1.0 standard and therefore pcs is right to produce an error. However, this violation is insignificant to pcs, therefore I'm going to relax the validation to make pcs compatible with the existing drbd agent.

Comment 4 Tomas Jelinek 2022-01-04 13:30:40 UTC
Upstream patch:
https://github.com/ClusterLabs/pcs/commit/f34db4f12e100b177e8b56206325e3ae1c28b455


For tests, see comment 0.

Comment 5 Marco Fortina 2022-01-04 13:58:57 UTC
Thanks a lot!

Do you any idea on when a new package version of pcs including this fix will be available?

Best regards,
Marco

Comment 6 Tomas Jelinek 2022-01-04 15:45:57 UTC
(In reply to Marco Fortina from comment #5)
> Do you any idea on when a new package version of pcs including this fix will be available?


Probably in a few weeks. In the meantime, you can either downgrade to pcs-0.10.11, or use --force, or modify ocf-1.0.rng file in your pcs installation, or fix the drbd agent.

Comment 7 Miroslav Lisik 2022-01-14 14:42:15 UTC
DevTestResults:

[root@r8-node-01 pcs]# rpm -q pcs
pcs-0.10.12-3.el8.x86_64

[root@r8-node-01 pcs]# dnf -y install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm
...
[root@r8-node-01 pcs]# dnf install drbd84-utils
...

[root@r8-node-01 pcs]# pcs resource create drbd ocf:linbit:drbd drbd_resource=resource0
[root@r8-node-01 pcs]# echo $?
0

Comment 12 Michal Mazourek 2022-02-16 16:08:32 UTC
[root@virt-485 ~]# dnf -y install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm
{...}

[root@virt-485 ~]# dnf install drbd84-utils
{...}


BEFORE:
=======

[root@virt-485 ~]# rpm -q pcs
pcs-0.10.12-2.el8.x86_64

[root@virt-485 ~]# pcs resource create drbd ocf:linbit:drbd drbd_resource=resource0
Error: Agent 'ocf:linbit:drbd' is not installed or does not provide valid metadata: Element content failed to validate content, line 117, use --force to override
Error: Errors have occurred, therefore pcs is unable to continue
[root@virt-485 ~]# echo $?
1



AFTER:
======

[root@virt-485 ~]# rpm -q pcs
pcs-0.10.12-6.el8.x86_64


[root@virt-485 ~]# pcs resource create drbd ocf:linbit:drbd drbd_resource=resource0
[root@virt-485 ~]# echo $?
0

[root@virt-485 ~]# pcs resource update drbd ocf:linbit:drbd drbd_resource=resource1
[root@virt-485 ~]# echo $?
0

[root@virt-485 ~]# pcs resource config drbd
 Resource: drbd (class=ocf provider=linbit type=drbd)
  Attributes: drbd_resource=resource1
  Operations: demote interval=0s timeout=90 (drbd-demote-interval-0s)
              monitor interval=20 role=Slave timeout=20 (drbd-monitor-interval-20)
              monitor interval=10 role=Master timeout=20 (drbd-monitor-interval-10)
              notify interval=0s timeout=90 (drbd-notify-interval-0s)
              promote interval=0s timeout=90 (drbd-promote-interval-0s)
              reload interval=0s timeout=30 (drbd-reload-interval-0s)
              start interval=0s timeout=240 (drbd-start-interval-0s)
              stop interval=0s timeout=100 (drbd-stop-interval-0s)

[root@virt-485 ~]# pcs resource delete drbd
Deleting Resource - drbd
[root@virt-485 ~]# echo $?
0


Marking as VERIFIED SanityOnly for pcs-0.10.12-6.el8. Regression test suite will be run as part of bz2012128.

Comment 14 errata-xmlrpc 2022-05-10 14:50:48 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 (pcs 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/RHEA-2022:1978