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 1441447 - Error Moving Cluster Resources
Summary: Error Moving Cluster Resources
Keywords:
Status: CLOSED DUPLICATE of bug 1422667
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcs
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Tomas Jelinek
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-12 00:26 UTC by vlad.socaciu
Modified: 2017-04-26 10:59 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-04-26 10:59:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description vlad.socaciu 2017-04-12 00:26:39 UTC
Description of problem:

We have a script which either starts our own LSB resources or moves them to the peer node, in a two-node cluster. The move action produces errors, as shown below. The cluster has two nodes: sys70ccg1-app and sys70ccg2-app. There were 16 LSB resources defined and running, most of them on sys70ccg2-app. We tried to move them to sys70ccg1-app using the script. The command we executed was 

    ./activate_cluster_resources_rh7.sh move first_index 1 last_index 16 node sys70ccg1-app

where "activate_cluster_resources_rh7.sh" is the name of our script, enclosed below in its entirety.

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

Additional info:

This is our script, "activate_cluster_resources_rh7.sh":

#!/bin/sh
# Start or move cluster resources
#
# Invocation:
# 
#	activate_cluster_resources_rh7.sh start|move first_index <first_index> [last_index <last_index>] node <node_name>
#
################################################################################
export PATH=$PATH:.
. /opt/unisys_ccg_gid/cluster_scripts/common_defs

FIRST_INDEX=1
LAST_INDEX=-1
NODE=""
################################################################################
# Stickiness means that the resource should run wherever it happens to be, if
# the stickiness score is higher than the location constraint score
# pcs constraint location <resource name> prefers <node name>=300
# pcs resource update <resource name> meta resource-stickiness=500
#
# Command line commans:
# pcs constraint show 
# pcs resource show <resource name>
################################################################################
set_up_constraints()
{
	local index=$1
	local node=$2
	local action=$3
	# Save current config to a temp file.
	pcs cluster cib /tmp/pcs-config-$$ 
	# Get the constraints from file.
	echo "`pcs -f /tmp/pcs-config-$$ constraint ref ${RESOURCE_BASE_NAME}${index}`" | awk '/location-/ { print $1 }' > /tmp/pcs_constraints-$$
	# Remove all location constraints previously created.
	for line in $(cat /tmp/pcs_constraints-$$) 
		do 
			pcs -f /tmp/pcs-config-$$ constraint location remove "$line" 
		done 		
	#
	# Create a location constraint to the node specified by the argument $2, with score 300 (default score is INFINITY)
	# Resources were created with a resource-stickiness=500. If they move acidentally, and then the 
	# initial node comes back up, the resources will stay on the node where they were, because stickiness score
	# is higher than the location constraint score.
	#
	pcs -f /tmp/pcs-config-$$ constraint location ${RESOURCE_BASE_NAME}${index} prefers ${node}=300
	
	if [ "$action" = "move" ]
	then
		# Temporarily reduce stickiness, so we can run on the alternate node.
		pcs -f /tmp/pcs-config-$$ resource update ${RESOURCE_BASE_NAME}${index} meta resource-stickiness=0
		# Makes all changes active at once, and maybe, wait for the resource to come up
		pcs cluster cib-push /tmp/pcs-config-$$ --config --wait=300
		# Restore initial stickiness
		pcs resource update ${RESOURCE_BASE_NAME}${index} meta resource-stickiness=500
	else
		pcs cluster cib-push /tmp/pcs-config-$$ --config 
	fi

	rm -Rf /tmp/pcs_constraints-$$ 
	rm -Rf /tmp/pcs-config-$$
}
################################################################################
remove_constraints()
{
	local index=$1
	# Remove location constraints previously created on any node, so we can run on any node.
	echo "`pcs constraint ref ${RESOURCE_BASE_NAME}${index}`" | awk '/location-/ { print $1 }' > ./tmpxxx${index}
	for line in $(cat ./tmpxxx${index}) 
		do 
			pcs constraint location remove "$line" 
		done 		
	rm -Rf  ./tmpxxx${index}
}
################################################################################
if [ $# -lt 5 ]
then

	echo Insufficient number of arguments...
	exit -1

fi

ACTION="$1"

if [ $ACTION != "start" -a $ACTION != "move" ]
then
	printf "\tIncorrect action \"$ACTION\"...\n"
	exit -1
fi
shift
 
while [[ $# > 0 ]]

	do

		key="$1"

		case $key in


			first_index)

				FIRST_INDEX="$2" ;;

			last_index)

				LAST_INDEX="$2" ;;

			node)
			
				NODE="$2" ;;

			*) 

				;;
		
		esac
		shift
		shift
		
	done

