In my TFS 2018 CD, i have a task `Run PowerShell on remote Machine' and it failed with error as follows
System.Management.Automation.RuntimeException: Failed to install 'VisualStudioRemoteDeployer
Find the task config as below
Find the complete error log as follows
2020-05-05T06:49:22.4862201Z Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information." 2020-05-05T06:49:22.4862692Z CategoryInfo:NotSpecified: (:) [], MethodInvocationException 2020-05-05T06:49:22.4862987Z FullyQualifiedErrorId:Exception 2020-05-05T06:49:22.4863348Z ---> System.Management.Automation.RemoteException: Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information." 2020-05-05T06:49:22.4863751Z --- End of inner exception stack trace --- 2020-05-05T06:49:22.4864154Z at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable) 2020-05-05T06:49:22.4864655Z at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.RemoteDeploymentHelper.InstallServiceInternal(String serviceSourcePath, String serviceName, String destinationFileName) 2020-05-05T06:49:22.4865266Z at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.RemoteDeploymentHelper.InstallService(String serviceSourcePath, String serviceName, String destinationFileName) 2020-05-05T06:49:22.4865783Z at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.DeploymentClient.<RunAsync>d__24.MoveNext() 2020-05-05T06:49:22.4866260Z ---> (Inner Exception #0) System.Management.Automation.RemoteException: Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information."<--- 2020-05-05T06:49:22.4866523Z 2020-05-05T06:49:22.4866665Z 2020-05-05T06:49:22.5010643Z Deployment status for machine 'XXXXX:5985': 'Failed' 2020-05-05T06:49:22.5565354Z ##[error], MethodInvocationException\r\n FullyQualifiedErrorId:Exception\r\n"}};] 2020-05-05T06:49:22.5588511Z 2020-05-05T06:49:22.5588871Z 2020-05-05T06:49:22.5951437Z ##[error]System.Management.Automation.RuntimeException: Failed to install 'VisualStudioRemoteDeployerc87a55d0-555b-426c-b80f-1cf90ad0bf1c' from service executable path VisualStudioRemoteDeployer.exe. Consult the logs below: 2020-05-05T06:49:22.5952932Z Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information." 2020-05-05T06:49:22.5953641Z CategoryInfo:NotSpecified: (:) [], MethodInvocationException 2020-05-05T06:49:22.5954109Z FullyQualifiedErrorId:Exception 2020-05-05T06:49:22.5954536Z ---> System.Management.Automation.RuntimeException: Failed to install 'VisualStudioRemoteDeployerc87a55d0-555b-426c-b80f-1cf90ad0bf1c' from service executable path VisualStudioRemoteDeployer.exe. Consult the logs below: 2020-05-05T06:49:22.5955018Z Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information." 2020-05-05T06:49:22.5955350Z CategoryInfo:NotSpecified: (:) [], MethodInvocationException 2020-05-05T06:49:22.5955636Z FullyQualifiedErrorId:Exception 2020-05-05T06:49:22.5955873Z 2020-05-05T06:49:22.5956133Z --- End of inner exception stack trace --- 2020-05-05T06:49:22.5956455Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) 2020-05-05T06:49:22.5959512Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) 2020-05-05T06:49:22.5959955Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) 2020-05-05T06:49:22.5960388Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection
2020-05-05T06:49:22.4862201Z Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information." 2020-05-05T06:49:22.4862692Z CategoryInfo:NotSpecified: (:) [], MethodInvocationException 2020-05-05T06:49:22.4862987Z FullyQualifiedErrorId:Exception 2020-05-05T06:49:22.4863348Z ---> System.Management.Automation.RemoteException: Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information." 2020-05-05T06:49:22.4863751Z --- End of inner exception stack trace --- 2020-05-05T06:49:22.4864154Z at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable) 2020-05-05T06:49:22.4864655Z at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.RemoteDeploymentHelper.InstallServiceInternal(String serviceSourcePath, String serviceName, String destinationFileName) 2020-05-05T06:49:22.4865266Z at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.RemoteDeploymentHelper.InstallService(String serviceSourcePath, String serviceName, String destinationFileName) 2020-05-05T06:49:22.4865783Z at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.DeploymentClient.<RunAsync>d__24.MoveNext() 2020-05-05T06:49:22.4866260Z ---> (Inner Exception #0) System.Management.Automation.RemoteException: Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information."<--- 2020-05-05T06:49:22.4866523Z 2020-05-05T06:49:22.4866665Z 2020-05-05T06:49:22.5010643Z Deployment status for machine 'XXXXX:5985': 'Failed' 2020-05-05T06:49:22.5565354Z ##[error], MethodInvocationException\r\n FullyQualifiedErrorId:Exception\r\n"}};] 2020-05-05T06:49:22.5588511Z 2020-05-05T06:49:22.5588871Z 2020-05-05T06:49:22.5951437Z ##[error]System.Management.Automation.RuntimeException: Failed to install 'VisualStudioRemoteDeployerc87a55d0-555b-426c-b80f-1cf90ad0bf1c' from service executable path VisualStudioRemoteDeployer.exe. Consult the logs below: 2020-05-05T06:49:22.5952932Z Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information." 2020-05-05T06:49:22.5953641Z CategoryInfo:NotSpecified: (:) [], MethodInvocationException 2020-05-05T06:49:22.5954109Z FullyQualifiedErrorId:Exception 2020-05-05T06:49:22.5954536Z ---> System.Management.Automation.RuntimeException: Failed to install 'VisualStudioRemoteDeployerc87a55d0-555b-426c-b80f-1cf90ad0bf1c' from service executable path VisualStudioRemoteDeployer.exe. Consult the logs below: 2020-05-05T06:49:22.5955018Z Exception calling "SetRight" with "2" argument(s): "Could not obtain the user information." 2020-05-05T06:49:22.5955350Z CategoryInfo:NotSpecified: (:) [], MethodInvocationException 2020-05-05T06:49:22.5955636Z FullyQualifiedErrorId:Exception 2020-05-05T06:49:22.5955873Z 2020-05-05T06:49:22.5956133Z --- End of inner exception stack trace --- 2020-05-05T06:49:22.5956455Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) 2020-05-05T06:49:22.5959512Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) 2020-05-05T06:49:22.5959955Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) 2020-05-05T06:49:22.5960388Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection
1 input, PSDataCollection 1 output, PSInvocationSettings settings) 2020-05-05T06:49:22.5960842Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection
1 in put, PSDataCollection 1 output, PSInvocationSettings settings) 2020-05-05T06:49:22.5961295Z at Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main(String[] args) 2020-05-05T06:49:22.6472008Z ##[error]LegacyVSTSPowerShellHost.exe completed with return code: -1.
This looks pretty related to this question. Root cause should be related to user access. Ensure that user credentials provided in config has admin privileges over target machine and TFS. This would unblock the VisualStudioRemoteDeployer
to run and eradicate SetRight" with "2" argument(s): "Could not obtain the user information
issue.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.