Startup probe failed

Mansi Gusain 165 Reputation points
2024-11-12T10:27:21.0633333+00:00

Hi, for my container app I have not configured the health probes but I do have set up a dashboard to check if the container is healthy using this query-

Question is that I have not setup any health probes then why am I getting the error? None of the probes are configured from my end how to handle this?User's image

This is the query for dashboard , can you also please share the reference to "ReplicaUnhealthy". I believe it is configurable for our end. Please help me know. Thanks

Also,any suggested methods to reduce/avoid these kind of errors will be helpful.

ContainerAppSystemLogs_CL
| where Reason_s == "ReplicaUnhealthy"
| summarize cnt = count() by Reason_s, ContainerAppName_s, dt=bin(TimeGenerated, 30m)
| project ContainerAppName_s, Reason_s, cnt, dt
| render timechart 
Azure Health Data Services
Azure Health Data Services
An Azure offering that provides a suite of purpose-built technologies for protected health information in the cloud.
172 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sina Salam 14,551 Reputation points
    2024-11-12T19:54:19.6833333+00:00

    Hello Mansi Gusain,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you are having Startup probe failed error for your container app.

    Yes, Even though you haven’t explicitly configured any health probes. Azure Container Apps automatically adds default health probes if none are configured. This includes startup, liveness, and readiness probes - https://learn.microsoft.com/en-us/azure/container-apps/health-probes

    Also, the startup probe checks if your application has successfully started. If it fails, the container is killed and restarted according to the pod’s restart policy - https://kubebyexample.com/learning-paths/application-development-kubernetes/lesson-4-customize-deployments-application-2

    However, your SQL query for the dashboard looks good for monitoring unhealthy replicas:

    ContainerAppSystemLogs_CL
    | where Reason_s == "ReplicaUnhealthy"
    | summarize cnt = count() by Reason_s, ContainerAppName_s, dt=bin(TimeGenerated, 30m)
    | project ContainerAppName_s, Reason_s, cnt, dt
    | render timechart
    

    So, to reduce or avoid errors you will need to configure custom health probes that match your application’s startup and runtime characteristics. This can prevent premature restarts, and you should use detailed logging and monitoring to understand why probes are failing. This can help you fine-tune the probe configurations. Then, make sure your container has sufficient resources (CPU, memory) to start and run properly. For an example on how you might configure a startup probe in your container app:

    {
      "containers": [
        {
          "image": "your-image",
          "name": "your-container",
          "probes": [
            {
              "type": "startup",
              "httpGet": {
                "path": "/startup",
                "port": 8080
              },
              "initialDelaySeconds": 10,
              "periodSeconds": 5,
              "failureThreshold": 30
            }
          ]
        }
      ]
    }
    

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.


0 additional answers

Sort by: Most helpful

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.