Bug 1441447

Summary: Error Moving Cluster Resources
Product: Red Hat Enterprise Linux 7 Reporter: vlad.socaciu
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: CLOSED DUPLICATE QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: abeekhof, cfeist, cluster-maint, idevat, omular, rsteiger, tojeline
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-26 10:59:15 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 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 ***