Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check returns version without digest #327

Open
xtremerui opened this issue Nov 17, 2022 · 7 comments · Fixed by #328
Open

Check returns version without digest #327

xtremerui opened this issue Nov 17, 2022 · 7 comments · Fixed by #328
Labels
bug Something isn't working

Comments

@xtremerui
Copy link
Contributor

xtremerui commented Nov 17, 2022

This behaviour has being only found in some resources with type registry-image-resource accross production CI. Could be a glitch of docker API when check querying for version info. When there is newer version other than this problematic one available, the check will work again most likely.

Screen Shot 2022-11-16 at 9 27 18 PM

And when this happens, the get step of this resource will fail by error

selected worker: ci-workers-worker-2
fetching aquasec/trivy@
ERRO[0000] download failed: get image: GET https://index.docker.io/v2/aquasec/trivy/manifests/: unexpected status code 404 Not Found: 404 page not found 

since no digest was provided for the GET request.

The temp workaround is to disable that bad version and rerun the build OR switching to docker-image resource.

@xtremerui xtremerui added the bug Something isn't working label Nov 17, 2022
@xtremerui
Copy link
Contributor Author

Further observation is this could also affect a resource type or image resoure that with type to be registry-image-resource. When the check again returns a version without digest, for any step that runs on the image, it will errored by

image fetching failed

when the step is trying to initilize the container by first pulling the base image for it.

@ramonskie
Copy link

ramonskie commented Nov 17, 2022

im experiening the same problem since yesterday
the pipeline has not been updated in a while so it seems a change within docker.io

- name: metalink-repository
  source:
    repository: dpb587/metalink-repository-resource
  type: registry-image

the following error i get at the get step

fetching dpb587/metalink-repository-resource@
ERRO[0000] download failed: get image: GET https://index.docker.io/v2/dpb587/metalink-repository-resource/manifests/: unexpected status code 404 Not Found: 404 page not found 

the suggested workaround to move to docker-image works

ramonskie added a commit to cloudfoundry/bosh-stemcells-ci that referenced this issue Nov 17, 2022
@FelixMarxIBM
Copy link

FelixMarxIBM commented Nov 17, 2022

We noticed the same issue in our environment and this only happened if no tag is present as some of our resources still worked

Doesn't work and shows the same issue

resource_types:
  - name: google-cloud-storage
    type: registry-image
    source:
      repository: frodenas/gcs-resource

However the following resource type does work and is able to pull the latest tag.
This means that the tag is not optional anymore when used with registry-image.

resource_types:
  - name: google-cloud-storage
    type: registry-image
    source:
      repository: frodenas/gcs-resource
      tag: latest

@xtremerui
Copy link
Contributor Author

xtremerui commented Nov 17, 2022

thx for the update. there is potential some logic diff for querying docker with or without tag. I will look into it.

@jpalermo
Copy link

Here's a sql query to find any resource config versions with a blank digest. We found ~10 of them in our instance:

select * from resource_config_versions where version @> '{"digest": ""}'

@xtremerui
Copy link
Contributor Author

xtremerui commented Nov 24, 2022

Based on @jpalermo 's comment, if your custom resource type or image resource that based on registry-image-resource encounter this problem, you can do

delete from resource_config_versions where version @> '{"digest": ""}'

to clear those invalid versions. After this build should be running as usual.

@konrad-o
Copy link

konrad-o commented Dec 2, 2022

We're experiencing similar error in our pipeline since around 19th-22nd Nov and I can confirm that @FelixMarxIBM solution works.
Error we were getting was

ERRO[0000] download failed: get image: GET https://index.docker.io/v2/aoldershaw/git-branches-resource/manifests/: unexpected status code 404 Not Found: 404 page not found 

I also opened an issue on dockerhub side.
docker/hub-feedback#2292

beeender added a commit to greenplum-db/GreenplumPython-archive that referenced this issue Jan 6, 2023
registry-image will cost less.
Add latest tag to work around the issue with
concourse/registry-image-resource#327 (comment)
beeender added a commit to greenplum-db/GreenplumPython-archive that referenced this issue Jan 6, 2023
registry-image will cost less.
Add latest tag to work around the issue with

concourse/registry-image-resource#327 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants