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

Creating WebService proxy using credentials #37

Closed
MagnusTim opened this issue Feb 7, 2018 · 6 comments
Closed

Creating WebService proxy using credentials #37

MagnusTim opened this issue Feb 7, 2018 · 6 comments

Comments

@MagnusTim
Copy link

Hi,

Thanks for a nice build task!

We have problems deploying to one of our buildservers.
We use: SQL Server 2014 SP2, 12.0.5000.0 and the user running the deploystep is local admin on the server and has rights on the RS instance.  
We get the following error:

2018-02-07T13:45:42.0734713Z Uploading files
2018-02-07T13:45:42.0794723Z Creating WebService proxy using credentials
2018-02-07T13:45:42.0794723Z
2018-02-07T13:45:42.0794723Z
2018-02-07T13:46:03.1817656Z ##[error]System.Management.Automation.ActionPreferenceStopException: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Unable to connect to the remote server
2018-02-07T13:46:03.1817656Z ##[debug]Processed: ##vso[task.logissue type=error;]System.Management.Automation.ActionPreferenceStopException: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Unable to connect to the remote server
2018-02-07T13:46:03.1817656Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
2018-02-07T13:46:03.1817656Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
2018-02-07T13:46:03.1817656Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
2018-02-07T13:46:03.1817656Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)
2018-02-07T13:46:03.1817656Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)
2018-02-07T13:46:03.1827676Z at Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main(String[] args)

Do you have any guidence or tips what we could do or if we can get extende logging somehow?

Regards Magnus

@ygeelen-tb
Copy link
Collaborator

Could you try running a simple powershell script that does an HTTP request to your Reporting Services Service and print the response?

@jonasnorrlander
Copy link

Hi,

Tried to make a call with powershell (Invoke-WebRequest -Uri "http://WSP2597C/ReportServer/ReportService2010.asmx?wsdl") and got the following error.

2018-02-12T11:06:38.9650478Z Deployment started on target machine...
2018-02-12T11:06:38.9650478Z
2018-02-12T11:06:38.9650478Z System.AggregateException: Failed to execute the powershell script. Consult the logs below for details of the error.
2018-02-12T11:06:38.9650478Z The remote server returned an error: (401) Unauthorized. ---> System.Management.Automation.CmdletInvocationException: The remote server returned an error: (401) Unauthorized. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
2018-02-12T11:06:38.9650478Z at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
2018-02-12T11:06:38.9650478Z at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
2018-02-12T11:06:38.9650478Z --- End of inner exception stack trace ---
2018-02-12T11:06:38.9650478Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
2018-02-12T11:06:38.9650478Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
2018-02-12T11:06:38.9650478Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
2018-02-12T11:06:38.9650478Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)
2018-02-12T11:06:38.9650478Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)
2018-02-12T11:06:38.9650478Z at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
2018-02-12T11:06:38.9650478Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.<>c__DisplayClass28_0.b__0()
2018-02-12T11:06:38.9650478Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.<>c__DisplayClass19_01.<Execute>b__0() 2018-02-12T11:06:38.9650478Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute(Action action) 2018-02-12T11:06:38.9650478Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute[T](Func1 action)
2018-02-12T11:06:38.9660554Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)
2018-02-12T11:06:38.9660554Z --- End of inner exception stack trace ---
2018-02-12T11:06:38.9660554Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)
2018-02-12T11:06:38.9660554Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.ScriptExecutor.ExecuteScript(IPowerShell powerShell, String script, String arguments, Boolean isScriptDotSourced, Boolean useHttp)
2018-02-12T11:06:38.9660554Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.DeploymentService.RunPowerShellScripts(DeploymentMachineSpecification deploymentMachine, ScriptSpecification scriptSpecification, ScriptSpecification initializationScriptSpecification, String applicationPath, IPowerShell powerShellSession)
2018-02-12T11:06:38.9660554Z ---> (Inner Exception #0) System.Management.Automation.CmdletInvocationException: The remote server returned an error: (401) Unauthorized. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
2018-02-12T11:06:38.9660554Z at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
2018-02-12T11:06:38.9660554Z at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
2018-02-12T11:06:38.9660554Z --- End of inner exception stack trace ---
2018-02-12T11:06:38.9660554Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
2018-02-12T11:06:38.9660554Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
2018-02-12T11:06:38.9660554Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
2018-02-12T11:06:38.9660554Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)
2018-02-12T11:06:38.9660554Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)
2018-02-12T11:06:38.9660554Z at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
2018-02-12T11:06:38.9660554Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.<>c__DisplayClass28_0.b__0()
2018-02-12T11:06:38.9660554Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.<>c__DisplayClass19_01.<Execute>b__0() 2018-02-12T11:06:38.9660554Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute(Action action) 2018-02-12T11:06:38.9660554Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute[T](Func1 action)
2018-02-12T11:06:38.9660554Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)<---
2018-02-12T11:06:38.9660554Z GET http://wsp2597c/ReportServer/ReportService2010.asmx?wsdl with 0-byte payload
2018-02-12T11:06:38.9670490Z
2018-02-12T11:06:38.9670490Z
2018-02-12T11:06:38.9670490Z
2018-02-12T11:06:38.9670490Z ##[debug]Service logs for Deployment operation on WSP2597C:5985
2018-02-12T11:06:38.9670490Z ##[debug]RemoteDeployerSource Verbose: 10 : [RemoteDeployer]12:feb:18:12:6:36:3800; 19784, 4Creating public key for communication
2018-02-12T11:06:38.9670490Z RemoteDeployerSource Verbose: 2 : [RemoteDeployer]12:feb:18:12:6:36:3956; 19784, 4Created public key for communication
2018-02-12T11:06:38.9670490Z RemoteDeployerSource Information: 12 : [RemoteDeployer]12:feb:18:12:6:36:3956; 19784, 4Deployment service - VisualStudioRemoteDeployerf5dde5eb-72ca-4e35-bd5a-33cd35119140 is running...
2018-02-12T11:06:38.9670490Z RemoteDeployerSource Verbose: 4 : [RemoteDeployer]12:feb:18:12:6:37:4112; 19784, 6Input file found
2018-02-12T11:06:38.9670490Z RemoteDeployerSource Verbose: 5 : [RemoteDeployer]12:feb:18:12:6:37:4112; 19784, 6Reading input parameters
2018-02-12T11:06:38.9670490Z RemoteDeployerSource Verbose: 6 : [RemoteDeployer]12:feb:18:12:6:37:4112; 19784, 6Finished reading input parameters
2018-02-12T11:06:38.9670490Z RemoteDeployerSource Verbose: 7 : [RemoteDeployer]12:feb:18:12:6:37:4581; 19784, 6Executing specified action. ScriptNull= False,. AzureStorageNull: True
2018-02-12T11:06:38.9670490Z RemoteDeployerSource Information: 1222012 : [RemoteDeployer]12:feb:18:12:6:37:4581; 19784, 6deploymentMachine.MachineName: localhost.
2018-02-12T11:06:38.9670490Z RemoteDeployerSource Information: 1221727 : [RemoteDeployer]12:feb:18:12:6:37:4581; 19784, 6ApplicationPath:
2018-02-12T11:06:38.9680588Z RemoteDeployerSource Information: 1221740 : [RemoteDeployer]12:feb:18:12:6:37:4737; 19784, 4Establishing local powershell session on the machine
2018-02-12T11:06:38.9680588Z RemoteDeployerSource Information: 1221740 : [RemoteDeployer]12:feb:18:12:6:37:7551; 19784, 4Finished establishing local powershell session on the machine
2018-02-12T11:06:38.9680588Z RemoteDeployerSource Information: 1221661 : [RemoteDeployer]12:feb:18:12:6:37:7551; 19784, 4Starting Run Dsc on the machine:localhost, powershell port: 5985.
2018-02-12T11:06:38.9680588Z RemoteDeployerSource Information: 1221666 : [RemoteDeployer]12:feb:18:12:6:37:7551; 19784, 4Executing commands to set execution policy and set global variables.
2018-02-12T11:06:38.9680588Z RemoteDeployerSource Information: 1222014 : [RemoteDeployer]12:feb:18:12:6:37:7862; 19784, 4GetDeploymentScript:: applicationPath:
2018-02-12T11:06:38.9680588Z RemoteDeployerSource Information: 1221667 : [RemoteDeployer]12:feb:18:12:6:37:7862; 19784, 4Machine:localhost Port:5985 => Creating Working Directory and setting it as the current directory.
2018-02-12T11:06:38.9680588Z RemoteDeployerSource Information: 1221665 : [RemoteDeployer]12:feb:18:12:6:37:8175; 19784, 4Executing powershell script file.
2018-02-12T11:06:38.9680588Z RemoteDeployerSource Verbose: 1221675 : [RemoteDeployer]12:feb:18:12:6:37:8800; 19784, 4Finished retrying 1 out of 3 times for exception: System.Management.Automation.CmdletInvocationException: The remote server returned an error: (401) Unauthorized. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
2018-02-12T11:06:38.9680588Z at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request)
2018-02-12T11:06:38.9680588Z at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
2018-02-12T11:06:38.9680588Z --- End of inner exception stack trace ---
2018-02-12T11:06:38.9680588Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
2018-02-12T11:06:38.9680588Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
2018-02-12T11:06:38.9680588Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
2018-02-12T11:06:38.9680588Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)
2018-02-12T11:06:38.9680588Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings)
2018-02-12T11:06:38.9680588Z at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
2018-02-12T11:06:38.9680588Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.<>c__DisplayClass28_0.b__0()
2018-02-12T11:06:38.9680588Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.<>c__DisplayClass19_01.<Execute>b__0() 2018-02-12T11:06:38.9680588Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute(Action action) 2018-02-12T11:06:38.9690549Z RemoteDeployerSource Error: 1221741 : [RemoteDeployer][12:feb:18:12:6:37:8800; 19784, 4](WSP2597C:5985-f5dde5eb-72ca-4e35-bd5a-33cd35119140)System.AggregateException: Failed to execute the powershell script. Consult the logs below for details of the error. 2018-02-12T11:06:38.9690549Z The remote server returned an error: (401) Unauthorized. ---> System.Management.Automation.CmdletInvocationException: The remote server returned an error: (401) Unauthorized. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized. 2018-02-12T11:06:38.9690549Z at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request) 2018-02-12T11:06:38.9690549Z at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord() 2018-02-12T11:06:38.9690549Z --- End of inner exception stack trace --- 2018-02-12T11:06:38.9690549Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) 2018-02-12T11:06:38.9690549Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) 2018-02-12T11:06:38.9690549Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) 2018-02-12T11:06:38.9690549Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings) 2018-02-12T11:06:38.9690549Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings) 2018-02-12T11:06:38.9690549Z at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings) 2018-02-12T11:06:38.9690549Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.<>c__DisplayClass28_0.<Invoke>b__0() 2018-02-12T11:06:38.9690549Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.<>c__DisplayClass19_01.b__0()
2018-02-12T11:06:38.9690549Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute(Action action)
2018-02-12T11:06:38.9690549Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute[T](Func1 action) 2018-02-12T11:06:38.9690549Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference) 2018-02-12T11:06:38.9690549Z --- End of inner exception stack trace --- 2018-02-12T11:06:38.9690549Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference) 2018-02-12T11:06:38.9690549Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.ScriptExecutor.ExecuteScript(IPowerShell powerShell, String script, String arguments, Boolean isScriptDotSourced, Boolean useHttp) 2018-02-12T11:06:38.9690549Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.DeploymentService.RunPowerShellScripts(DeploymentMachineSpecification deploymentMachine, ScriptSpecification scriptSpecification, ScriptSpecification initializationScriptSpecification, String applicationPath, IPowerShell powerShellSession) 2018-02-12T11:06:38.9690549Z ---> (Inner Exception #0) System.Management.Automation.CmdletInvocationException: The remote server returned an error: (401) Unauthorized. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized. 2018-02-12T11:06:38.9700485Z at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request) 2018-02-12T11:06:38.9700485Z at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord() 2018-02-12T11:06:38.9700485Z --- End of inner exception stack trace --- 2018-02-12T11:06:38.9700485Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) 2018-02-12T11:06:38.9700485Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) 2018-02-12T11:06:38.9700485Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) 2018-02-12T11:06:38.9700485Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings) 2018-02-12T11:06:38.9700485Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings) 2018-02-12T11:06:38.9700485Z at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings) 2018-02-12T11:06:38.9700485Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.<>c__DisplayClass28_0.<Invoke>b__0() 2018-02-12T11:06:38.9700485Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.<>c__DisplayClass19_01.b__0()
2018-02-12T11:06:38.9700485Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute(Action action)
2018-02-12T11:06:38.9700485Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute[T](Func1 action) 2018-02-12T11:06:38.9700485Z at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable, ActionPreference errorActionPreference)<--- 2018-02-12T11:06:38.9700485Z 2018-02-12T11:06:38.9700485Z RemoteDeployerSource Information: 1221662 : [RemoteDeployer][12:feb:18:12:6:37:8800; 19784, 4](WSP2597C:5985-f5dde5eb-72ca-4e35-bd5a-33cd35119140)Cleaning temporary Mof Folder 2018-02-12T11:06:38.9700485Z RemoteDeployerSource Verbose: 1221778 : [RemoteDeployer][12:feb:18:12:6:37:8956; 19784, 4](WSP2597C:5985-f5dde5eb-72ca-4e35-bd5a-33cd35119140)Disposing the remote session 2018-02-12T11:06:38.9700485Z RemoteDeployerSource Verbose: 8 : [RemoteDeployer][12:feb:18:12:6:37:8956; 19784, 6](WSP2597C:5985-f5dde5eb-72ca-4e35-bd5a-33cd35119140)Completed specificed action. Result: Failed 2018-02-12T11:06:38.9700485Z 2018-02-12T11:06:38.9700485Z 2018-02-12T11:06:38.9700485Z Deployment status for machine 'WSP2597C:5985' : 'Failed' 2018-02-12T11:06:39.1580077Z ##[debug]Processed: ##vso[task.logissue type=error;code={"Dtl_Sdk_Error":{"PowershellPort":5985,"Protocol":"Http","TestCertificate":false,"WinrmConnectionSucceeded":true,"Error":"The remote server returned an error: (401) Unauthorized."}};] 2018-02-12T11:06:39.1580077Z 2018-02-12T11:06:39.1610093Z 2018-02-12T11:06:39.1610093Z ##[debug]System.Exception: The remote server returned an error: (401) Unauthorized. 2018-02-12T11:06:39.1610093Z ##[error]System.Management.Automation.RuntimeException: The remote server returned an error: (401) Unauthorized. ---> System.Management.Automation.RuntimeException: The remote server returned an error: (401) Unauthorized. 2018-02-12T11:06:39.1610093Z ##[debug]Processed: ##vso[task.logissue type=error;]System.Management.Automation.RuntimeException: The remote server returned an error: (401) Unauthorized. ---> System.Management.Automation.RuntimeException: The remote server returned an error: (401) Unauthorized. 2018-02-12T11:06:39.1630092Z --- End of inner exception stack trace --- 2018-02-12T11:06:39.1630092Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) 2018-02-12T11:06:39.1630092Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) 2018-02-12T11:06:39.1630092Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) 2018-02-12T11:06:39.1630092Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection1 input, PSDataCollection1 output, PSInvocationSettings settings) 2018-02-12T11:06:39.1630092Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection1 input, PSDataCollection`1 output, PSInvocationSettings settings)
2018-02-12T11:06:39.1630092Z at Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main(String[] args)
2018-02-12T11:06:39.1720102Z ##[error]LegacyVSTSPowerShellHost.exe completed with return code: -1.
2018-02-12T11:06:39.1740084Z ##[section]Finishing: Run PowerShell on WSP2597C
2018-02-12T11:06:39.1810069Z ##[debug]Cleaning agent temp folder: D:\BA\10_work_temp
2018-02-12T11:06:39.1820086Z ##[section]Finishing: Release

@anton-kirschhock
Copy link
Contributor

We've handled that by passing a PSObject to the webservice creation:
$wsSecurePass = ConvertTo-SecureString -String $WsPassword -AsPlainText -Force

	$auth = New-Object System.Management.Automation.PSCredential -ArgumentList $WsUsername,$wsSecurePass;
	$ssrs = New-WebServiceProxy -Uri $WebserviceUrl -Credential $auth -ErrorAction Stop

Im not sure if this would help

@anton-kirschhock
Copy link
Contributor

It looks to me more that the buildserver has no connection to the ssrs server.
Verify that with your IT department and let us know

@MagnusTim
Copy link
Author

MagnusTim commented Mar 22, 2018 via email

@anton-kirschhock
Copy link
Contributor

anton-kirschhock commented Mar 22, 2018

Okay thanks for the feedback :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants