azure-devopsazure-pipelinesazure-pipelines-release-task

Failed to install 'VisualStudioRemoteDeployer' from service executable path VisualStudioRemoteDeployer.exe


Failed to install 'VisualStudioRemoteDeployer' from service executable path VisualStudioRemoteDeployer.exe

Error trace

System.AggregateException: Failed to install 'VisualStudioRemoteDeployer8a9e167d-96ee-45c0-9a2c-6251509937e6' from service executable path VisualStudioRemoteDeployer.exe . Consult the logs below:
2018-09-14T13:25:32.8643473Z Exception calling "SetRight" with "2" argument(s): "OpenPolicy failed: 5"
2018-09-14T13:25:32.8643473Z  CategoryInfo :NotSpecified: (:) [], MethodInvocationException
2018-09-14T13:25:32.8643473Z  FullyQualifiedErrorId :Exception
2018-09-14T13:25:32.8643473Z  ---> System.Management.Automation.RemoteException: Exception calling "SetRight" with "2" argument(s): "OpenPolicy failed: 5"
2018-09-14T13:25:32.8643473Z    --- End of inner exception stack trace ---
2018-09-14T13:25:32.8643473Z    at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable)
2018-09-14T13:25:32.8643473Z    at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.RemoteDeploymentHelper.InstallServiceInternal(String serviceSourcePath, String serviceName, String destinationFileName)
2018-09-14T13:25:32.8643473Z    at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.RemoteDeploymentHelper.InstallService(String serviceSourcePath, String serviceName, String destinationFileName)
2018-09-14T13:25:32.8643473Z    at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.DeploymentClient.<RunAsync>d__24.MoveNext()
2018-09-14T13:25:32.8643473Z ---> (Inner Exception #0) System.Management.Automation.RemoteException: Exception calling "SetRight" with "2" argument(s): "OpenPolicy failed: 5"<---

Solution

  • The error is thrown when the user is not having full admin rights or does not have right to run service. User must able to set “Log on as a service” rights remotely.

    1) Check if the user they are using to connect to remote machine having full admin rights on target machine.

    2) If user is already part of for “Log on as a service” and “local admin group” and user used for deployment is local user ( not a domain user ), I will suggest -

             1) Try to use the domain join user
    

    OR 2) UAC filtering for local accounts must be disabled to access a remote WinRM service. You can refer this documentation for same. ( more advanced details can found here “Using Windows Remote Management” )

    If this error you are seeing with powershell on remote task, try to make use of latest version 3.* of task, you will not ace this issue