Hide Forgot
Description of problem: oc observe is not validating the existence of file and leaves the process open. Version-Release number of selected component (if applicable): oc v1.4.0-alpha.0+2016d68-dirty kubernetes v1.4.0+776c994 features: Basic-Auth How reproducible: Intermittent Steps to Reproduce: 1. Create a series of files to use for oc observe: $ cat add_to_inventory.sh # For --, called CMD .sh below #!/bin/sh echo "--CMD: `date --rfc-3339=ns` \$1=$1, \$2=$2, \$3=$3" >> log echo "$1/$2 $3" >> inventory sort -u inventory -o inventory $ cat remove_from_inventory.sh # For --delete #!/bin/sh echo "--delete: `date --rfc-3339=ns` Processing resource after deletion (\$1:$1 \$2:$2 \$3:$3) ..." >> log # Other processing ... grep -vE "^$1/$2 " inventory > newinventory mv -f newinventory inventory 2. Run the oc observe command with a false value for --names, to generate an error: oc observe pods --names ./not-exist.sh --delete ./remove_from_inventory.sh -- ./add_to_inventory.sh Actual results: F1024 14:03:11.545700 21969 observe.go:422] Unable to listen on ":11251": listen tcp :11251: bind: address already in use Expected results: error: unable to list known keys: fork/exec ./not-exist.sh: no such file or directory Additional info:
Upon further inspection, it seems that the client command is still running in the background, this could be the culprit: $ ps aux |grep 'oc observe' cryan 24088 0.0 0.5 369436 60892 pts/4 Sl 14:28 0:00 oc observe svc --delete=./remove_from_inventory.sh -- echo print
Chris, I was not able to reproduce the behavior or leaving a running process and always received the "no such file or directory" message which seems correct. If I started another instance of the command I could see the "unable to listen" message. I notice that your ps command is showing a running command without the --names argument on it which would run correctly and is not what the reproduce steps are showing. Can you confirm that you can still reproduce this?
> If I started another instance of the command I could see the "unable to > listen" message. Hi, Chris, Paul said correctly. `oc observe -h` shows a flag "--listen-addr=':11251': The name of an interface to listen on ...". If there was a precious `oc observe ...` not stopped, new `oc observe ...` will show the error 'Unable to listen on ":11251"', unless it specifies different "--listen-addr'. So the issues you saw works by design :) (Similar to other oc cmd that binds port, like `oc proxy -h` shows '--port=8001')