Troubleshoot common build issues in Azure Spring Apps

Note

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.

This article applies to: ❌ Basic/Standard tier ✔️ Enterprise tier

This article describes how to troubleshoot build issues with your Azure Spring Apps deployment.

Build exit codes

Azure Spring Apps Enterprise tier uses Tanzu Buildpacks to transform your application source code into images. For more information, see Tanzu Buildpacks.

When you deploy your app in Azure Spring Apps using the 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.

The following list describes some common exit codes:

  • 20 - All buildpack groups have failed to detect.

    Consider the following possible causes of an exit code of 20:

    • The builder you're using doesn't support the language your project used.

      If you're using the default builder, check the language the default builder supports. For more information, see the Use the default builder to deploy an app section of Use Tanzu Build Service.

      If you're using the custom builder, check whether your custom builder's buildpack supports the language your project used.

    • You're running against the wrong path; for example, your Maven project's pom.xml file isn't in the root path.

      Set BP_MAVEN_POM_FILE to specify the location of the project's pom.xml file.

    • 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.

  • 51 - Buildpack build error.

    Consider the following possible causes of an exit code of 51:

    • 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.

      Use the following command to increase memory using the build-memory environment variable:

      az spring app deploy \
          --resource-group <your-resource-group-name> \
          --service <your-Azure-Spring-Apps-name> \
          --name <your-app-name> \
          --build-memory 3Gi
      
    • The build failed because of an application source code error; for example, there's a compilation error in your source code.

      Check the build log to find the root cause.

    • The build failed because of a download dependency error; for example, a network issue caused the Maven dependency download to fail.

  • 62 - Failed to write image to Azure Container Registry.

    Consider the following possible cause of an exit code of 62:

    • 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.

      Retry to fix the issue.

If your application is a static file or dynamic front-end application served by a web server, see the Common build and deployment errors section of Deploy web static files.

Next steps