You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users need to wait until that previous command execution finishes before being able to run another command:
$ ./kubectl-az run-command "ip route" --node aks-agentpool-38928455-vmss000000 -v
Command: ip route shfdsafddow
Virtual Machine Scale Set VM: {
"SubscriptionID": "fa899caf-8f31-4531-a2c5-4e23e4bbcd0d",
"NodeResourceGroup": "mc_mauricio-kubeaz-test_mauricio-kubeaz-test_eastus",
"VMScaleSet": "aks-agentpool-38928455-vmss",
"InstanceID": "0"
}
Running...
^C
$ ./kubectl-az run-command "ip route" --node aks-agentpool-38928455-vmss000000 -v
Command: ip route shfdsafddow
Virtual Machine Scale Set VM: {
"SubscriptionID": "fa899caf-8f31-4531-a2c5-4e23e4bbcd0d",
"NodeResourceGroup": "mc_mauricio-kubeaz-test_mauricio-kubeaz-test_eastus",
"VMScaleSet": "aks-agentpool-38928455-vmss",
"InstanceID": "0"
}
Error: failed to run command: couldn't run command: POST https://management.azure.com/subscriptions/fa899caf-8f31-4531-a2c5-4e23e4bbcd0d/resourceGroups/mc_mauricio-kubeaz-test_mauricio-kubeaz-test_eastus/providers/Microsoft.Compute/virtualMachineScaleSets/aks-agentpool-38928455-vmss/virtualmachines/0/runCommand
--------------------------------------------------------------------------------
RESPONSE 409: 409 Conflict
ERROR CODE: Conflict
--------------------------------------------------------------------------------
{
"error": {
"code": "Conflict",
"message": "Run command extension execution is in progress. Please wait for completion before invoking a run command."
}
}
--------------------------------------------------------------------------------
Ideal future situation
Handle SIGINT and interrupt command execution
Implementation options
According to the documentation, we can't cancel a running script. However, BeginRunCommand receives a context, maybe there is something we can do with it.
The text was updated successfully, but these errors were encountered:
I did initial investigation regarding passing a cancelable context to BeginRunCommand and it seems it doesn't help with cancelling the actual run command and only effects the polling:
Error: failed to run command: error polling command response: context deadline exceeded
I will investigate if there is still an option to avoid conflicts when re-running the command.
I just realize that maybe we won't be able to do too much on this issue after re-reading the documentation:
You can't cancel a running script.
Maybe, what we can do is to handle this kind of signals and improve the UX:
$ kubectl az run-command "ip route" --node aks-agentpool-12345678-vmss000000
Running...
^C
Warn: The requested command hasn't finished yet...Warn: Hit Ctrl+C again to exit, but please notice the command will continue running in the node anyway, and you will be unable to see the output or run another command until it finishes.^CExiting...$
I agree. I think having a warning like this can be useful so users are aware of the consequence of cancellation an unfinished command. Also, I am thinking of wrapping the run-command in timeout and set the default value to 300 seconds . Let me have a look into this.
Current situation
The SIGINT signal is not managed at all.
Impact
Users need to wait until that previous command execution finishes before being able to run another command:
Ideal future situation
Handle SIGINT and interrupt command execution
Implementation options
According to the documentation, we can't cancel a running script. However, BeginRunCommand receives a
context
, maybe there is something we can do with it.The text was updated successfully, but these errors were encountered: