Unable to Start Dashboard - 1.2.2 IIS

For a little background, I got Powershell Universal set up on my local machine using the MSI, but to host on a server I am using the ZIP.

On this new setup, I’ve got everything working in IIS, except for starting a new dashboard. I am getting this errors in the logs when I start the IIS site and when I attempt to start the dashboard:

warn: Universal.Server.Services.DashboardManager[0]
      Dashboard proxy for dashboard 3 not found.
info: UniversalAutomation.JobProcessManager[0]
      Starting job using Process.
fail: UniversalAutomation.Services.UniversalConfigurationService[0]
      Failed to read configuration file. dashboards.ps1
System.Exception: Failed to start dashboard.
   at Universal.Server.Services.DashboardProxy.Start(Dashboard dashboard) in E:\src\universal\src\Universal.Server\Services\DashboardProxy.cs:line 107
   at Universal.Server.Services.DashboardManager.Start(Dashboard dashboard) in E:\src\universal\src\Universal.Server\Services\DashboardManager.cs:line 60
   at Universal.Server.Services.DashboardManager.Restart(Dashboard dashboard) in E:\src\universal\src\Universal.Server\Services\DashboardManager.cs:line 70
   at UniversalAutomation.Services.UniversalConfigurationService.Read[T](Func`2 includes) in E:\src\universal\src\UniversalAutomation\Services\UniversalConfigurationService.cs:line 357
fail: Universal.Server.Services.DashboardAssetManager[0]
      The specified RequiredModules entry 'Universal' in the module manifest 'C:\inetpub\wwwroot\powershell_universal\UniversalDashboard\Frameworks\v2\UniversalDashboard.psd1' is invalid. Try again after updating this entry with valid values.
fail: Universal.Server.Services.DashboardAssetManager[0]
      The specified RequiredModules entry 'Universal' in the module manifest 'C:\inetpub\wwwroot\powershell_universal\UniversalDashboard\Frameworks\v3\UniversalDashboard.psd1' is invalid. Try again after updating this entry with valid values.

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
System.Exception: Failed to start dashboard.
   at Universal.Server.Services.DashboardProxy.Start(Dashboard dashboard) in E:\src\universal\src\Universal.Server\Services\DashboardProxy.cs:line 107
   at Universal.Server.Services.DashboardManager.Start(Dashboard dashboard) in E:\src\universal\src\Universal.Server\Services\DashboardManager.cs:line 60
   at UniversalAutomation.DashboardController.Start(Int64 id) in E:\src\universal\src\Universal.Server\Controllers\DashboardController.cs:line 151
   at lambda_method(Closure , Object , Object[] )
   at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Universal.Server.Middleware.RoutingMiddleware.Invoke(HttpContext httpContext, IPolicyEvaluator policyEvaluator) in E:\src\universal\src\Universal.Server\Middleware\RoutingMiddleware.cs:line 80
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
info: UniversalAutomation.JobProcessManager[0]
      Starting job using Process.
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
System.Exception: Failed to start dashboard.
   at Universal.Server.Services.DashboardProxy.Start(Dashboard dashboard) in E:\src\universal\src\Universal.Server\Services\DashboardProxy.cs:line 107
   at Universal.Server.Services.DashboardManager.Start(Dashboard dashboard) in E:\src\universal\src\Universal.Server\Services\DashboardManager.cs:line 60
   at UniversalAutomation.DashboardController.Start(Int64 id) in E:\src\universal\src\Universal.Server\Controllers\DashboardController.cs:line 151
   at lambda_method(Closure , Object , Object[] )
   at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Universal.Server.Middleware.RoutingMiddleware.Invoke(HttpContext httpContext, IPolicyEvaluator policyEvaluator) in E:\src\universal\src\Universal.Server\Middleware\RoutingMiddleware.cs:line 80
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

A few extra notes:

  • If I click “View” from the admin interface, I get a blank page instead of the expected content.
  • The logs seem to be pointing to files in an E: drive, but this server does not have an E: drive.

Any ideas on what might be causing dashboards to not be starting?

Have you been through all the steps here?
https://docs.ironmansoftware.com/config/hosting-iis
and
https://docs.ironmansoftware.com/config/hosting-iis-windowsauth

Hi, thanks for the reply.

Yes, I’ve gone through the Hosting IIS and IIS Windows Auth steps but I’m still not able to start a new dashboard. I noticed that the video instructions on the Hosting IIS page has different information for the web.config setup compared to the actual article - the video has “–iis” at the end of the arguments and has “.\Universal.Server.exe” as the processpath rather than “dotnet”. Any idea on which is correct? I don’t notice any difference when I try one over the other, but I’m using what the video has for now.

Use: “.\Universal.Server.exe” with no arguments for the web.config.

We’ll have to fix the video.

On the log tab of the dashboard page, is there anything interesting listed there? As for the paths, that’s just due to the builder being on E. Those paths are just for reference to the source code.

I just resolved an issue this morning that was cropping up for me here and there. The PowerShell process would start and then terminate. The -NoExit flag was not preventing the PowerShell.exe process from exiting. This resulted in dashboards start and stopping with this error but everything would look fine in terms of the start up.

Can you also post what is in this file? C:\ProgramData\UniversalAutomation.universal\dashboards.ps1

It looks like there might be something wrong there: Failed to read configuration file. dashboards.ps1

Okay, by “no arguments” do you mean leave the arguments="[dll file path]" blank or omit the --iis from the arguments="[dll file path]" file path? Just want to make sure I’m not misunderstanding.

There is actually no logs in the log tab of the dashboard page. Good to know that the paths are not an issue.

I’m not seeing anything matching that path, but at C:\ProgramData\UniversalAutomation\Repository.universal\dashboards.ps1 there is the following:
New-PSUDashboard -Name "health" -FilePath "health.ps1" -BaseUrl "/health" -Framework "UniversalDashboard:3.0.0-beta5"
In case this helps, the health.ps1 file is in the folder above that, at C:\ProgramData\UniversalAutomation\Repository\health.ps1

Hopefully that sheds some light on the setup I have, please let me know if you need additional details or info. Thanks so much for your help.

For the web.config, I mean something like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="Universal.Server.exe" arguments="" forwardWindowsAuthToken="false" stdoutLogEnabled="true" stdoutLogFile=".\logs\log" hostingModel="OutOfProcess"/>
  </system.webServer>
</configuration>

You may have to adjust the path of the Universal.Server to where ever you are storing that.

And can you please try the latest nightly release? https://imsreleases.z19.web.core.windows.net/

There was an issue I just found with starting dashboards.

Understood, thanks for the extra clarification on the web.config. I’ve changed mine to match yours (taking the path into account).

I tried the latest nightly release (59039/Universal.win-x64.1.2.2.zip) and created a new dashboard and it says that it is Starting, but nothing seems to happen. When I click Info, the status is Stopped and the log tab is empty. Seems like I’m essentially having the same issue.

Here are some errors I’m noticing in the log (these few errors are coming up several times in the logs):

Exception calling "LoadFrom" with "1" argument(s): "Could not load file or assembly 
'file:///C:\inetpub\wwwroot\Universal\Host-v5\Host.dll' or one of its dependencies. Operation is not supported. 
(Exception from HRESULT: 0x80131515)"
At line:1 char:5
+ & { [System.Reflection.Assembly]::LoadFrom('C:\inetpub\wwwroot\Univer ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FileLoadException
 
Unable to find type [UniversalHost.AgentService].
At line:1 char:105
+ ... l\Host-v5\Host.dll') | Out-Null; [UniversalHost.AgentService]::StartA ...
+                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (UniversalHost.AgentService:TypeName) [], RuntimeException
    + FullyQualifiedErrorId : TypeNotFound
fail: Universal.Server.Services.DashboardAssetManager[0]
      The specified RequiredModules entry 'Universal' in the module manifest 'C:\inetpub\wwwroot\Universal\UniversalDashboard\Frameworks\v2\UniversalDashboard.psd1' is invalid. Try again after updating this entry with valid values.

I would post the entire logs for more context but I ran into the character limit. Hopefully this is enough to go off of. (The nightly version is set up in C:\inetpub\wwwroot\Universal, the previous 1.2.2 version was C:\inetpub\wwwroot\powershell-universal)

The file paths that PSU is having trouble with do exist, so I’m really not sure what the problem is.

This is the issue.

Can you validate that you have .NET Framework 4.7.2 or later installed? Maybe just do a $PSVersionTable in a PowerShell window.

Here’s what I get as the output of that:

Name                           Value
----                           -----
PSVersion                      5.1.14393.3471
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.14393.3471
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Ok. You have at least 4.6 installed but MSFT changed the way they show the version numbers after 4.6. Can you run this?

$Lookup = @{
    378389 = [version]'4.5'
    378675 = [version]'4.5.1'
    378758 = [version]'4.5.1'
    379893 = [version]'4.5.2'
    393295 = [version]'4.6'
    393297 = [version]'4.6'
    394254 = [version]'4.6.1'
    394271 = [version]'4.6.1'
    394802 = [version]'4.6.2'
    394806 = [version]'4.6.2'
    460798 = [version]'4.7'
    460805 = [version]'4.7'
    461308 = [version]'4.7.1'
    461310 = [version]'4.7.1'
    461808 = [version]'4.7.2'
    461814 = [version]'4.7.2'
    528040 = [version]'4.8'
    528049 = [version]'4.8'
}

# For One True framework (latest .NET 4x), change the Where-Object match 
# to PSChildName -eq "Full":
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -Recurse |
  Get-ItemProperty -name Version, Release -EA 0 |
  Where-Object { $_.PSChildName -match '^(?!S)\p{L}'} |
  Select-Object @{name = ".NET Framework"; expression = {$_.PSChildName}}, 
@{name = "Product"; expression = {$Lookup[$_.Release]}}, 
Version, Release

it output a more specific version for me:

.NET Framework                   Product Version        Release
--------------                   ------- -------        -------
v2.0.50727                               2.0.50727.4927
v3.0                                     3.0.30729.4926
Windows Communication Foundation         3.0.4506.4926
Windows Presentation Foundation          3.0.6920.4902
v3.5                                     3.5.30729.4926
Client                                   4.8.04084      528372
Full                                     4.8.04084      528372
Client                                   4.0.0.0

Sure thing. Here’s what I get from that:

.NET Framework                   Product Version        Release
--------------                   ------- -------        -------
v2.0.50727                               2.0.50727.4927
v3.0                                     3.0.30729.4926
Windows Communication Foundation         3.0.4506.4926
Windows Presentation Foundation          3.0.6920.4902
v3.5                                     3.5.30729.4926
Client                           4.7.2   4.7.03062      461814
Full                             4.7.2   4.7.03062      461814
Client                                   4.0.0.0

Hmmmm. So that looks good. Did you unblock the files after extracting them from the ZIP?

Get-ChildItem C:\inetpub\wwwroot\Universal -Recurse | Unblock-File

I did before but just in case I did it again, started the site in IIS again and still having the same issue. I checked the logs again and noticed this error:

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
System.Exception: Failed to start dashboard.
   at Universal.Server.Services.DashboardProxy.Start(Dashboard dashboard) in E:\src\universal\src\Universal.Server\Services\DashboardProxy.cs:line 108
   at Universal.Server.Services.DashboardManager.Start(Dashboard dashboard) in E:\src\universal\src\Universal.Server\Services\DashboardManager.cs:line 61
   at UniversalAutomation.DashboardController.Start(Int64 id) in E:\src\universal\src\Universal.Server\Controllers\DashboardController.cs:line 151
   at lambda_method(Closure , Object , Object[] )
   at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Universal.Server.Middleware.RoutingMiddleware.Invoke(HttpContext httpContext, IPolicyEvaluator policyEvaluator) in E:\src\universal\src\Universal.Server\Middleware\RoutingMiddleware.cs:line 81
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

Not sure if this helps at all but worth a shot.

For anyone else running into a similar issue to me, Adam helped me out and it turns out I needed to run the unblock command in PowerShell with elevated priviledges (run as Administrator). Once we ran that command and restarted the site in IIS, the dashboard started successfully.

The unblock command is in the documentation, but for completion’s sake here it is:

Get-ChildItem -Recurse | Unblock-File

Make sure to run it in the extracted PSU folder. Hope this solves anyone else’s issue too!

2 Likes