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

Unable to upload completely empty config #21018

Open
cbandy opened this issue Oct 9, 2024 · 3 comments
Open

Unable to upload completely empty config #21018

cbandy opened this issue Oct 9, 2024 · 3 comments
Assignees
Labels
more-info-needed The issue author need to provide more details and context to the issue

Comments

@cbandy
Copy link

cbandy commented Oct 9, 2024

Expected behavior and actual behavior:

The ghcr.io/aquasecurity/trivy-checks:1.0.1 OCI manifest has a "size":0 config. When I try to upload or replicate it to Harbor, I see an EOF error in the logs and an "internal server error" at the client.

Steps to reproduce the problem:

$ oras cp ghcr.io/aquasecurity/trivy-checks:1.0.1 harbor/trivy/trivy-checks:1.0.1
✓ Exists  application/vnd.cncf.openpolicyagent.config.v1+json
  └─ sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
✓ Exists  bundle.tar.gz
  └─ sha256:cb4bdb5f977a22c8d8ea74dca4feaed6545857543022f08b3e53ac1f55d0e54b
⠦ [                    ](   0  B/s) Copying application/vnd.oci.image.manifest.v1+json
  └─ sha256:d135a270127311dad0790b337cd546a4321bb3b540cb42dec24c98644d526b69
Error response from registry: unknown: internal server error

$ oras cp --debug ghcr.io/aquasecurity/trivy-checks:1.0.1 harbor/trivy/trivy-checks:1.0.1

DEBU[0000] Request #8
> Request URL: "https://harbor/v2/trivy/trivy-checks/manifests/1.0.1"
> Request method: "PUT"
> Request headers:
   "Content-Type": "application/vnd.oci.image.manifest.v1+json"
   "Authorization": "*****"
   "User-Agent": "oras/1.2.0+Homebrew"
DEBU[0010] Response #8
< Response Status: "500 Internal Server Error"
< Response headers:
   "Set-Cookie": "*****"
   "Content-Type": "application/json; charset=utf-8"
   "Content-Length": "66"
Error response from registry: unknown: internal server error

Versions:
Please specify the versions of following systems.

  • harbor version: [2.11.1] Version v2.11.1-6b7ecba1

Additional context:

  • Harbor config files: You can get them by packaging harbor.yml and files in the same directory, including subdirectory.
  • Log files: You can get them by package the /var/log/harbor/ .
2024-10-09T15:00:43Z [DEBUG] [/server/middleware/log/log.go:31]: attach request id 7cad543b-0acf-4b6f-96b0-73b7f105defa to the logger for the request PUT /v2/trivy/trivy-checks/manifests/latest
2024-10-09T15:00:43Z [DEBUG] [/server/middleware/artifactinfo/artifact_info.go:55]: In artifact info middleware, url: /v2/trivy/trivy-checks/manifests/latest
2024-10-09T15:00:43Z [DEBUG] [/server/middleware/immutable/pushmf.go:65]: failed to list artifact, repository trivy/trivy-checks not found
2024-10-09T15:00:43Z [DEBUG] [/controller/artifact/processor/processor.go:69]: the processor for media type application/vnd.cncf.openpolicyagent.config.v1+json not found, use the default one
2024-10-09T15:00:43Z [ERROR] [/lib/http/error.go:57]: {"errors":[{"code":"UNKNOWN","message":"unknown: EOF"}]}
$ oras manifest fetch ghcr.io/aquasecurity/trivy-checks:1.0.1 | jq
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "config": {
    "mediaType": "application/vnd.cncf.openpolicyagent.config.v1+json",
    "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "size": 0
  },
  "layers": [
    {
      "mediaType": "application/vnd.cncf.openpolicyagent.layer.v1.tar+gzip",
      "digest": "sha256:cb4bdb5f977a22c8d8ea74dca4feaed6545857543022f08b3e53ac1f55d0e54b",
      "size": 158487,
      "annotations": {
        "org.opencontainers.image.title": "bundle.tar.gz"
      }
    }
  ],
  "annotations": {
    "org.opencontainers.image.created": "2024-09-03T23:26:53Z"
  }
}
@cbandy cbandy changed the title Unabled to upload completely empty config Unable to upload completely empty config Oct 9, 2024
@wy65701436
Copy link
Contributor

can you enable the debug parameter for oras when issuing the command?

@wy65701436 wy65701436 self-assigned this Oct 10, 2024
@cbandy
Copy link
Author

cbandy commented Oct 10, 2024

can you enable the debug parameter for oras when issuing the command?

Yes. That is part of what I pasted above. All the blobs are sent and accepted. Only the PUT of the manifest fails.

@Vad1mo Vad1mo added the more-info-needed The issue author need to provide more details and context to the issue label Oct 10, 2024
@wy65701436
Copy link
Contributor

can you also provide the registry.log as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-info-needed The issue author need to provide more details and context to the issue
Projects
None yet
Development

No branches or pull requests

3 participants