Search code examples
google-cloud-platformgcloudgoogle-cloud-build

GCloud Build Failure: ERROR: failed to initialize analyzer, No such object


My most recent builds with GCloud all started failing recently and I am not really sure why. I keep getting 404 errors from the build attempting to find an image that doesn't exist.

Sample error:

Already have image (with digest): us.gcr.io/gae-runtimes/buildpacks/google-gae-22/python/builder:python_20230925_RC00
===> ANALYZING
ERROR: failed to initialize analyzer: getting previous image: getting config file for image "us.gcr.io/growth-ops-apps/app-engine-tmp/app/default/ttl-18h:latest": GET https://storage.googleapis.com/us.artifacts.growth-ops-apps.appspot.com/containers/images/sha256:d13213796512322314e6db634cc57318665191dc5437c121f151cb33310c552e?access_token=REDACTED: unexpected status code 404 Not Found: <?xml version='1.0' encoding='UTF-8'?><Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Details>No such object: us.artifacts.growth-ops-apps.appspot.com/containers/images/sha256:d13213796512322314e6db634cc57318665191dc5437c121f151cb33310c552e</Details></Error>

I can verify that the bucket us.artifacts.growth-ops-apps.appspot.com is empty in the console, but I have no idea why. There is no bucket retention policy or anything I can see that is obvious to me.

For reference, I have a single GitHub repository set to trigger builds to 2 separate projects, one for development and one for production. Only the production one is failing in this way.

I am using a cloudbuild.yaml file stored in the repository.

Any ideas?


Solution

  • I figured it out! In thinking through one of my own comments, the build is looking for an artifact that doesn't exist, I figured there must be some way of forcing a new build. I found the --no-cache flag in the docs, which forced a brand new build instead of attempting to use information from a non-existent prior build.