Application error

Ashrith S Vasist 0 Reputation points
2024-04-14T07:33:36.0366667+00:00

I am trying to deploy a Flask app.
It runs successfully in localhost and also the build and deploy in github actions is successful as well.

The Flask app , just renders a template and nothing else. It is a simple one.

But when i click on the domain/link it is showing application error. I am a student and trying it for the first time . I cant figure out where is the issue.
Here is a screenshot of the issue.User's image

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

1 answer

Sort by: Most helpful
  1. ajkuma 28,111 Reputation points Microsoft Employee Moderator
    2024-04-16T09:32:46.18+00:00

    @Ashrith S Vasist , Apologies for the delayed response.

     

    I see that the WebApp is currently stopped.User's image

    Based on the info you have shared, after checking the internal logs, I see errors: 503

    503.0 and 504.0 errors. Typically, the HTTP 504 indicates timeout.

     

    I notice that most of the HTTP 504 are failing after 240 seconds. Azure Load Balancer has a default idle timeout setting of four minutes, it is the maximum amount of time that a request can take without sending any data back to the response. It is not configurable. Below are few methods to overcome this issue :

    Azure Load Balancer has a default idle timeout setting of four minutes, it is the maximum amount of time that a request can take without sending any data back to the response. It is not configurable. Please check this FAQ: Why does my request time out after 230 seconds?

     

    Kindly checkout the following approaches to overcome this issue :

    A. Optimize code to finish execution within 240 seconds or send some data back at regular intervals to keep the connection alive.

    **
    B.**  If sending data back to keep connection alive is not feasible, consider using async pattern. I That is:

    • First request starts with the script and returns an HTTP 202
    • Subsequent requests from clients check the progress, and eventually return 200 when it's done.

    C: Leverage background processing for long running tasks. E Please check this example: Azure Web Jobs or Azure Function Apps

     

    D. As a quick step to isolate the issue, you may scale-up the App Service Plan and see if it helps.
    ( you may later scale-down, as required)

      Checkout the log directory/location information:  
    Access log files and Enable and review logs to fetch more details about the error.

    Kindly let us know, I'll follow-up with you further.

    --
     If the answer helped (pointed, you in the right direction) > please click Accept Answer - it will help users to find the answers quickly.

    0 comments No comments

Your answer

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