Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Wednesday, April 10, 2019 5:46 PM
I am currently attempting to run the following extentino as part of a Virtual Machine Scale Set:
{
"name": "AppInstall",
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [
"[concat(parameters('_artifactsLocation'), '/Script/TestClient.ps1',parameters('_artifactsLocationSasToken'))]"
],
"commandToExecute": "powershell -ExecutionPolicy Unrestricted -File TestClient.ps1"
}
}
}
However the extension fails with the error
[{"version":1.0,"timestampUTC":"4/10/2019 5:07:21 PM","status":{"name":"Microsoft.Azure.Extensions.CustomScript","operation":"Extension '' of Handler 'Microsoft.Azure.Extensions.CustomScript' version '1.0' faulted due to exception during extension processing","status":"Error","code":1,"formattedMessage":{"lang":"en-US","message":"Extension '' of Handler 'Microsoft.Azure.Extensions.CustomScript' version '1.0' faulted due to exception during extension processing"}}}]
In WaAppAgent.log the following errors are seen:
[00000003] [04/10/2019 17:29:56.84] [ERROR] Error : The specified executable is not a valid application for this OS platform. Access rules - Access rules for - S-1-1-0 are ReadAndExecute, Synchronize
Access rules for - S-1-5-18 are FullControl
Access rules for - S-1-5-32-544 are FullControl
Access rules for - S-1-1-0 are ReadAndExecute, Synchronize
Access rules for - S-1-5-18 are FullControl
Access rules for - S-1-5-32-544 are FullControl
Access rules for - S-1-1-0 are ReadAndExecute, Synchronize
Access rules for - S-1-5-18 are FullControl
Access rules for - S-1-5-32-544 are FullControl
[00000003] [04/10/2019 17:29:58.88] [ERROR] CPU Percentage 0
Available Memory 2546
CPU Percentage (Process) 0
Working Set 7.166362E+07
[00000003] [04/10/2019 17:30:01.88] [ERROR] Failed to launch the plugin command C:\Packages\Plugins\Microsoft.Azure.Extensions.CustomScript\2.0.6\bin/custom-script-shim for Microsoft.Azure.Extensions.CustomScript
[00000003] [04/10/2019 17:30:01.88] [ERROR] Install failed for plugin (name: Microsoft.Azure.Extensions.CustomScript, version 2.0.6) with exception Failed to launch the plugin command C:\Packages\Plugins\Microsoft.Azure.Extensions.CustomScript\2.0.6\bin/custom-script-shim for Microsoft.Azure.Extensions.CustomScript, Code: 1007
[00000003] [04/10/2019 17:30:01.88] [ERROR] Error while processing plugin Microsoft.Azure.Extensions.CustomScript version 2.0.6, state: enabled, error: System.Exception: Failed to launch the plugin command C:\Packages\Plugins\Microsoft.Azure.Extensions.CustomScript\2.0.6\bin/custom-script-shim for Microsoft.Azure.Extensions.CustomScript
at Microsoft.WindowsAzure.GuestAgent.ContainerStateMachine.HandlerStateMachine.StartProcessWithRetryForPluginArtifact(Process process, PluginArtifacts pluginArtifact, String pluginVersion, PluginEventType endType, Int32 processWaitTimeout, Int32& numTriesTaken)
at Microsoft.WindowsAzure.GuestAgent.ContainerStateMachine.HandlerStateMachine.InvokeCommand(String command, PluginArtifacts pluginArtifact, String pluginVersion, String pluginFolder, String pluginLogFolder, Int32 processWaitTimeout, PluginEventType startType, PluginEventType endType, CancellationToken ct, IDictionary`2 environmentVariables)
at Microsoft.WindowsAzure.GuestAgent.ContainerStateMachine.HandlerStateMachine.InstallHandler(PluginArtifacts artifact, CancellationToken ct)
at Microsoft.WindowsAzure.GuestAgent.ContainerStateMachine.HandlerStateMachine.DownloadAndInstallHandler(PluginArtifacts data, CancellationToken ct)
at Microsoft.WindowsAzure.GuestAgent.ContainerStateMachine.HandlerStateMachine.StartHandlerStateMachine(PluginArtifacts data, RDConfigHostingEnvironmentSettingsPlugin plugin, CancellationToken ct)
at Microsoft.WindowsAzure.GuestAgent.ContainerStateMachine.PluginInstaller.ProcessPluginArtifacts(PluginArtifacts pluginArtifacts, CancellationToken ct)
[00000004] [04/10/2019 17:30:01.88] [ERROR] Processing Task for HandlerName: 'Microsoft.Azure.Extensions.CustomScript', ExtensionName: '' is faulted with the following exception:
[00000004] [04/10/2019 17:30:01.88] [INFO] Writing default status file C:\Packages\Plugins\Microsoft.Azure.Extensions.CustomScript\2.0.6\Status\2.status for the Microsoft.Azure.Extensions.CustomScript handler (version 2.0.6), status: Faulted
[00000004] [04/10/2019 17:30:01.88] [INFO] Default status file C:\Packages\Plugins\Microsoft.Azure.Extensions.CustomScript\2.0.6\Status\2.status successfully written for the Microsoft.Azure.Extensions.CustomScript handler (version 2.0.6)
[00000004] [04/10/2019 17:30:01.88] [INFO] ExtensionTaskVertex for extension 'HandlerName: 'Microsoft.Azure.Extensions.CustomScript', ExtensionName: ''' reached terminal state
[00000004] [04/10/2019 17:30:01.88] [INFO] Polling Task for 'HandlerName: 'Microsoft.Azure.Extensions.CustomScript', ExtensionName: ''' completed with the status: Faulted.
[00000004] [04/10/2019 17:30:01.88] [ERROR] Exception processing extension HandlerName: 'Microsoft.Azure.Extensions.CustomScript', ExtensionName: '' : Processing Task for HandlerName: 'Microsoft.Azure.Extensions.CustomScript', ExtensionName: '' is faulted with the following exception:
This is a freshly deployed VM running:
Publisher: MicrosoftWindowsServer Offer: WindowsServer SKU: 2019-Datacenter Version: latest
In North Europe with the 2.0.6 Custom Script Extension.
To me it looks like the extension isn't initialising correctly. I couldn't find any information online so to me it looks like a bug in the extension? Any ideas if there are any more relevant logs as C:\WindowsAzure\Logs\Plugins\Microsoft.Azure.Extensions.CustomScript\2.0.6 is empty?
All replies (3)
Wednesday, April 10, 2019 11:52 PM âś…Answered
Are you sure you got all the properties right? When looking at other examples the publisher is not mircosoft.azure.extension
/en-us/azure/virtual-machines/extensions/custom-script-windows#property-values
https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-custom-script-windows
Friday, April 12, 2019 7:29 AM
Doh!
I'd originally copied the script extension template from the Linux guide and hadn't noticed that the extension was different between Windows and Linux. That would certainly explain the error message
The specified executable is not a valid application for this OS platform.
Sunday, April 14, 2019 3:45 PM
Glad that helped :)