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

crane: validate fails with invalid header message on image with uncompressed layers mediaType #1826

Closed
jabrown85 opened this issue Oct 27, 2023 · 1 comment · May be fixed by #1866
Closed
Labels
bug Something isn't working lifecycle/stale

Comments

@jabrown85
Copy link

Describe the bug

crane validate fails on an image that appears valid.

To Reproduce

I've put up a sample image on dockerhub.

crane validate --remote jabrown85/crane-validate-failure 

Expected behavior

I expect crane validate to pass without error.

Additional context

crane output is an invalid header error.

$ crane validate --remote jabrown85/crane-validate-failure
FAIL: jabrown85/crane-validate-failure: validating layers: gzip: invalid header
Error: validating layers: gzip: invalid header

The image runs fine (busybox)

$ docker run -it jabrown85/crane-validate-failure
/ # exit 0

I believe the issue is the manifest looks like this. The base layer is gzipped but other layers are not.

$ crane manifest jabrown85/crane-validate-failure | jq
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  "config": {
    "mediaType": "application/vnd.docker.container.image.v1+json",
    "digest": "sha256:65989925e192fceef77b2f6a18901cbb0fdc52783e4890e05726bb6c183a480a",
    "size": 625
  },
  "layers": [
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "digest": "sha256:90e01955edcd85dac7985b72a8374545eac617ccdddcc992b732e43cd42534af",
      "size": 727978
    },
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar",
      "digest": "sha256:aa94aec5af6b55423b52074e5223d6bee9896a45558fc2307aceaccac371e476",
      "size": 2048
    },
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar",
      "digest": "sha256:7f194e7fb955ec2e1a0ba1a010faf25a202973ca686226a7482a5847e45a1f1b",
      "size": 2048
    }
  ]
}

Another important detail is I'm using Docker Desktop for Mac with the beta containerd storage system. I believe the storage system change is leading to this mixed situation in imgutil, but mixing seems valid.

  • Output of crane version
$ crane version
0.16.1
  • Registry used (e.g., GCR, ECR, Quay)
    hub.docker.com
@jabrown85 jabrown85 added the bug Something isn't working label Oct 27, 2023
nmiyake added a commit to nmiyake/go-containerregistry that referenced this issue Jan 19, 2024
nmiyake added a commit to nmiyake/go-containerregistry that referenced this issue Jan 19, 2024
nmiyake added a commit to nmiyake/go-containerregistry that referenced this issue Jan 20, 2024
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Keep fresh with the 'lifecycle/frozen' label.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lifecycle/stale
Projects
None yet
1 participant