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

400 Bad Request - exploding OCI artifact resource blob #1030

Open
hilmarf opened this issue Oct 30, 2024 · 2 comments
Open

400 Bad Request - exploding OCI artifact resource blob #1030

hilmarf opened this issue Oct 30, 2024 · 2 comments
Labels

Comments

@hilmarf
Copy link
Member

hilmarf commented Oct 30, 2024

What happened:

Create the file: docker-hello-tiny.yaml with the following content:

components:
- name: docker.io/recmo/docker-hello-tiny
  version: v1.0
  provider:
    name: recmo
  resources:
  - name: docker-hello-tiny
    version: v1.0
    type: ociImage
    access:
      type: ociArtifact
      imageReference: docker.io/recmo/docker-hello-tiny:latest

Then execute the two ocm commands:

ocm add componentversions --create --file docker-hello-tiny docker-hello-tiny.yaml
ocm transfer componentversions --copy-resources docker-hello-tiny 371000008081-20241028-09281372-787.staging-dev.repositories.cloud.sap --uploader 'ocm/ociArtifacts={"ociRef":"371000008081-20241028-09281372-787.staging-dev.repositories.cloud.sap/images"}'

Which fails with:

 2024-10-30T16:49:17+01:00 info    [ocm/transfer] "transferring version" history= version=docker.io/recmo/docker-hello-tiny:v1.0
transferring version "docker.io/recmo/docker-hello-tiny:v1.0"...
 2024-10-30T16:49:17+01:00 debug   [ocm] "get artifact" ref=371000008081-20241028-09281372-787.staging-dev.repositories.cloud.sap/component-descriptors/docker.io/recmo/docker-hello-tiny:v1.0
 2024-10-30T16:49:17+01:00 debug   [ocm] done digest= error=0xc001bc7560 mimetype= size=0
 2024-10-30T16:49:17+01:00 debug   [ocm] "get artifact" ref=371000008081-20241028-09281372-787.staging-dev.repositories.cloud.sap/component-descriptors/docker.io/recmo/docker-hello-tiny:v1.0
 2024-10-30T16:49:17+01:00 debug   [ocm] done digest= error=0xc001bc7d80 mimetype= size=0
 2024-10-30T16:49:17+01:00 info    [ocm/transfer] "  transferring references" history= version=docker.io/recmo/docker-hello-tiny:v1.0
 2024-10-30T16:49:17+01:00 info    [ocm/transfer] "  transferring resources" history= version=docker.io/recmo/docker-hello-tiny:v1.0
...resource 0 docker-hello-tiny[ociImage](recmo/docker-hello-tiny:latest)...
 2024-10-30T16:49:17+01:00 debug   [ocm/transfer] "handle artifact" hint=recmo/docker-hello-tiny:latest history= index=0 kind=resource message=copying name=docker-hello-tiny type=ociImage version=docker.io/recmo/docker-hello-tiny:v1.0
 2024-10-30T16:49:17+01:00 debug   [ocm] "get artifact" ref=docker.io/recmo/docker-hello-tiny:latest
 2024-10-30T16:49:18+01:00 debug   [ocm] done digest=sha256:c6be339a02a039f6ceac6b749568a2b4e76c619a2827e11b46da8745e72cd7af error=<nil> mimetype=application/vnd.docker.distribution.manifest.v2+json size=524
 2024-10-30T16:49:21+01:00 debug   [ocm] "adding resource blob" resource=docker-hello-tiny
 2024-10-30T16:49:21+01:00 debug   [ocm] "oci artifact handler with ocm access source" arttype=ociImage hint=recmo/docker-hello-tiny:latest mediatype=application/vnd.docker.distribution.manifest.v2+tar+gzip sourcetype=ociArtifact
 2024-10-30T16:49:21+01:00 debug   [ocm] "namespace derived from hint"
 2024-10-30T16:49:21+01:00 debug   [ocm] "using direct transfer mode"
 2024-10-30T16:49:21+01:00 debug   [ocm] "getting blob" digest=sha256:c93077c36ce03e2df1dee18d2e8eab299a184585d9571ae5dd994c4d64d824b6
 2024-10-30T16:49:21+01:00 debug   [ocm] "getting blob done" digest=sha256:c93077c36ce03e2df1dee18d2e8eab299a184585d9571ae5dd994c4d64d824b6 error=<nil> size=-1
 2024-10-30T16:49:21+01:00 debug   [ocm] "adding blob" digest=sha256:c93077c36ce03e2df1dee18d2e8eab299a184585d9571ae5dd994c4d64d824b6
 2024-10-30T16:49:22+01:00 debug   [ocm] "adding blob failed" digest=sha256:c93077c36ce03e2df1dee18d2e8eab299a184585d9571ae5dd994c4d64d824b6 error="unexpected status from PUT request to https://371000008081-20241028-09281372-787.staging-dev.repositories.cloud.sap/v2/recmo/docker-hello-tiny/blobs/uploads/238038ec-bd05-46b2-a52e-4dffdf87ea7a?digest=sha256%3Ac93077c36ce03e2df1dee18d2e8eab299a184585d9571ae5dd994c4d64d824b6: 400 Bad Request"
