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 1265527 - sap_redhat_cluster_connector does not work correctly with hostnames of SAP instances containing "-"
Summary: sap_redhat_cluster_connector does not work correctly with hostnames of SAP in...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: resource-agents
Version: 7.1
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Oyvind Albrigtsen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1018952 1289025 1364088
TreeView+ depends on / blocked
 
Reported: 2015-09-23 07:14 UTC by Matthieu
Modified: 2019-11-14 06:59 UTC (History)
12 users (show)

Fixed In Version: resource-agents-3.9.5-67.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1269897 (view as bug list)
Environment:
Last Closed: 2016-11-03 23:58:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch bug #1265527 (2.45 KB, patch)
2015-09-24 13:24 UTC, Matthieu
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2174 0 normal SHIPPED_LIVE resource-agents bug fix and enhancement update 2016-11-03 13:16:36 UTC

Description Matthieu 2015-09-23 07:14:14 UTC
Description of problem:


Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux Server release 7.1 (Maipo)
pacemaker-1.1.12-22.el7_1.2.x86_64
resource-agents-sap-3.9.5-40.el7_1.6.x86_64

How reproducible:
The virtual name of the SAP instance must contain a "-"

Steps to Reproduce:
Install RHEL 7 with pacemaker cluster and resource-agents-sap to manage SAP

Profile name for SAP are :
  - PE1_ASCS00_pe1-ascs  
  - PE1_D02_pe1-d02  
  - PE1_DVEBMGS01_pe1-d01  
  - PE1_ERS11_pe1-aers

Actual results:
/usr/sbin/sap_redhat_cluster_connector lsr --out /root/mfa.txt --sid PE1 --ino 11
Aug 24 17:32:42 frbsluxc07 sap_redhat_cluster_connector[9129]: lsr call (out=/tmp/sapha-tmp-mlAz6p,sid=PE1,ino=11)
Aug 24 17:32:42 frbsluxc07 sap_redhat_cluster_connector[9129]: lsr result: empty
Aug 24 17:32:42 frbsluxc07 sap_redhat_cluster_connector[9129]: TEST END

Expected results:
/usr/sbin/sap_redhat_cluster_connector lsr --out /root/mfa.txt --sid PE1 --ino 11
Aug 24 17:46:21 frbsluxc07 sap_redhat_cluster_connector[28388]: lsr call (out=/root/mfa.txt,sid=PE1,ino=11)
Aug 24 17:46:21 frbsluxc07 sap_redhat_cluster_connector[28388]: lsr result: PE1:11:p_SAP_ascs00:ms_PE1_ASCS_AERS:-
Aug 24 17:46:21 frbsluxc07 sap_redhat_cluster_connector[28388]: TEST END


Additional info:

I apply this patch, and now it works for me :

