Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 11 of 22

Re: Pushing docker image to GPR: manifest invalid: Only schema version 2 is supported

A related question: if the space is limited, can we automatically remove old images via some command/API?

Pilot Lvl 1
Message 12 of 22

Re: Pushing docker image to GPR: manifest invalid: Only schema version 2 is supported

Yes we can, I already have a work in progress action to remove package versions: https://github.com/WyriHaximus/github-action-delete-package

 

Which is based on this bit of documentation: https://help.github.com/en/github/managing-packages-with-github-packages/deleting-a-package#deleting...

 

The thing is I'm trying to get the list of this packages with this GraphQL query but it's giving me an unexpected not found error:

query {
  repository(owner:"OWNER", name:"REPOSITORY") {
    registryPackages(last:20) {
      edges {
        node {
          id,
          name
        }
      }
    } 
  }
}

Glueing these two together and get them to work should make you able to delete old docker image tags.

Copilot Lvl 3
Message 13 of 22

Re: Pushing docker image to GPR: manifest invalid: Only schema version 2 is supported

UPDATE: When we increased our total quota for the registry the action started working.

 

Also looking into that delete API, but we have a different approach because we don't want to delete last n, we want to delete all images related to a tag too. Pretty simple to call the API once you get your head around it.

 

I find compounding actions with `uses` increases the total run time (have to download the image and run it), so unless the task is complex, it's better to add a script/step to do it IMO. Also the least dependencies the better.

Solution
Copilot Lvl 3
Message 14 of 22

Re: Pushing docker image to GPR: manifest invalid: Only schema version 2 is supported

I might be stating things that people already know, But talking to github support they advised that the default storage for Github team is: 

 

GitHub Team
- Storage: 2GB
- Data Transfer: 10GB

 

Also that the organisation storage can be checked by viewing: https://github.com/organizations/ORG/settings/billing

 

The following works for me, to list versions of packages on a project.

 

curl -X POST \
    -H "Accept: application/vnd.github.package-deletes-preview+json" \
    -H "Authorization: bearer TOKEN" \
    -d '{"query":"query {repository(owner:\"ORG\", name:\"REPOSITORY\") {registryPackages(last:20) {edges{node{id, name, versions(last:20){edges {node {id}}}}}}}}"}' \
    https://api.github.com/graphql
Copilot Lvl 3
Message 15 of 22

Re: Pushing docker image to GPR: manifest invalid: Only schema version 2 is supported

One thing you have to be careful with, we just discovered, is not deleting all the versions for a package; Github at that point will prevent you from publishing any version under that name and will return this error:

 

blob upload invalid: Docker image with name "<image name>" is already associated with another repository under owner "<account>"

 

Still waiting for an answer from support to understand how to fix it.

 

Ground Controller Lvl 1
Message 16 of 22

Re: Pushing docker image to GPR: manifest invalid: Only schema version 2 is supported

Any update from support on this error?

Ground Controller Lvl 1
Message 17 of 22

Re: Pushing docker image to GPR: manifest invalid: Only schema version 2 is supported

Did you ever get an answer? I am having the exact same problem now.

Copilot Lvl 2
Message 18 of 22

Re: Pushing docker image to GPR: manifest invalid: Only schema version 2 is supported

I'm experiencing the same issue now, were you able to find a solution?

Pilot Lvl 1
Message 19 of 22

Re: Pushing docker image to GPR: manifest invalid: Only schema version 2 is supported

@thepont Yeah that fixes it. Would be nice to get a more descriptive error message in the long run tbh. Thank you for fixing the GraphQL query as well, they will get me to something working this weekend 🎉.

 

@aledalgrande That's good to know! Wanted to do a latest tag for master builds and SHA or tag title for tagged releases, but sounds like the latest tag for master builds isn't an option then :(. The reason I'm also doing an Action is to both give back and make it easier to compose actions between my projects. I'm intending to build an auto clean up of old image tags that aren't relevant anymore but are still taking up space. (Also where I can I'm building Actions directly on alpine with a quick package install keeping that build time as low as possible.)

 

@thepont @aledalgrande Thank you both for all the help on this. I've accepted @thepont's post because it's a nice concise summary, but want to let you know you both been very helpful 👍.

Copilot Lvl 2
Message 20 of 22

Re: Pushing docker image to GPR: manifest invalid: Only schema version 2 is supported

How did any of you delete a docker package?
when i try to do so, it sez. "Version deletion is currently unsupported for docker"