Skip to content

Lifecycle exits with generic exitCode "1" when it fails to read/write from registry #1572

Description

@SarthakAjmera26

Summary

If I understand correctly, validation of registry access happens during the analyze phase, which means that Lifecycle should exit with an exitCode ranging between 30 - 39 as per: https://buildpacks.io/docs/for-platform-operators/concepts/lifecycle/analyze/

However lifecycle/creator is throwing a generic exitCode: 1 when it fails to validate registry access.

  1. Is this happening by design, Or a registry validation access failure shall happen with a dedicated exit code?
  2. maybe there should be documentation that maps exit codes against the cause of exit/failure

Reproduction

Steps

one can use lifecycle/creator to build from source code to an image registry (eg: Google Artifacts Registry). To reproduce the failure, ensure that you DO NOT have access to the image registry path you're trying to build on.

Current behavior

These are the logs I see:

Already have image (with digest): europe-west1-docker.pkg.dev/serverless-runtimes/google-24-full/builder/python:python_20251207_RC00 

Warning: No cached data will be used, no cache specified.

 ===> ANALYZING ERROR: 

failed to initialize analyzer: validating registry read access: failed to ensure registry read access to europe-west1-docker.pkg.dev/<REDACTED>: GET https://europe-west1-docker.pkg.dev/v2/token?scope=<REDACTED>=: DENIED: Permission "artifactregistry.repositories.downloadArtifacts" denied on resource <REDACTED> (or it may not exist)

Upon inspecting the container logs, lifecycle exit happens exitCode: 1

Expected behavior

I expected the exitCode to be less generic. I expected it to be in the range of 30 - 39, as per the lifecycle analyze docs


Context

I performed all the builds in Google Cloud Build environment using Google Cloud Buildpacks: europe-west1-docker.pkg.dev/serverless-runtimes/google-24-full/builder/python:latest (Lifecycle 0.20.5 is installed within this builder)

lifecycle version

0.20.5

platform version(s)

0.11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions