Fluctuating 502 errors

Stefan Elsen 0 Reputation points
2024-01-26T08:30:18.4133333+00:00

Okay, I have my doubts anyone, who doesn't work for Microsoft, can resolve this but maybe this adds visibility. I've never had this issue and the way it behaves indicates it's an Azure-internal issue, possibly specific to this App Service. My application is a combination of Angular TS and ASP.NET. Nothing I haven't done before and certainly nothing I expected to run into problems with. Essentially, deployment goes through, the application starts, all files are accounted for but opening the site in the browser can sometimes not load index.html with 502:
User's image

Sometimes it opens, then halts on "Loading..." as the JS log shows a subset of the required .js and .css files generate the same 502 errors. When I print out the content of a file via cat in the app service console, it appears to not generate the error for that particular file and I can load it just fine via browser but it always comes back eventually. I'm sort of out of ideas. This is too erratic to be a configuration issue.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 17,731 Reputation points Microsoft Employee Moderator
    2024-01-28T04:00:47.9633333+00:00

    @Stefan Elsen Hi Stefan, I'm sorry to hear that you're encountering 502 errors and for the difficulty with opening a technical support ticket.

    You are right that troubleshooting error codes on the forum can be difficult but while you wait to hear back from your support engineer for your support case, I will try to self-empower you to learn more about the error and you might be able to share this with the support case owner to aid them in their investigation.

    With that being said, you have access to a lot of the same tools that a support engineer has, such as the diagnose problems blade.

    1. Navigate to your web app at portal.azure.com
    2. Open the "diagnose and solve problems" blade
    3. Navigate to the section that best represents the issue you are having (http errors)
    4. The tool will analyze your error code history and might be able to provide further insights for the errors. Make sure to select a timeframe where you know the error occurred.
    5. Let us know what you are able to find by replying back here.

    The next item is to understand what type of HTTP 502 error you are received by locating the http_substatus code. There are many causes and types of 502 errors so understanding the sub-status code can narrow down the cause.

    you can collect data to help diagnose the issue. You can enable diagnostic logs for your App Service and review the logs to see if there are any errors or warnings that could be related to the 502 errors. For more information, see Enable diagnostics logging for web apps in Azure App Service. Try to reproduce the error after enabling logging. Wait 15 minutes or so for the logs to update and reflect the error. You should see a column in the logs called http_sub_status code. Reply back to this message with that code so we can understand if this is a 502.21 or 502.53 error. We can then lookup the meaning and share it with you here.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.