registry-image-resource icon indicating copy to clipboard operation
registry-image-resource copied to clipboard

Using `put` sometimes causes a Concourse job to fail due to the `get` task after pushing an image

Open jonnydawg opened this issue 4 years ago • 4 comments

I'm seeing an error like this sometimes when a Concourse worker runs a job that uses registry-image as a type.

fetching <repository>@sha256:<XXXXXXXXXXXXXXXXX>
ERRO[0000] fetching origin <image> failed: locate remote image: GET <repository>@sha256:<XXXXXXXXXXXXXXXXX>: NOT_FOUND: artifact <repository>@sha256:<XXXXXXXXXXXXXXXXX> not found 

Here is an example of what we are using:

- name: resource-name
  type: registry-image
  source:
    repository: <repository>
- put: resource-name

The image pushing will work successfully, but the secondary task of get when it pulls the image will fail randomly.

Is there a workaround for this? Is it possible to disable the get that runs after the put task or to demand a sleep delay for the get task?

jonnydawg avatar May 06 '21 03:05 jonnydawg

What type of registry is it pushing it to? Is it eventually consistent or something? Maybe get needs retry logic?

Is it possible to disable the get that runs after the put task or to demand a sleep delay for the get task?

Not currently possible, but will be possible in the future with resource prototypes (concourse/rfcs#38).

vito avatar May 06 '21 14:05 vito

We are hitting this in our pipelines as well (time wasted while getting the image). To work around this, do we explicitly upload the built image in a separate script?

jutkko avatar Jun 02 '21 05:06 jutkko

workaround is to set in your put step skip_download flag described here https://concourse-ci.org/put-step.html#schema.put.get_params

l00zak avatar Sep 16 '22 13:09 l00zak

This is excellent, but what is the purpose of the implicit image fetch after the put? Seems odd to have this as a default behaviour?

ericb-summit avatar Nov 23 '22 16:11 ericb-summit