--- /usr/sbin/sap_redhat_cluster_connector.orig	2015-08-24 17:26:10.000000000 +0200
+++ /usr/sbin/sap_redhat_cluster_connector	2015-08-24 17:26:28.000000000 +0200
@@ -242,7 +242,7 @@ sub list_sap_resources {

 	$ENV{'PATH'} = $ENV{'PATH'} . ":/usr/sbin:/sbin";
 	#printf "LSR\n";
-	printf "PARAMS: (out, sid, ino) = ( %s, %s, %s)\n", $out, $sid, $ino ;
+	#printf "PARAMS: (out, sid, ino) = ( %s, %s, %s)\n", $out, $sid, $ino ;
 	#printf "ARGV: %s", join(" ", @ARGV);

 	my ($fclass, $fprovider, $fra, $fname, $fgname) = ("","","","","");
@@ -251,13 +251,13 @@ sub list_sap_resources {
 	open CRMOUT, "$cmd_cibadmin --local -Q --xpath '//primitive[\@type=\"$sra\"]' --node-path 2>/dev/null |" || die "could not open cibadmin output";
 	while (<CRMOUT>) {
 		my $line = $_;
-		if ($line =~ /primitive..id='([a-zA-Z0-9_]+)'/) {
+		if ($line =~ /primitive..id='([a-zA-Z0-9_-]+)'/) {
 			($fname) = ($1);
 		} else {
 			next;
 		}

-		if ( $line =~ /[group|master|clone]..id='([a-zA-Z0-9_]+)'/) {
+		if ( $line =~ /[group|master|clone]..id='([a-zA-Z0-9_-]+)'/) {
 			($fgname) = ($1);
 		}

@@ -265,7 +265,7 @@ sub list_sap_resources {
 			open RESOURCE1_OUT, "$cmd_cibadmin -Q --xpath \"//primitive[\@id='$fname']//nvpair[\@name='$sparam']\"  2>/dev/null |" || die "could not open cibadmin output";
 			while (<RESOURCE1_OUT>) {
 				my $result = $_;
-				if ($result =~ /value="([a-zA-Z0-9_]+)"/) {
+				if ($result =~ /value="([a-zA-Z0-9_-]+)"/) {
 					my $finstance=$1;
 					if ( $1 =~ /^${sid}_[a-zA-Z0-9]+${ino}_[a-zA-Z0-9_-]+$/ ) {
 						$foundRes=1;
@@ -279,7 +279,7 @@ sub list_sap_resources {
 			open RESOURCE2_OUT, "$cmd_cibadmin -Q --xpath \"//primitive[\@id='$fname']//nvpair[\@name='$sparam2']\"  2>/dev/null |" || die "could not open cibadmin output";
 			while (<RESOURCE2_OUT>) {
 				my $result = $_;
-				if ($result =~ /value="([a-zA-Z0-9_]+)"/) {
+				if ($result =~ /value="([a-zA-Z0-9_-]+)"/) {
 					my $finstance=$1;
 					if ( $1 =~ /^${sid}_[a-zA-Z0-9]+${ino}_[a-zA-Z0-9_-]+$/ ) {
 						$foundRes=1;
@@ -306,6 +306,7 @@ sub list_sap_resources {
 		}
 	}

+	printf $foundRes;
 	if ($foundRes==1) {
 		if ($out eq "") {
 			printf "%s:%s:%s\n", $fname, $fgname, "-";
@@ -488,7 +489,6 @@ if  ($cmd eq "init")  {
 	                   "ino=s" => \$ino,
 	                   "out=s" => \$out,
 		 ) &&
-
 	checkavail(($sid, $ino, $out)) || paramproblem();
 	syslog("LOG_INFO", "lsr call (out=%s,sid=%s,ino=%s)", $out, $sid, $ino);
 	$return_code=list_sap_resources($out, $sid, $ino);

Comment 2 Frank Danapfel 2015-09-23 13:07:25 UTC
Updated bug title to make it match hte description of the issue.

qMatthieu: thank you fro reporting this issue and providing a patch. We'll have a look at it and try to fix it in one of the next releases.

Could you please add the patch as an attachment to this bugzilla?

Comment 3 Matthieu 2015-09-24 13:24:00 UTC
Created attachment 1076548 [details]
Patch bug #1265527

Comment 4 Frank Danapfel 2015-10-01 13:24:32 UTC
I've tested the patch and did not find any issues with it. I'll now start working on getting it integrated upstream so that it can be added in RHEL as well.

@Matthieu: is there a specific reason why you added the "printf $foundRes;", or was that just for debugging purposes?

Comment 5 Matthieu 2015-10-02 07:28:56 UTC
(In reply to Frank Danapfel from comment #4)
> @Matthieu: is there a specific reason why you added the "printf $foundRes;",
> or was that just for debugging purposes?

Yes, just to help me to debug.

Comment 6 Frank Danapfel 2015-11-18 13:03:54 UTC
Patch has been tested and integrated upstream:
https://github.com/ClusterLabs/sap_cluster_connector/commit/8847d398f72ad1211de1cd50ffbbcc658977d274

Comment 10 errata-xmlrpc 2016-11-03 23:58:41 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://rhn.redhat.com/errata/RHBA-2016-2174.html


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