if [ -z "$NODE" ]
then
	echo "Missing running node, exiting..."
	exit -1
fi

#Allow a single index argument first_index <first_index>
if [ $LAST_INDEX -lt 0 ]
then
	LAST_INDEX=$FIRST_INDEX
fi

if [ $LAST_INDEX -lt $FIRST_INDEX ]
then
	
	printf "	Incorrect indices: $FIRST_INDEX, $LAST_INDEX\n"
	exit -1
fi			

if [ $ACTION = "start" ]
then
	if [ $LAST_INDEX -eq $FIRST_INDEX ]
	then
		printf "Starting resource ${RESOURCE_BASE_NAME}${FIRST_INDEX} on node ${NODE}\n"
	else
		printf "Starting resources ${RESOURCE_BASE_NAME}${FIRST_INDEX} through ${RESOURCE_BASE_NAME}${LAST_INDEX} on node ${NODE}\n"
	fi
else
	if [ $LAST_INDEX -eq $FIRST_INDEX ]
	then
		printf "Moving resource ${RESOURCE_BASE_NAME}${FIRST_INDEX} to node ${NODE}\n"
	else
		printf "Moving resources ${RESOURCE_BASE_NAME}${FIRST_INDEX} through ${RESOURCE_BASE_NAME}${LAST_INDEX} to node ${NODE}\n"
	fi
fi

for (( index=$FIRST_INDEX; index<=$LAST_INDEX; index++ ))
	do

		if [ $ACTION = "start" ]
		then
			set_up_constraints $index ${NODE}
			pcs resource enable ${RESOURCE_BASE_NAME}${index}
		else
			set_up_constraints $index ${NODE} "move"
		fi
		# To move the resources it is enough to execute "pcs ... constraint location ... prefers"
		# which is executed in set_up_constraints()
		
		# Cleans up the resource in lrmd (useful to reset the resource
        # status and failcount).  This tells the cluster to forget the
        # operation history of a resource and re-detect its current state.
        # This can be useful to purge knowledge of past failures that have
        # since been resolved. If a resource id is not specified then all
        # resources/stonith devices will be cleaned up.
		pcs resource cleanup ${RESOURCE_BASE_NAME}${index}

	done

And this is the result of executing 

    ./activate_cluster_resources_rh7.sh move first_index 1 last_index 16 node sys70ccg1-app

