|
| 1 | +--- |
| 2 | +title: Troubleshoot common build issues in Azure Spring Apps |
| 3 | +description: Learn how to troubleshoot common build issues in Azure Spring Apps. |
| 4 | +author: KarlErickson |
| 5 | +ms.service: spring-apps |
| 6 | +ms.topic: troubleshooting |
| 7 | +ms.date: 10/24/2022 |
| 8 | +ms.author: yili7 |
| 9 | +--- |
| 10 | + |
| 11 | +# Troubleshoot common build issues in Azure Spring Apps |
| 12 | + |
| 13 | +> [!NOTE] |
| 14 | +> Azure Spring Apps is the new name for the Azure Spring Cloud service. Although the service has a new name, you'll see the old name in some places for a while as we work to update assets such as screenshots, videos, and diagrams. |
| 15 | +
|
| 16 | +**This article applies to:** ❌ Basic/Standard tier ✔️ Enterprise tier |
| 17 | + |
| 18 | +This article describes how to troubleshoot build issues with your Azure Spring Apps deployment. |
| 19 | + |
| 20 | +## Build exit codes |
| 21 | + |
| 22 | +Azure Spring Apps Enterprise tier uses Tanzu Buildpacks to transform your application source code into images. For more information, see [Tanzu Buildpacks](https://docs.vmware.com/en/VMware-Tanzu-Buildpacks/index.html). |
| 23 | + |
| 24 | +When you deploy your app in Azure Spring Apps using the [Azure CLI](/cli/azure/install-azure-cli), you'll see a build log in the Azure CLI console. If the build fails, Azure Spring Apps displays an exit code and error message in the CLI console indicating why the buildpack execution failed during different phases of the buildpack [lifecycle](https://buildpacks.io/docs/concepts/components/lifecycle/). |
| 25 | + |
| 26 | +The following list describes some common exit codes: |
| 27 | + |
| 28 | +- **20** - All buildpack groups have failed to detect. |
| 29 | + |
| 30 | + Consider the following possible causes of an exit code of *20*: |
| 31 | + |
| 32 | + - The builder you're using doesn't support the language your project used. |
| 33 | + |
| 34 | + If you're using the default builder, check the language the default builder supports. For more information, see the [Default Builder and Tanzu Buildpacks](how-to-enterprise-build-service.md#default-builder-and-tanzu-buildpacks) section of [Use Tanzu Build Service](how-to-enterprise-build-service.md). |
| 35 | + |
| 36 | + If you're using the custom builder, check whether your custom builder's buildpack supports the language your project used. |
| 37 | + |
| 38 | + - You're running against the wrong path; for example, your Maven project's *pom.xml* file isn't in the root path. |
| 39 | + |
| 40 | + Set `BP_MAVEN_POM_FILE` to specify the location of the project's *pom.xml* file. |
| 41 | + |
| 42 | + - There's something wrong with your application; for example, your *.jar* file doesn't have a */META-INF/MANIFEST.MF* file that contains a `Main-Class` entry. |
| 43 | + |
| 44 | +- **51** - Buildpack build error. |
| 45 | + |
| 46 | + Consider the following possible causes of an exit code of *51*: |
| 47 | + |
| 48 | + - If Azure Spring Apps displays the error message `Build failed in stage build with reason OOMKilled` in the Azure CLI console, the build failed due to insufficient memory. |
| 49 | + |
| 50 | + Use the following command to increase memory using the `build-memory` environment variable: |
| 51 | + |
| 52 | + ```azurecli |
| 53 | + az spring app deploy \ |
| 54 | + --resource-group <your-resource-group-name> \ |
| 55 | + --service <your-Azure-Spring-Apps-name> \ |
| 56 | + --name <your-app-name> \ |
| 57 | + --build-memory 3Gi |
| 58 | + ``` |
| 59 | +
|
| 60 | + - The build failed because of an application source code error; for example, there's a compilation error in your source code. |
| 61 | + |
| 62 | + Check the build log to find the root cause. |
| 63 | +
|
| 64 | + - The build failed because of a download dependency error; for example, a network issue caused the Maven dependency download to fail. |
| 65 | +
|
| 66 | +- **62** - Failed to write image to Azure Container Registry. |
| 67 | + |
| 68 | + Consider the following possible cause of an exit code of *62*: |
| 69 | +
|
| 70 | + - If Azure Spring Apps displays the error message `Failed to write image to the following tags` in the build log, the build failed because of a network issue. |
| 71 | +
|
| 72 | + Retry to fix the issue. |
| 73 | +
|
| 74 | + If your application is a static file or dynamic front-end application served by a web server, see the [Common build and deployment errors](how-to-enterprise-deploy-static-file.md#common-build-and-deployment-errors) section of [Deploy static files in Azure Spring Apps Enterprise tier](how-to-enterprise-deploy-static-file.md). |
| 75 | +
|
| 76 | +## Next steps |
| 77 | +
|
| 78 | +- [Troubleshoot common Azure Spring Apps issues](./troubleshoot.md) |
0 commit comments