Bug 1119190

Summary: [geard] The error message cannot show the gear count as numeric character when trying to remove app with gear exists via broker
Product: OKD Reporter: Meng Bo <bmeng>
Component: ContainersAssignee: Rajat Chopra <rchopra>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: medium    
Version: 2.xCC: mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-10 00:46:01 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 Meng Bo 2014-07-14 08:52:23 UTC
Description of problem:
When trying to delete the app with gears via broker will get the log with following contents.

Server got: delete-app 
test1 
Cannot delete application because it still has %!s(int=1) gears in it. 


Version-Release number of selected component (if applicable):
https://github.com/rajatchopra/geard-router-haproxy/tree/rc

How reproducible:
always

Steps to Reproduce:
1. Setup fedora 20 with docker/gear/go installed and setenforce to 0
2. Set the GOPATH to /root/go
3. Get the geard-router-haproxy code via go
# go get github.com/rajatchopra/geard-router-haproxy
4. Switch to the testing branch in it and build the docker image
# cd $GOPATH/src/github.com/rajatchopra/geard-router-haproxy 
# git checkout rc
# docker build .
5. Run the new built image as a container
# docker tag <image_id> router
# docker run -i -t -v /var/lib/containers:/var/lib/containers -v /var/lib/haproxy/run:/var/lib/haproxy/run -p 80:80 --name geard-router router /usr/bin/geard-router-haproxy-sighandler
6. Copy the binary file to /usr/bin
# cp -f ./geard-router-haproxy-addcontainer /usr/bin/geard-router-addcontainer
# cp -f ./geard-router-haproxy-removecontainer /usr/bin/geard-router-removecontainer
7. Build the sample broker and run it
# go build -o sample-broker cmd/sample_broker.go ; ./sample-broker
8. Make the geard running as deamon
# gear daemon &
9. Create app via broker
# echo "create-app test1 pmorie/sti-html-app test1.example.com" | socat /var/lib/containers/router/broker.sock stdio
10. Add gear to the app manually
# echo "scale-up test1" | socat /var/lib/containers/router/broker.sock stdio
11. Delete the app via broker
# echo "delete-app test1" | socat /var/lib/containers/router/broker.sock stdio
12. Check the broker log output after step11

Actual results:
The error message cannot show the numeric character correctly.

Cannot delete application because it still has %!s(int=1) gears in it. 

Expected results:
Should show the exact gear number in the log.

Additional info:
The log message in the code:
https://github.com/rajatchopra/geard-router-haproxy/blob/59e16428c9020d63e044caf861d5a5f19b2befd2/cmd/sample_broker.go#L76

Comment 1 Rajat Chopra 2014-07-14 23:16:30 UTC
Fixed. %s to %d.

Comment 2 Meng Bo 2014-07-15 02:33:29 UTC
Issue fixed with latest code.

Server got: delete-app test1

Cannot delete application because it still has 1 gears in it.

Mark as verified.