Skip to content

Commit b14c48c

Browse files
author
Jill Grant
authored
Merge pull request #254046 from v-jaswel/aca/v-jaswel_20230922
[ACA] Add troubleshooting article.
2 parents 6055f51 + 8c79e7b commit b14c48c

File tree

3 files changed

+197
-0
lines changed

3 files changed

+197
-0
lines changed

articles/container-apps/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@
126126
href: background-processing.md
127127
- name: With a job
128128
href: tutorial-event-driven-jobs.md
129+
- name: Troubleshooting
130+
href: troubleshooting.md
129131
- name: Reliability in Azure Container Apps
130132
href: ../reliability/reliability-azure-container-apps.md?toc=/azure/container-apps/toc.json&bc=/azure/container-apps/breadcrumb/toc.json
131133
- name: Observability
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# YamlMime:ZonePivotGroups
2+
groups:
3+
# Owner: craigshoemaker
4+
- id: azure-portal-console
5+
title: Interface
6+
prompt: Choose your interface
7+
pivots:
8+
- id: portal
9+
title: Azure portal
10+
- id: console
11+
title: Console
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
---
2+
title: Troubleshooting in Azure Container Apps
3+
description: Learn to troubleshoot an Azure Container Apps application.
4+
services: container-apps
5+
author: v-jaswel
6+
ms.service: container-apps
7+
ms.topic: how-to
8+
ms.date: 03/14/2024
9+
ms.author: v-wellsjason
10+
ms.custom: devx-track-azurecli
11+
---
12+
13+
# Troubleshoot a container app
14+
15+
Reviewing Azure Container Apps logs and configuration settings can reveal underlying issues if your container app isn't behaving correctly. Use the following guide to help you locate and view details about your container app.
16+
17+
## Scenarios
18+
19+
The following table lists issues you might encounter while using Azure Container Apps, and the actions you can take to resolve them.
20+
21+
| Scenario | Description | Actions |
22+
|--|--|--|
23+
| All scenarios | | [View logs](#view-logs)<br><br>[Use Diagnose and solve problems](#use-the-diagnose-and-solve-problems-tool) |
24+
| Error deploying new revision | You receive an error message when you try to deploy a new revision. | [Verify Container Apps can pull your container image](#verify-accessibility-of-container-image) |
25+
| Provisioning takes too long | After you deploy a new revision, the new revision has a *Provision status* of *Provisioning* and a *Running status* of *Processing* indefinitely. | [Verify health probes are configured correctly](#verify-health-probes-configuration) |
26+
| Revision is degraded | A new revision takes more than 10 minutes to provision. It finally has a *Provision status* of *Provisioned*, but a *Running status* of *Degraded*. The *Running status* tooltip reads `Details: Deployment Progress Deadline Exceeded. 0/1 replicas ready.` | [Verify health probes are configured correctly](#verify-health-probes-configuration) |
27+
| Requests to endpoints fail | The container app endpoint doesn't respond to requests. | [Review ingress configuration](#review-ingress-configuration) |
28+
| Requests return status 403 | The container app endpoint responds to requests with HTTP error 403 (access denied). | [Verify networking configuration is correct](#verify-networking-configuration) |
29+
| Responses not as expected | The container app endpoint responds to requests, but the responses aren't as expected. | [Verify traffic is routed to the correct revision](#verify-traffic-is-routed-to-the-correct-revision)<br><br>[Verify you're using unique tags when deploying images to the container registry](/azure/container-registry/container-registry-image-tag-version) |
30+
31+
## View logs
32+
33+
One of the first steps to take as you look for issues with your container app is to view log messages. You can view the output of both console and system logs. Your container app's console log captures the app's `stdout` and `stderr` streams. Container Apps generates [system logs](./logging.md#system-logs) for service level events.
34+
35+
1. Sign in to the [Azure portal](https://portal.azure.com).
36+
1. In the **Search** bar, enter your container app's name.
37+
1. Under *Resources* section, select your container app's name.
38+
1. In the navigation bar, expand **Monitoring** and select **Log stream** (not **Logs**).
39+
1. If the *Log stream* page says *This revision is scaled to zero.*, select the **Go to Revision Management** button. Deploy a new revision scaled to a minimum replica count of 1. For more information, see [Scaling in Azure Container Apps](./scale-app.md).
40+
1. In the *Log stream* page, set *Logs* to either **Console** or **System**.
41+
42+
## Use the diagnose and solve problems tool
43+
44+
You can use the *diagnose and solve problems* tool to find issues with your container app's health, configuration, and performance.
45+
46+
1. Sign in to the [Azure portal](https://portal.azure.com).
47+
1. In the **Search** bar, enter your container app's name.
48+
1. Under **Resources** section, select your container app's name.
49+
1. In the navigation bar, select **Diagnose and solve problems**.
50+
1. In the *Diagnose and solve problems* page, select one of the *Troubleshooting categories*.
51+
1. Select one of the categories in the navigation bar to find ways to fix problems with your container app.
52+
53+
## Verify accessibility of container image
54+
55+
If you receive an error message when you try to deploy a new revision, verify that Container Apps is able to pull your container image.
56+
57+
- Ensure your container environment firewall isn't blocking access to the container registry. For more information, see [Control outbound traffic with user defined routes](./user-defined-routes.md).
58+
- If your existing VNet uses a custom DNS server instead of the default Azure-provided DNS server, verify your DNS server is configured correctly and that DNS lookup of the container registry doesn't fail. For more information, see [DNS](./networking.md#dns).
59+
- If you used the Container Apps cloud build feature to generate a container image for you (see [Code-to-cloud path for Azure Container Apps](./code-to-cloud-options.md#new-to-containers), your image isn't publicly accessible, so this section doesn't apply.
60+
61+
For a Docker container that can run as a console application, verify that your image is publicly accessible by running the following command in an elevated command prompt. Before you run this command, replace placeholders surrounded by `<>` with your values.
62+
63+
```
64+
docker run --rm <YOUR_CONTAINER_IMAGE>
65+
```
66+
67+
Verify that Docker runs your image without reporting any errors. If you're running [Docker on Windows](https://docs.docker.com/desktop/install/windows-install/), make sure you have the Docker Engine running.
68+
69+
If your image is not publicly accessible, you might receive the following error.
70+
71+
```
72+
docker: Error response from daemon: pull access denied for <YOUR_CONTAINER_IMAGE>, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. See 'docker run --help'.
73+
```
74+
75+
For more information, see [Networking in Azure Container Apps environment](./networking.md).
76+
77+
## Review ingress configuration
78+
79+
Your container app's ingress settings are enforced through a set of rules that control the routing of external and internal traffic to your container app. If you're unable to connect to your container app, review these ingress settings to make sure your ingress settings aren't blocking requests.
80+
81+
1. Sign in to the [Azure portal](https://portal.azure.com).
82+
1. In the *Search* bar, enter your container app's name.
83+
1. Under *Resources*, select your container app's name.
84+
1. In the navigation bar, expand *Settings* and select **Ingress**.
85+
86+
| Issue | Action |
87+
|--|--|
88+
| Is ingress enabled? | Verify the **Enabled** checkbox is checked. |
89+
| Do you want to allow external ingress? | Verify that **Ingress Traffic** is set to **Accepting traffic from anywhere**. If your container app doesn't listen for HTTP traffic, set **Ingress Traffic** to **Limited to Container Apps Environment**. |
90+
| Does your client use HTTP or TCP to access your container app? | Verify **Ingress type** is set to the correct protocol (**HTTP** or **TCP**). |
91+
| Does your client support mTLS? | Verify **Client certificate mode** is set to **Require** only if your client supports mTLS. For more information, see [Environment level network encryption.](./networking.md#mtls) |
92+
| Does your client use HTTP/1 or HTTP/2? | Verify **Transport** is set to the correct HTTP version (**HTTP/1** or **HTTP/2**). |
93+
| Is the target port set correctly? | Verify **Target port** is set to the same port your container app is listening on, or the same port exposed by your container app's Dockerfile. |
94+
| Is your client IP address denied? | If **IP Security Restrictions Mode** isn't set to **Allow all traffic**, verify your client doesn't have an IP address that is denied. |
95+
96+
For more information, see [Ingress in Azure Container Apps](./ingress-overview.md).
97+
98+
## Verify networking configuration
99+
100+
[Azure recursive resolvers](../virtual-network/virtual-networks-name-resolution-for-vms-and-role-instances.md#name-resolution-that-uses-your-own-dns-server) uses the IP address `168.63.129.16` to resolve requests.
101+
102+
1. If your VNet uses a custom DNS server instead of the default Azure-provided DNS server, configure your DNS server to forward unresolved DNS queries to `168.63.129.16`.
103+
1. When configuring your NSG or firewall, don't block the `168.63.129.16` address.
104+
105+
For more information, see [Networking in Azure Container Apps environment](./networking.md).
106+
107+
## Verify health probes configuration
108+
109+
For all health probe types (liveness, readiness, and startup) that use TCP as their transport, verify their port numbers match the ingress target port you configured for your container app.
110+
111+
1. Sign in to the [Azure portal](https://portal.azure.com).
112+
1. In the **Search** bar, enter your container app's name.
113+
1. Under *Resources*, select your container app's name.
114+
1. In the navigation bar, expand *Application* and select **Containers**.
115+
1. In the *Containers* page, select **Health probes**.
116+
1. Expand **Liveness probes**, **Readiness probes**, and **Startup probes**.
117+
1. For each probe, verify the **Port** value is correct.
118+
119+
Update *Port* values as follows:
120+
121+
1. Select **Edit and deploy** to create a new revision.
122+
1. In the *Create and deploy new revision* page, select the checkbox next to your container image and select **Edit**.
123+
1. In the *Edit a container* window, select **Health probes**.
124+
1. Expand **Liveness probes**, **Readiness probes**, and **Startup probes**.
125+
1. For each probe, edit the **Port** value.
126+
1. Select the **Save** button.
127+
1. In the *Create and deploy new revision* page, select the **Create** button.
128+
129+
### Configure health probes for extended startup time
130+
131+
If ingress is enabled, the following default probes are automatically added to the main app container if none is defined for each type.
132+
133+
Here are the default values for each probe type.
134+
135+
| Property | Startup | Readiness | Liveness |
136+
|---|---|---|---|
137+
| Protocol | TCP | TCP | TCP |
138+
| Port | Ingress target port | Ingress target port | Ingress target port |
139+
| Timeout | 3 seconds | 5 seconds | n/a |
140+
| Period | 1 second | 5 seconds | n/a |
141+
| Initial delay | 1 second | 3 seconds | n/a |
142+
| Success threshold | 1 | 1 | n/a |
143+
| Failure threshold | 240 | 48 | n/a |
144+
145+
If your container app takes an extended amount of time to start (which is common in Java) you might need to customize your liveness and readiness probe *Initial delay seconds* property accordingly. You can [view the logs](#view-logs) to see the typical startup time for your container app.
146+
147+
1. Sign in to the [Azure portal](https://portal.azure.com).
148+
1. In the **Search** bar, enter your container app's name.
149+
1. Under *Resources*, select your container app's name.
150+
1. In the navigation bar, expand *Application* and select **Containers**.
151+
1. In the *Containers* page, select **Health probes**.
152+
1. Select **Edit and deploy** to create a new revision.
153+
1. In the *Create and deploy new revision* page, select the checkbox next to your container image and select **Edit**.
154+
1. In the *Edit a container* window, select **Health probes**.
155+
1. Expand **Liveness probes**.
156+
1. If **Enable liveness probes** is selected, increase the value for **Initial delay seconds**.
157+
1. Expand **Readiness probes**.
158+
1. If **Enable readiness probes** is selected, increase the value for **Initial delay seconds**.
159+
1. Select **Save**.
160+
1. In the *Create and deploy new revision* page, select the **Create** button.
161+
162+
You can then [view the logs](#view-logs) to see if your container app starts successfully.
163+
164+
For more information, see [Use Health Probes](./health-probes.md).
165+
166+
## Verify traffic is routed to the correct revision
167+
168+
If your container app doesn't behave as expected, the issue might be that requests are being routed to an outdated revision.
169+
170+
1. Sign in to the [Azure portal](https://portal.azure.com).
171+
1. In the **Search** bar, enter your container app's name.
172+
1. Under *Resources*, select your container app's name.
173+
1. In the navigation bar, expand *Application* and select **Revisions**.
174+
175+
If *Revision Mode* is set to `Single`, all traffic is routed to your latest revision by default. The *Active revisions* tab should list only one revision, with a *Traffic* value of `100%`.
176+
177+
If **Revision Mode** is set to `Multiple`, verify you're not routing traffic to outdated revisions.
178+
179+
For more information about configuring traffic splitting, see [Traffic splitting in Azure Container Apps](./traffic-splitting.md).
180+
181+
## Next steps
182+
183+
> [!div class="nextstepaction"]
184+
> [Reliability in Azure Container Apps](../reliability/reliability-azure-container-apps.md)

0 commit comments

Comments
 (0)