502.5 Error After 2.9.0 Update

After the latest release of UD (2.9.0), we seem to be unable to run even the most simple dashboard in Azure Web Apps. Regardless of what we deploy, we seem to always get an IIS error stating: " HTTP Error 502.5 - Process Failure". In the event log, I’m able to see that the server was unable to start a Powershell.exe process, but I get no useful data besides that. The event log error can be seen below:

    <Event>
    <System>
        <Provider Name="IIS AspNetCore Module"/>
        <EventID>1000</EventID>
        <Level>1</Level>
        <Task>0</Task>
        <Keywords>Keywords</Keywords>
        <TimeCreated SystemTime="2020-02-26T21:41:45Z"/>
        <EventRecordID>909532515</EventRecordID>
        <Channel>Application</Channel>
        <Computer>RD281878B9A69D</Computer>
        <Security/>
    </System>
    <EventData>
        <Data>Application 'MACHINE/WEBROOT/APPHOST/MBIT-PRD-DESKTOPDASHBOARD-WEBAPP__0C7C' with physical root 'D:\home\site\wwwroot\' failed to start process with commandline 'PowerShell.exe ', ErrorCode = '0x80004005' : 5.</Data>
    </EventData>
</Event>

I am aware that in the most recent release the web.config file was changed to now reference Powershell.exe directly, vs the Universal Dashboard server file, and I’m curious if that is part of the issue. Has anyone else experienced this problem?

Thanks in advance for any help you can offer!

Hello - Yes most of us ran into this.

So in your web.config in 2.9.0 you will see

<aspNetCore processPath="PowerShell.exe" arguments="" stdoutLogEnabled="true" stdoutLogFile="\\?\%home%\LogFiles\stdout" forwardWindowsAuthToken="false" />

within the arguments="" add .\dashboard.ps1

<aspNetCore processPath="PowerShell.exe" arguments=".\dashboard.ps1" stdoutLogEnabled="true" stdoutLogFile="\\?\%home%\LogFiles\stdout" forwardWindowsAuthToken="false" />

Also in your dashboard.ps1 file add this at the top

$WarningPreference = "SilentlyContinue"
Import-Module .\UniversalDashboard.psm1

This should get your dashboard running in an Azure Web App

2 Likes

@jmknight2

Is the above solution working for you? I’m no longer getting a 5.2.5 error on-prem, but instead a blank page.

@fromtheinternet

I had to clear my cache when i updated to 2.9.0 in order to get it to work, I was just getting a blank page as well.

Nope, still no luck.

In your web browser, I’d suggest opening the developer tools (press F12) and see if there are any errors in the console.

Cheers Adam,

I’m getting a 404 on the main and vendor javascript bundles.

  1. Request URL: http://SERVERNAME/vendor.a5263d0d4e6d77a7859c.bundle.js
  2. Request Method: GET
  3. Status Code: 404 Not Found
  4. Remote Address: [::1]:80
  5. Referrer Policy: no-referrer-when-downgrade

The site is nested and has the base href set.

EDIT: Here’s the index.html (with style tags removed)

<!DOCTYPE html>
<html>
<head>
    <base href="/UserManagement/"/>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>User Management</title>
<link rel="shortcut icon" href="favicon.ico"></head>
<body>
    <div id="app" class="app"/>
    <script type="text/javascript" src="main.a5263d0d4e6d77a7859c.bundle.js"></script>
    <script type="text/javascript" src="vendor.a5263d0d4e6d77a7859c.bundle.js"></script></body>
</html>

Ok, I figured out what was going wrong.

At the beginning of the script I started the logging. Below that, I was doing the UD module import. So it never looked at the config in the directory, instead pulling the defaults from where the module was installed from PSGallery.

Can’t believe it took me this long to spot that…

I’m sorry for the delay in my response. Lots of other things have unfortunately stolen my focus.

I have updated the web.config file as @mylabonline recommended. The full content of that file is as below:

<configuration>
  <!--
    Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
  -->
  <system.webServer>
    <security>
      <!-- <requestFiltering removeServerHeader ="true" /> -->
    </security>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="PowerShell.exe" arguments=".\dashboard.ps1" stdoutLogEnabled="true" stdoutLogFile="\\?\%home%\LogFiles\stdout" forwardWindowsAuthToken="false" />
    <httpProtocol>
      <customHeaders>
        <remove name="X-Powered-By" />
      </customHeaders>
    </httpProtocol>  
  </system.webServer>
</configuration>

And the first 2 lines of code in my dashboard.ps1 are as below:
$WarningPreference = "SilentlyContinue"
Import-Module .\UniversalDashboard.psm1

My dashboard does load, and I’m able to get to the login page and complete AzureAD authentication, but afterwards I’m left with a blank page. The only thing that appears in Chrome’s DevTools is the below warning, which I don’t believe has any bearing on this.
image
Given the security concerns with earlier versions of UD, we obviously don’t want to downgrade our dashboard at this point. @adam I’m hoping you can shed some light here.

UPDATE:
Literally moments after posting this, the below error appeared in devtools after several minutes sitting on a blank page. Nothing changed on the page itself.
image

Following up on this as well as @jmknight2 coworker.

@adam Was a guide developed on any changes needed to migrate to 2.8.x to 2.9.x on an Azure App Service? We’ve deployed 3 different dashboards and all of them error out on 2.9.x on a Azure App Service.