ironmansoftware / universal-automation

Universal Automation is the PowerShell-first automation platform.
https://ironmansoftware.com/universal-automation/
MIT License
24 stars 4 forks source link

Unexpected Warning Output / Wrong Url #111

Closed claudiospizzi closed 4 years ago

claudiospizzi commented 4 years ago

Describe the Issue

When invoking the following simple script in Universal Dashboard, I'm getting two warnings in the output stream:

param ($Name)
Write-Host "Hello, $Name!"

Warning messages, via API and in the dashboard.

C:\> Get-UAJobOutput -ComputerName https://powershell-api.domain.local -JobId 1

Id        : 1
Message   : Call failed. An error occurred while sending the request. GET http://localhost:10000/api/v1/Job/1
Type      : Warning
Data      :
Job       : UniversalAutomation.Job
Timestamp : 28.02.2020 01:02:55

Id        : 2
Message   : Call failed. An error occurred while sending the request. GET http://localhost:10000/api/v1/Script/1
Type      : Warning
Data      :
Job       : UniversalAutomation.Job
Timestamp : 28.02.2020 01:02:57

Id        : 3
Message   : Hello, Claudio!
Type      : Information
Data      :
Job       : UniversalAutomation.Job
Timestamp : 28.02.2020 01:02:57

To Reproduce

Steps to reproduce the behavior: (Example)

Setup: Hosting UniversalAutomation and UniversalAutomation.Dashboard on an IIS:

Start Skript UniversalAutomation;

Import-Module UniversalAutomation
New-Item "C:\inetpub\wwwroot\PowerShell-API\Repo" -ItemType Directory -ErrorAction SilentlyContinue
Start-UAServer -InProcess -ConnectionString "C:\inetpub\wwwroot\PowerShell-API\database.db"  -RepositoryPath 'C:\inetpub\wwwroot\PowerShell-API\Repo'

Start Skript UniversalAutomation.Dashbaord:

Import-Module UniversalAutomation.Dashboard
Connect-UAServer -ComputerName https://powershell-api.domain.local
$Dashboard = New-UADashboard -ComputerName https://powershell-api.domain.local
Start-UDDashboard -Dashboard $Dashboard -Wait

Create the script in the dashboard and invoke it.

The part localhost and port are somewhere hardcoded? Or not respected if we run it within IIS?

Expected behavior

No warnings, just one information output.

Screenshots

If applicable, add screenshots to help explain your problem. image

Version Information

claudiospizzi commented 4 years ago

@adamdriscoll Did you have any chance to check that? I think the issue with the wrong url also leads to additional problems, like the following:

I'm trying to return some PSCustomObject's to the pipeline: image image

But the pipeline output is empty: image

And if I try to download the objects, it throw's an error: image

But getting it from the UA itself, it works: image

adamdriscoll commented 4 years ago

@claudiospizzi - Yep. I found the source of this issue and it should be resolved in v1.1.0. The problem was the API was failing to be called correctly which resulted in a whole bunch of other issues downstream. Hopefully, we will be releasing v1.1 this week.