Error: docker.io/recmo/docker-hello-tiny:v1.0: transferring resource 0: unable to add blob (component docker.io/recmo/docker-hello-tiny:v1.0 resource docker-hello-tiny): exploding OCI artifact resource blob ([recmo/docker-hello-tiny:latest] namespace recmo/docker-hello-tiny: transfer artifact): transferring config blob: unable to add blob (OCI repository recmo/docker-hello-tiny): unexpected status from PUT request to https://371000008081-20241028-09281372-787.staging-dev.repositories.cloud.sap/v2/recmo/docker-hello-tiny/blobs/uploads/238038ec-bd05-46b2-a52e-4dffdf87ea7a?digest=sha256%3Ac93077c36ce03e2df1dee18d2e8eab299a184585d9571ae5dd994c4d64d824b6: 400 Bad Request
1 versions transferred
Error: transfer finished with 1 error(s)
Error summary:
- docker.io/recmo/docker-hello-tiny:v1.0: transferring resource 0: unable to add blob (component docker.io/recmo/docker-hello-tiny:v1.0 resource docker-hello-tiny): exploding OCI artifact resource blob ([recmo/docker-hello-tiny:latest] namespace recmo/docker-hello-tiny: transfer artifact): transferring config blob: unable to add blob (OCI repository recmo/docker-hello-tiny): unexpected status from PUT request to https://371000008081-20241028-09281372-787.staging-dev.repositories.cloud.sap/v2/recmo/docker-hello-tiny/blobs/uploads/238038ec-bd05-46b2-a52e-4dffdf87ea7a?digest=sha256%3Ac93077c36ce03e2df1dee18d2e8eab299a184585d9571ae5dd994c4d64d824b6: 400 Bad Request

What you expected to happen:

The image gets pushed to the target repository.

How to reproduce it (as minimally and precisely as possible):

See above.

Anything else we need to know:

Credentials are required for the target repo.

@hilmarf hilmarf added the kind/bug Bug label Oct 30, 2024
@github-actions github-actions bot added the area/ipcei IPCEI-CIS label Oct 30, 2024
@jakobmoellerdev
Copy link
Contributor

I suggest we add more debug information on request details, since 400 alone in this case is not enough to reproduce.

@hilmarf
Copy link
Member Author

hilmarf commented Nov 4, 2024

Splunk logs:

2024-10-31 16:58:44,005+0000 ERROR [qtp484873981-164794] 82H0IcZ3lgEQqEc org.sonatype.nexus.repository.docker.internal.datastore.recipe.V2ManifestUtilImpl - Manifest refers to missing layer: sha256:d885d6fb90c93e34fdea6255c91d2506151d3b703a5589df548889550e298fc6 for: staging-validation/null in repository RepositoryImpl$$EnhancerByGuice$$2474c678{type=hosted, format=docker, name='371000008081-20241031-163831665-992'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🆕 ToDo
Development

No branches or pull requests

2 participants