502.5 error - Can't get UDDashboard running in IIS

I followed the docs on installation: https://github.com/adamdriscoll/universal-dashboard-documentation/blob/master/running-dashboards/iis.md

I get the 502.5 error as I said
In looking at the event logs I see
Application ‘MACHINE/WEBROOT/APPHOST/UDDASHBOARD’ with physical root ‘C:\inetpub\wwwroot’ failed to start process with commandline '.\net472\universaldashboard.server.exe ', ErrorCode = '0x80070002 : 0.

My dashboard.ps1 file is:
Start-UDDashboard -Wait -Dashboard (
New-UDDashboard -Title “Hello, IIS” -Content {
New-UDCard -Title “Hello, IIS”
}
)
I setup a new local user with admin rights and assigned that user to the app pool I am using for the website.

I have
.net framework 4.7.2 SDK
.net core runtime 2.1.5
.net core sdk 3.0.101

Any ideas?

Can you try running the process manually to see if it works? Just fire up a cmd.exe and launch UD.Server.exe. It might provide a better error message.

Here’s what I get
C:\Program Files\WindowsPowerShell\Modules\UniversalDashboard\2.7.0\net472>UniversalDashboard.server.exe
Starting Universal Dashboard service.
Dashboard Script: C:\Program Files\WindowsPowerShell\Modules\UniversalDashboard\2.7.0\net472…\dashboard.ps1
Assembly Base Path: C:\Program Files\WindowsPowerShell\Modules\UniversalDashboard\2.7.0\net472…\dashboard.ps1
Error starting dashboard:
The term ‘C:\Program Files\WindowsPowerShell\Modules\UniversalDashboard\2.7.0\net472…\dashboard.ps1’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
at , : line 1

Unhandled Exception: System.Exception: Failed to start dashboard
at UniversalDashboard.DashboardManager.Start()
at UniversalDashboard.Program.Main(String[] args)

Have you copied the module to the wwwroot folder? Can you try executing from there rather than the program files folder?

Thanks, that got me to where I needed. I recopied the module over. Apparently I had missed some files the first time.

All is working now! Thanks!

ok, I spoke too soon. I really am not getting the hang of things very quickly here.

Now the page comes up in IIS - everything works right - that was just the dashboard.ps1 demo page that was in the instructions.

When I try to run my own dashboard - it loads about halfway (loads the title and the theme) but displays PAGE NOT FOUND

Here is the code I’ve got it honed down to

Import-Module UniversalDashboard.Community
$Pages = @()

$Pages += New-UDPage -Name ‘Machine Parameters’ -Icon Book -Content {

New-UDHeading -Text "Machine Parameters" -Size 3 -color "White"

}

$Theme = Get-UDTheme -Name “Azure”
$Dashboard = New-UDDashboard -Title “Provisioning” -Theme $Theme -Pages $Pages
Get-UDDashboard | Stop-UDDashboard
Start-UDDashboard -Dashboard $Dashboard -wait

This runs fine if I substitute -wait with -port 10000 and I look at it there. But from within IIS I get page not found:

you need to use -port 10000 in IIS as well so your code should be :slight_smile:

 $Pages = @()

$Pages += New-UDPage -Name ‘Machine Parameters’ -Icon Book -Content {

New-UDHeading -Text "Machine Parameters" -Size 3 -color "White"
}

$Theme = Get-UDTheme -Name “Azure”
$Dashboard = New-UDDashboard -Title “Provisioning” -Theme $Theme -Pages $Pages
Get-UDDashboard | Stop-UDDashboard
Start-UDDashboard -Dashboard $Dashboard -wait -port 10000

The problem is propably the name of your “Home” page.
If UD does not have a page called “Home” it gives this error. There is New-UDPage -DefaultHomePage but I’m not sure this will solve your problem.
I see 2 solutions;

  1. name your page “Home” instead of “Machine Parameters”
  2. provide a second page called “Home” with other info.

I’m getting a 502.5 error as well but what I’m trying to do it http to https port redirect running in IIS.

Start-UDDashboard -Dashboard $Dashboard -wait

works on http/https with iis

Start-UDDashboard -Dashboard $Dashboard -wait -port 80 -httpsport 443
gives 502.5 error. I also tried specifying a cert and same error.

In IIS, I would suggest using IIS redirection rather than UD redirection: https://www.namecheap.com/support/knowledgebase/article.aspx/9953/38/iis-redirect-http-to-https

The reason is that IIS just proxies to the UD server. So IIS is doing the HTTPS and redirection and just proxying over to the UD server over HTTP.

Ah ok, makes sense thanks.