lifecycle icon indicating copy to clipboard operation
lifecycle copied to clipboard

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

Open SarthakAjmera26 opened this issue 4 weeks ago • 0 comments

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.

Is this happening by design? Or a registry validation access failure shall happen with a dedicated exit code?


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 am a developer with Google. 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 version

0.20.5

platform version(s)

0.11

SarthakAjmera26 avatar Dec 17 '25 10:12 SarthakAjmera26