mmajcica / DeploySsrs

Build-Release task for VSTS/TFS that manages Microsoft's SQL Server Reporting Services
MIT License
21 stars 21 forks source link

Getting an error in deply #64

Closed jluna0069 closed 3 years ago

jluna0069 commented 3 years ago

Hi Mario, Im getting an error in deploy : ##[error]There was an error downloading 'http://lenovojorge/ReportServer/Reportservice2010.asmx?wsdl/ReportService2010.asmx'.

could you please (or anyone) help me? thanks in advance

dabrantkosky commented 3 years ago

Same error. In one network works fine, but in the other one returns an error for every application deployment.

mmajcica commented 3 years ago

Make sure that the connectivity is in place. Tasks run on the agents. Agent needs to be in possibility to reach the server on the port you have set your SSRS Web Server to replay. Judging by the URL, it is running on HTTP. Can your agent reach your server on the port 80?

dabrantkosky commented 3 years ago

Make sure that the connectivity is in place. Tasks run on the agents. Agent needs to be in possibility to reach the server on the port you have set your SSRS Web Server to replay. Judging by the URL, it is running on HTTP. Can your agent reach your server on the port 80?

Seems all in order. I have set the port 80 in my URL http://server.am.devnet.com:80/ReportServer_RPS_DEV_01/ReportService2010.asmx

Agent has access to the server, i can reach SSRS server from the browser inside the agent server, i ran a ping command and it's also working.

I'm using SQL authentication.

mmajcica commented 3 years ago

The task is a simple powershell script that tries to access the SSRS via HTTP. Two things can go wrong, or the connectivity is missing or the authentication is off.

Considering you have the access to the server I believe you are on an self hosted agent.

Can you do the following?

$username = "yourUserName"
$password = "yourpwd"
$url = "http://server.am.devnet.com:80/ReportServer_RPS_DEV_01/ReportService2010.asmx"

$securePassword = ConvertTo-SecureString -String $password -asPlainText -Force
        $credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $securePassword

        $proxy = New-WebServiceProxy -Uri $url -Namespace SSRS.ReportingService2010 -Credential $credential -Class "SSRS"

where the $url is the address of your SSRS webservice and $username and $password are correctly set.

Are you able to create the proxy object without errors?

If not, what are the errors reported?

Btw this is the same what the task does https://github.com/mmajcica/DeploySsrs/blob/4489e1d5e3e37c94515fad162bf2619dd059d066/task/task.ps1#L24

dabrantkosky commented 3 years ago

The task is a simple powershell script that tries to access the SSRS via HTTP. Two things can go wrong, or the connectivity is missing or the authentication is off.

Considering you have the access to the server I believe you are on an self hosted agent.

Can you do the following?

$username = "yourUserName"
$password = "yourpwd"
$url = "http://server.am.devnet.com:80/ReportServer_RPS_DEV_01/ReportService2010.asmx"

$securePassword = ConvertTo-SecureString -String $password -asPlainText -Force
        $credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $securePassword

        $proxy = New-WebServiceProxy -Uri $url -Namespace SSRS.ReportingService2010 -Credential $credential -Class "SSRS"

where the $url is the address of your SSRS webservice and $username and $password are correctly set.

Are you able to create the proxy object without errors?

If not, what are the errors reported?

Btw this is the same what the task does https://github.com/mmajcica/DeploySsrs/blob/4489e1d5e3e37c94515fad162bf2619dd059d066/task/task.ps1#L24

2020-10-06T19:03:33.8579937Z New-WebServiceProxy : The request failed with HTTP status 401: Unauthorized. 2020-10-06T19:03:33.8581271Z At C:\Agent_work_temp\10ea2031-2fdc-4cea-9fbe-5af9357319a8.ps1:10 char:18 2020-10-06T19:03:33.8581980Z + ... $proxy = New-WebServiceProxy -Uri $url -Namespace SSRS.ReportingSe ... 2020-10-06T19:03:33.8582650Z + ~~~~~~~~~~~~~ 2020-10-06T19:03:33.8583400Z + CategoryInfo : ObjectNotFound: (http://saov1705...ervice2010.asmx:Uri) [New-WebServiceProxy], WebExcept 2020-10-06T19:03:33.8584819Z ion 2020-10-06T19:03:33.8585345Z + FullyQualifiedErrorId : WebException,Microsoft.PowerShell.Commands.NewWebServiceProxy 2020-10-06T19:03:33.9412689Z ##[error]PowerShell exited with code '1'. 2020-10-06T19:03:33.9899272Z ##[section]Finishing: PowerShell Script

mmajcica commented 3 years ago

So there is something wrong with the authorization.

dabrantkosky commented 3 years ago

So there is something wrong with the authorization.

I don't have the credentials, so maybe someone entered them wrong on the Library, i'll check this and will be back.

Thanks!


Edit: @mmajcica It really was a problem with the account on SSRS Server. Is it possible to update the task to return a more specific error about authentication other than " ##[error]There was an error downloading"? Also, thank you for your help! :)