Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running Invoke-AzureRmVmRunCommand: VM has reported a failure when processing extension 'RunCommandWindows' #6343

Closed
muntaserq opened this issue May 30, 2018 · 8 comments

Comments

@muntaserq
Copy link

@muntaserq muntaserq commented May 30, 2018

Description

We are trying to run Invoke-AzureRmVmRunCommand on some of our VMs. The command words on most of the VMs but on some of them we are getting a really weird error. We just started seeing it recently 05/29/2018 and it is consistent on the particular VMs.

ErrorMessage: VM has reported a failure when processing extension 'RunCommandWindows'. Error message: "Finished
executing command". (full stack trace below)

Script/Steps for Reproduction

$response = Invoke-AzureRmVMRunCommand -ResourceGroupName $ResourceGroupName -VMName $WebServer.Name -CommandId 'RunPowerShellScript' -ScriptPath 'Set-MyScriptName.ps1' -Parameter $parameters

Module Version

Version is 5.0.1

Debug Output

Invoke-AzureRmVMRunCommand : Long running operation failed with status 'Failed'. Additional Info:'VM has reported a 
failure when processing extension 'RunCommandWindows'. Error message: "Finished executing command".'
ErrorCode: VMExtensionProvisioningError
ErrorMessage: VM has reported a failure when processing extension 'RunCommandWindows'. Error message: "Finished 
executing command".
StartTime: 5/29/2018 5:21:26 PM
EndTime: 5/29/2018 5:21:49 PM
OperationID: ee5db740-9a3d-44fc-9934-2d4759d51e46
Status: Failed
@maddieclayton

This comment has been minimized.

Copy link
Contributor

@maddieclayton maddieclayton commented May 30, 2018

@koralski @savyasachisamal Can you take a look at this issue?

@markcowl markcowl added Compute - VM and removed Compute - VM labels May 30, 2018
@muntaserq

This comment has been minimized.

Copy link
Author

@muntaserq muntaserq commented Jun 7, 2018

I figured out this was an issue with how I was handling parameters and strings into the Invoke-AzureRmVMRunCommand call. It would be really nice if the output actually propagated the error to the console window.

Ok to close this ticket.

@phillipgibson

This comment has been minimized.

Copy link

@phillipgibson phillipgibson commented Nov 21, 2018

@muntaserq So what exactly resolved the issue involving the params for Invoke-AzureRmVMRunCommand?

@justinsmits

This comment has been minimized.

Copy link

@justinsmits justinsmits commented Jan 10, 2019

bump^ @muntaserq

1 similar comment
@kaveaa

This comment has been minimized.

Copy link

@kaveaa kaveaa commented Jan 11, 2019

bump^ @muntaserq

@muntaserq

This comment has been minimized.

Copy link
Author

@muntaserq muntaserq commented Jan 11, 2019

@muntaserq So what exactly resolved the issue involving the params for Invoke-AzureRmVMRunCommand?

In this specific context, I had to build up my $parameters HashTable a little differently.

Instead of doing:

$parameters =  @{"Output" = "This is test output" }

I had to do:

$parameters =  @{"Output" = "`"This is test output`"" }

This was the recommendation I got from an Azure Support Engineer. This seems to only be the case when using on parameter in the script. All that being said, I've since moved over to using the latest stable version of the AzureRm PowerShell modules and all my issues with that module have gone away. I use version 6.13.1 and of course you can find all the versions here: https://github.com/Azure/azure-powershell/releases.

@kaveaa

This comment has been minimized.

Copy link

@kaveaa kaveaa commented Jan 14, 2019

@muntaserq

This comment has been minimized.

Copy link
Author

@muntaserq muntaserq commented Jan 14, 2019

@kaveaa You're welcome. Also make sure that there are no syntax errors in your PowerShell script. I've seen the case when this error returns and there ends up being an error in the actual script. One troubleshooting method is to remote desktop into the target virtual machine and view the status of the Invoke-AzureRmVmRunCommand call. To do that, navigate to C:\Packages\Plugins\Microsoft.CPlat.Core.RunCommandWindows\1.1.0\Status and view the latest run status output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.