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 · 7 comments
Assignees
Labels
Compute - VM Service Attention This issue is responsible by Azure service team.

Comments

@muntaserq
Copy link

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
Copy link
Contributor

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

@muntaserq
Copy link
Author

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.

@bsiegel bsiegel added the Service Attention This issue is responsible by Azure service team. label Sep 26, 2018
@phillipgibson
Copy link

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

@justinsmits
Copy link

bump^ @muntaserq

1 similar comment
@kaveaa
Copy link

kaveaa commented Jan 11, 2019

bump^ @muntaserq

@muntaserq
Copy link
Author

@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.

@muntaserq
Copy link
Author

@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
Labels
Compute - VM Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

9 participants