slack-cli
slack-cli copied to clipboard
Hanging in pipe friendliness code on Bamboo CI machines
Hi,
In our Bamboo environment, we are seeing slack ci hang while trying to read from /dev/stdin. I was able to work around this by piping a space into the slack cli command, but was wondering if there is a better solution.
Here are some logs:
| 16-Nov-2018 00:11:23 | + bash -x bin/slack chat send -x -tx 'testing this thing' -ch '#mcore_tools_basement' |
|---|---|
| 16-Nov-2018 00:11:23 | +++ dirname bin/slack |
| 16-Nov-2018 00:11:23 | ++ cd bin |
| 16-Nov-2018 00:11:23 | ++ pwd |
| 16-Nov-2018 00:11:23 | + bindir=/Users/bambooagent/AgentHome/xml-data/build-dir/MTS-AS0-JOB1/bin |
| 16-Nov-2018 00:11:23 | +++ dirname bin/slack |
| 16-Nov-2018 00:11:23 | ++ cd bin |
| 16-Nov-2018 00:11:23 | ++ pwd |
| 16-Nov-2018 00:11:23 | + etcdir=/Users/bambooagent/AgentHome/xml-data/build-dir/MTS-AS0-JOB1/bin |
| 16-Nov-2018 00:11:23 | + '[' -n ******** ']' |
| 16-Nov-2018 00:11:23 | + token=******** |
| 16-Nov-2018 00:11:23 | + cmd=chat |
| 16-Nov-2018 00:11:23 | + shift |
| 16-Nov-2018 00:11:23 | + case "${cmd}${1}" in |
| 16-Nov-2018 00:11:23 | + sub=send |
| 16-Nov-2018 00:11:23 | + shift |
| 16-Nov-2018 00:11:23 | + case "${cmd}${sub}" in |
| 16-Nov-2018 00:11:23 | + '[' -p /dev/stdin ']' |
| 16-Nov-2018 00:11:23 | ++ cat |
| 16-Nov-2018 00:31:55 | Force Stop build feature is enabled for current plan. Either Bamboo has detected the build has hung or it has been manually stopped. |
I ran into this issue six years later.
Thanks for tracking the cause down!