Dashboards not starting with default env (Request failed with code 500)

Made a change to the environments.ps1 on accident and it erased all my pre-configured environments.
Since then I just duplicated what I had on my other test box which looks like the following:

I set the default environment to 7.1.3 under settings / general

I can change the environment per dashboad to use 7.1.3 and they start fine. However when I use “default” they throw the following error. I can not create new dashboards either. Kind of stuck.

PSU version: 2.1.2

Log

Route matched with "{action = \"Index\", controller = \"UDDashboard\"}". Executing controller action with signature "System.Threading.Tasks.Task`1[Microsoft.AspNetCore.Mvc.IActionResult] Index()" on controller "UniversalDashboard.Controllers.UDDashboardController" ("Universal.Server"). (122b2fdf)
2021-08-20T10:40:21.9313345-05:00 800006de-0001-f400-b63f-84710c7967bb [INF] Executing ContentResult with HTTP Response ContentType of "text/plain; charset=utf-8" (7ec2a4e9)
2021-08-20T10:40:21.9313916-05:00 800006de-0001-f400-b63f-84710c7967bb [INF] Executed action "UniversalDashboard.Controllers.UDDashboardController.Index (Universal.Server)" in 0.1309ms (afa2e885)
2021-08-20T10:40:21.9314040-05:00 800006de-0001-f400-b63f-84710c7967bb [INF] Executed endpoint '"UniversalDashboard.Controllers.UDDashboardController.Index (Universal.Server)"' (99874f2b)
2021-08-20T10:40:21.9315463-05:00 800006de-0001-f400-b63f-84710c7967bb [INF] Request finished HTTP/1.1 GET https://server/api/internal/dashboard - - - 200 10 text/plain;+charset=utf-8 2.0312ms (791a596a)
2021-08-20T10:40:21.9329642-05:00 800003b7-0000-f800-b63f-84710c7967bb [ERR] An unhandled exception has occurred while executing the request. (48a46595)
System.ComponentModel.Win32Exception (2): The system cannot find the file specified.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at UniversalAutomation.JobProcessManager.StartProcessAsCurrentUser(String powerShellPath, String commandLine, Variable credential) in D:\a\universal\universal\src\Universal.Server\Services\JobProcessManager.cs:line 203
   at UniversalAutomation.JobProcessManager.StartDashboard(Int32 port, ExecutionEnvironment environment, Variable credential) in D:\a\universal\universal\src\Universal.Server\Services\JobProcessManager.cs:line 49
   at Universal.Server.Services.DashboardProxy.Start(Dashboard dashboard) in D:\a\universal\universal\src\Universal.Server\Services\DashboardProxy.cs:line 119
   at Universal.Server.Services.DashboardManager.Start(Dashboard dashboard) in D:\a\universal\universal\src\Universal.Server\Services\DashboardManager.cs:line 111
   at UniversalAutomation.DashboardController.Start(Int64 id) in D:\a\universal\universal\src\Universal.Server\Controllers\DashboardController.cs:line 171
   at lambda_method1407(Closure , Object , Object[] )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.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 ---
   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 ---
   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 ---
   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.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Universal.Server.Middleware.RoutingMiddleware.Invoke(HttpContext httpContext, IPolicyEvaluator policyEvaluator) in D:\a\universal\universal\src\Universal.Server\Middleware\RoutingMiddleware.cs:line 113
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at AspNetCoreRateLimit.RateLimitMiddleware`1.Invoke(HttpContext context) in D:\a\universal\universal\src\AspNetCoreRateLimit\Middleware\RateLimitMiddleware.cs:line 109
   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)
2021-08-20T10:40:21.9342765-05:00 800003b7-0000-f800-b63f-84710c7967bb [WRN] No exception handler was found, rethrowing original exception. (61fc7fab)
2021-08-20T10:40:21.9384102-05:00 800003b7-0000-f800-b63f-84710c7967bb [ERR] Connection ID ""17870283323016741740"", Request ID ""800003b7-0000-f800-b63f-84710c7967bb"": An unhandled exception was thrown by the application. (bf316047)
System.ComponentModel.Win32Exception (2): The system cannot find the file specified.
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at UniversalAutomation.JobProcessManager.StartProcessAsCurrentUser(String powerShellPath, String commandLine, Variable credential) in D:\a\universal\universal\src\Universal.Server\Services\JobProcessManager.cs:line 203
   at UniversalAutomation.JobProcessManager.StartDashboard(Int32 port, ExecutionEnvironment environment, Variable credential) in D:\a\universal\universal\src\Universal.Server\Services\JobProcessManager.cs:line 49
   at Universal.Server.Services.DashboardProxy.Start(Dashboard dashboard) in D:\a\universal\universal\src\Universal.Server\Services\DashboardProxy.cs:line 119
   at Universal.Server.Services.DashboardManager.Start(Dashboard dashboard) in D:\a\universal\universal\src\Universal.Server\Services\DashboardManager.cs:line 111
   at UniversalAutomation.DashboardController.Start(Int64 id) in D:\a\universal\universal\src\Universal.Server\Controllers\DashboardController.cs:line 171
   at lambda_method1407(Closure , Object , Object[] )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.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 ---
   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 ---
   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 ---
   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.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Universal.Server.Middleware.RoutingMiddleware.Invoke(HttpContext httpContext, IPolicyEvaluator policyEvaluator) in D:\a\universal\universal\src\Universal.Server\Middleware\RoutingMiddleware.cs:line 113
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at AspNetCoreRateLimit.RateLimitMiddleware`1.Invoke(HttpContext context) in D:\a\universal\universal\src\AspNetCoreRateLimit\Middleware\RateLimitMiddleware.cs:line 109
   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)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.HandleException(HttpContext context, ExceptionDispatchInfo edi)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT`1.ProcessRequestAsync()
2021-08-20T10:40:21.9386392-05:00 800003b7-0000-f800-b63f-84710c7967bb [INF] Request finished HTTP/1.1 PUT https://server/api/v1/dashboard/2/status - 0 - 500 - - 28.5276ms (791a596a)
2021-08-20T10:40:25.8294769-05:00 8000010a-0000-f500-b63f-84710c7967bb [INF] Request starting HTTP/1.1 POST https://server/notificationhub?id=lFxyTKPfBF4gKj4GC3b3Ow text/plain;charset=UTF-8 11 (ca22a1cb)

This kind of seems like a bug. You might need to set the environment to 7.1.3 for the dashboard for now while we investigate. I’ll open an issue to track this case.

That said, we just did some work around environments in 2.3 because of an issue there so it may be resolved already but it had to do with APIs and the default environment. I’ll validate that fix for this case as well.

Sounds good. Working on getting that server restored from a nightly backup in the meantime.

@adam @mikedhanson I had this same issue yesterday out of nowhere right after stopping the dashboard but managed to get it back working. I did the following; my env is IIS

Deleted dashboard
Stop app pool
Stop web site
Open PS in admin mode
Ran the get-childitem FOLDERPATH -recourse | unblock-file
Recreated the dashboard

However, my 500 error apparently was related to a supposedly missing js file.

Hope this help a bit

i had the same issue right after i installed the latest version (3.1.6). spent like half a day just to troubleshoot. i reverted to the previous version installed on my psu (2.11.1) and worked fine.