Azure / azure-cli

Azure Command-Line Interface
MIT License
3.97k stars 2.95k forks source link

az vm extension set: LRO polling hangs indefinitely #755

Closed ahmetb closed 8 years ago

ahmetb commented 8 years ago

This is a worse manifestation of #596

az vm extension set -n CustomScriptForLinux --publisher Microsoft.OSTCExtensions --auto-upgrade-minor-version -g ahmet-test --vm-name ub16 --settings '{"commandToExecute":"date"}'

This command normally takes 1-2 minutes to complete...

Start this command and wait 3 seconds and start hitting ctrl+c, you won't be able to exit it.

➜  ~ az vm extension set -n CustomScriptForLinux --publisher Microsoft.OSTCExtensions --auto-upgrade-minor-version -g ahmet-test --vm-name ub16 --settings '{"commandToExecute":"date"}'
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C
^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^C^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z
^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z^Z

I had to stop the process using OS X kill command.

I encourage you to try this, mostly because my az is aliased to docker run --rm -i -t [...] az and it might be a signal handling issue in az CLI (docker sends SIGTERM on Ctrl+C) or might be some signal forwarding issue in Docker CLI. So I'm not 100% sure if the problem is isolated to az CLI.

You should be able to repro this easily on Linux/OS X outside container if it's an az CLI issue.

ahmetb commented 8 years ago

@tjprescott I think this was happening because we didn't alias was documented as:

alias az='docker run --rm -v ~/.azure:/root/.azure azuresdk/azure-cli-python az'

it should have -i -t in there too. Can you please update the readme as:

alias az='docker run --rm -i -t -v ~/.azure:/root/.azure azuresdk/azure-cli-python az'

this gives us Ctrl+Cs work better and colors on Dockerized mode.

tjprescott commented 8 years ago

@derekbekoe you're our Docker pro--does this fix make sense to you?

derekbekoe commented 8 years ago

Approved the PR