[root@sys70ccg1 cluster_scripts]# ./activate_cluster_resources_rh7.sh move first_index 1 last_index 16 node sys70ccg1-app
Moving resources resource_ccg_gid1 through resource_ccg_gid16 to node sys70ccg1-app
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Cleaning up resource_ccg_gid1 on sys70ccg1-app, removing fail-count-resource_ccg_gid1
Cleaning up resource_ccg_gid1 on sys70ccg2-app, removing fail-count-resource_ccg_gid1
Waiting for 2 replies from the CRMd.. OK
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Cleaning up resource_ccg_gid2 on sys70ccg1-app, removing fail-count-resource_ccg_gid2
Cleaning up resource_ccg_gid2 on sys70ccg2-app, removing fail-count-resource_ccg_gid2
Waiting for 2 replies from the CRMd.. OK
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Cleaning up resource_ccg_gid3 on sys70ccg1-app, removing fail-count-resource_ccg_gid3
Cleaning up resource_ccg_gid3 on sys70ccg2-app, removing fail-count-resource_ccg_gid3
Waiting for 2 replies from the CRMd.. OK
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Cleaning up resource_ccg_gid4 on sys70ccg1-app, removing fail-count-resource_ccg_gid4
Cleaning up resource_ccg_gid4 on sys70ccg2-app, removing fail-count-resource_ccg_gid4
Waiting for 2 replies from the CRMd.. OK
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Cleaning up resource_ccg_gid5 on sys70ccg1-app, removing fail-count-resource_ccg_gid5
Cleaning up resource_ccg_gid5 on sys70ccg2-app, removing fail-count-resource_ccg_gid5
Waiting for 2 replies from the CRMd.. OK
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Cleaning up resource_ccg_gid6 on sys70ccg1-app, removing fail-count-resource_ccg_gid6
Cleaning up resource_ccg_gid6 on sys70ccg2-app, removing fail-count-resource_ccg_gid6
Waiting for 2 replies from the CRMd.. OK
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Cleaning up resource_ccg_gid7 on sys70ccg1-app, removing fail-count-resource_ccg_gid7
Cleaning up resource_ccg_gid7 on sys70ccg2-app, removing fail-count-resource_ccg_gid7
Waiting for 2 replies from the CRMd.. OK
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Cleaning up resource_ccg_gid8 on sys70ccg1-app, removing fail-count-resource_ccg_gid8
Cleaning up resource_ccg_gid8 on sys70ccg2-app, removing fail-count-resource_ccg_gid8
Waiting for 2 replies from the CRMd.. OK
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Cleaning up resource_ccg_gid9 on sys70ccg1-app, removing fail-count-resource_ccg_gid9
Cleaning up resource_ccg_gid9 on sys70ccg2-app, removing fail-count-resource_ccg_gid9
Waiting for 2 replies from the CRMd.. OK
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Cleaning up resource_ccg_gid10 on sys70ccg1-app, removing fail-count-resource_ccg_gid10
Cleaning up resource_ccg_gid10 on sys70ccg2-app, removing fail-count-resource_ccg_gid10
Waiting for 2 replies from the CRMd.. OK
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Cleaning up resource_ccg_gid11 on sys70ccg1-app, removing fail-count-resource_ccg_gid11
Cleaning up resource_ccg_gid11 on sys70ccg2-app, removing fail-count-resource_ccg_gid11
Waiting for 2 replies from the CRMd.. OK
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Error: Unable to cleanup resource: resource_ccg_gid12
Waiting for 2 replies from the CRMd.No messages received in 60 seconds.. aborting
Cleaning up resource_ccg_gid12 on sys70ccg1-app, removing fail-count-resource_ccg_gid12
Cleaning up resource_ccg_gid12 on sys70ccg2-app, removing fail-count-resource_ccg_gid12
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Cleaning up resource_ccg_gid13 on sys70ccg1-app, removing fail-count-resource_ccg_gid13
Cleaning up resource_ccg_gid13 on sys70ccg2-app, removing fail-count-resource_ccg_gid13
Waiting for 2 replies from the CRMd.. OK
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Cleaning up resource_ccg_gid14 on sys70ccg1-app, removing fail-count-resource_ccg_gid14
Cleaning up resource_ccg_gid14 on sys70ccg2-app, removing fail-count-resource_ccg_gid14
Waiting for 2 replies from the CRMd.. OK
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Cleaning up resource_ccg_gid15 on sys70ccg1-app, removing fail-count-resource_ccg_gid15
Cleaning up resource_ccg_gid15 on sys70ccg2-app, removing fail-count-resource_ccg_gid15
Waiting for 2 replies from the CRMd.. OK
CIB updated
Traceback (most recent call last):
  File "/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.152', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 216, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 125, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1238, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 882, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
Cleaning up resource_ccg_gid16 on sys70ccg1-app, removing fail-count-resource_ccg_gid16
Cleaning up resource_ccg_gid16 on sys70ccg2-app, removing fail-count-resource_ccg_gid16
Waiting for 2 replies from the CRMd.. OK
[root@sys70ccg1 cluster_scripts]#

The same command works in our test lab, using pcs 0.9.143.

Comment 2 Ken Gaillot 2017-04-25 21:10:42 UTC
Reassigning to pcs component. I don't think it's related to the specific script here; it looks like something internal to pcs, possibly in combination with some environmental settings here.

Comment 3 Ivan Devat 2017-04-26 06:27:36 UTC
[vm-rhel72-1 ~] $ rpm -q pcs
pcs-0.9.157-1.el7.x86_64
[vm-rhel72-1 ~] $ pcs cluster cib cib.xml
[vm-rhel72-1 ~] $ pcs cluster cib-push cib.xml --wait=300
CIB updated
Traceback (most recent call last):
  File "/usr/sbin/pcs", line 9, in <module>
    load_entry_point('pcs==0.9.157', 'console_scripts', 'pcs')()
  File "/usr/lib/python2.7/site-packages/pcs/app.py", line 191, in main
    cmd_map[command](argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 157, in cluster_cmd
    cluster_push(argv)
  File "/usr/lib/python2.7/site-packages/pcs/cluster.py", line 1355, in cluster_push
    output, retval = utils.run(cmd)
  File "/usr/lib/python2.7/site-packages/pcs/utils.py", line 1000, in run
    universal_newlines=(not PYTHON2 and not binary_output)
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
TypeError: coercing to Unicode: need string or buffer, int found
  
The problem is with the --wait flag: it is internally converted to an int and then this int is put into subprocess.Popen.

Comment 4 Radek Steiger 2017-04-26 08:06:13 UTC
This is a known bug: bz1422667

Comment 5 Tomas Jelinek 2017-04-26 10:59:15 UTC
Support for --wait in the cib-push command has been added in pcs 0.9.152 and the bug was introduced in the very same patch. Therefore this is not a regression. Before pcs 0.9.152 the --wait flag was completely ignored in the cib-push command.

*** This bug has been marked as a duplicate of bug 1422667 ***


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