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

unsupported MediaType error for images from quay.io repository #14

Open
yuripastushenko opened this issue Jul 13, 2020 · 6 comments
Open

Comments

@yuripastushenko
Copy link
Contributor

yuripastushenko commented Jul 13, 2020

Hello!
We installed k8s-image-availability-exporter in our cluster.
For some images, that can be successfully pulled from registry, the application throws errors like:

time="2020-07-13T12:27:05Z" level=error msg="unsupported MediaType: \"application/vnd.docker.distribution.manifest.v1+prettyjws\", see https://github.com/google/go-containerregistry/issues/377" availability_mode=registry_v1_api_not_supported image_name="quay.io/thanos/thanos:v0.8.1"

From related issue - seems this is a problem in interaction between go-containerregistry library and quay.io
Can you suggest any workaround for this problem?

@yuripastushenko yuripastushenko changed the title unsupported MediaType error unsupported MediaType error for images from quay.io repository Jul 13, 2020
@yuripastushenko
Copy link
Contributor Author

yuripastushenko commented Jul 13, 2020

If the problem can't be fixed on k8s-image-availability-exporter side, can we add some configurable options to application that can exclude some registries from querying?
Or better - add label repository in metrics.
In our case it value will be quay.io for quay.io/thanos/thanos:v0.8.1.
If the metrics will have this label - users will be able to create queries, that exclude alerts from particular registries in prometheus rules for alert manager.

@yuripastushenko
Copy link
Contributor Author

I found a workaround.
In prometheus rule you can exclude from alerts images starting with quay.io using regexp in expression like:

max by (namespace, cronjob, container, image) (
          k8s_image_availability_exporter_cronjob_available{image!~"quay.io.*"} == 0
        )

@zuzzas
Copy link
Contributor

zuzzas commented Jul 19, 2020

@yuripastushenko
Are you using the latest v0.1.13 image? This has been fixed for a long time.

@yuripastushenko
Copy link
Contributor Author

yuripastushenko commented Jul 21, 2020

We are using image flant/k8s-image-availability-exporter:v0.1.5.
I will try to update.

@drahnr
Copy link

drahnr commented Mar 23, 2021

This still happens when pulling from quay-io with old images, i.e. a 3 year old container https://quay.io/repository/ratpoison/oregano-test-ubuntu/build/a0c3d2fe-3873-4fab-8f37-caf8cf77a7e3 yields the error, a recently created does not.

@nabokihms
Copy link
Member

The problem is somewhere in the underlying lib we are using - go-containerregistry. This likely happens because of the outdated version of the image manifest, e.g., v1. If there is someone still facing the problem, could you ping me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants