Skip to content

error while downloading schema - received HTTP status 429 - for schema available locally #329

Description

@dobesv

Recently we have started to get failures running kubeconform in our automated builds. We get errors like:

error while downloading schema at https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.30.11-standalone-strict/sealedsecret-bitnami-v1alpha1.json - received HTTP status 429

Perhaps github added some new rate limiting logic, I'm not sure why this started failing after it worked for many months.

I tried turning on the cache feature using -cache but it seems like kubeconform might be hitting the server anyway even if we have a file in the cache (maybe validating the cache using ETag / Last-Modified ?).

We actually have all that schemas in a local folder so we don't even need or want to download them from github. It looks like I am able to workaround this by changing the order of the -schema-location arguments to pass default after the local repo.

I do wonder, though, if kubeconform should handle 429 gracefully. I suspect that it is handling status 404/403 for these files by falling back on the additional -schema-location we provide, but with 429 it is hard failing. It could try to use a cached version if found, or wait and retry (although I'm not sure how long it would have to wait for these not found rate limited responses).

Related - could/should the cache remember the 404 response from prior attempts and not try to download for a period of time? That might also help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions