Container registry support oci artifact #11209

Closed
opened 2025-11-02 09:30:52 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @liangyuanpeng on GitHub (Jul 12, 2023).

Feature Description

I want store my oci artifact with gitea, and seems like it's not support now. Just got the error:

lan@lan:~/tmp/cache$ oras push --plain-http gitea.my/liangyuanpeng/artifacts:rocksdb-20230711 data
Exists    7c7fafabb740 data
Error: PUT "http://gitea.my/v2/liangyuanpeng/artifacts/manifests/rocksdb-20230711": response status code 501: unsupported: Schema version is not supported

here is the spec: https://github.com/opencontainers/image-spec/blob/main/manifest.md#guidelines-for-artifact-usage

Screenshots

No response

Originally created by @liangyuanpeng on GitHub (Jul 12, 2023). ### Feature Description I want store my oci artifact with gitea, and seems like it's not support now. Just got the error: ```shell lan@lan:~/tmp/cache$ oras push --plain-http gitea.my/liangyuanpeng/artifacts:rocksdb-20230711 data Exists 7c7fafabb740 data Error: PUT "http://gitea.my/v2/liangyuanpeng/artifacts/manifests/rocksdb-20230711": response status code 501: unsupported: Schema version is not supported ``` here is the spec: https://github.com/opencontainers/image-spec/blob/main/manifest.md#guidelines-for-artifact-usage ### Screenshots _No response_
GiteaMirror added the topic/packagestype/bug labels 2025-11-02 09:30:52 -06:00
Author
Owner

@kolaente commented on GitHub (Nov 21, 2023):

@liangyuanpeng How did you login with oras? I only get this error message:

$ oras login -u kolaente --password-stdin gitea.my
Error: failed to validate the credentials for gitea.my: GET "https://kolaente.dev/v2/": GET "https://gitea.my/v2/token?scope=%2A&service=container_registry": response status code 401: Unauthorized

EDIT: Looks like this does not work for accounts using 2fa (which makes sense).

@kolaente commented on GitHub (Nov 21, 2023): @liangyuanpeng How did you login with oras? I only get this error message: ``` $ oras login -u kolaente --password-stdin gitea.my Error: failed to validate the credentials for gitea.my: GET "https://kolaente.dev/v2/": GET "https://gitea.my/v2/token?scope=%2A&service=container_registry": response status code 401: Unauthorized ``` EDIT: Looks like this does not work for accounts using 2fa (which makes sense).
Author
Owner

@kolaente commented on GitHub (Nov 21, 2023):

Doing this the first time gave me the following error:

$ oras push \
  kolaente.dev/vikunja/vikunja:artifacthub.io \
  --config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml \
  artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml
Uploading 256cbe0962c2 artifacthub-repo.yml
Uploaded  256cbe0962c2 artifacthub-repo.yml

Error: PUT "https://kolaente.dev/v2/vikunja/vikunja/manifests/artifacthub.io": response status code 500: Internal Server Error

Any attempts after this failed with the following:

Error: HEAD "https://kolaente.dev/v2/vikunja/vikunja/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855": unknown response Content-Length

The logs don't have anything to say about the second error but here's the message from the first:

gitea_1  | 2023/11/21 20:52:54 ...ntainer/container.go:89:apiError() [E] EOF
gitea_1  | 2023/11/21 20:52:54 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /v2/vikunja/vikunja/manifests/artifacthub.io for 172.18.0.2:53508, 500 Internal Server Error in 10.8ms @ container/container.go:516(container.UploadManifest)

(not sure if that's helpful)

@kolaente commented on GitHub (Nov 21, 2023): Doing this the first time gave me the following error: ``` $ oras push \ kolaente.dev/vikunja/vikunja:artifacthub.io \ --config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml \ artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml Uploading 256cbe0962c2 artifacthub-repo.yml Uploaded 256cbe0962c2 artifacthub-repo.yml Error: PUT "https://kolaente.dev/v2/vikunja/vikunja/manifests/artifacthub.io": response status code 500: Internal Server Error ``` Any attempts after this failed with the following: ``` Error: HEAD "https://kolaente.dev/v2/vikunja/vikunja/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855": unknown response Content-Length ``` The logs don't have anything to say about the second error but here's the message from the first: ``` gitea_1 | 2023/11/21 20:52:54 ...ntainer/container.go:89:apiError() [E] EOF gitea_1 | 2023/11/21 20:52:54 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /v2/vikunja/vikunja/manifests/artifacthub.io for 172.18.0.2:53508, 500 Internal Server Error in 10.8ms @ container/container.go:516(container.UploadManifest) ``` (not sure if that's helpful)
Author
Owner

@lunny commented on GitHub (Nov 22, 2023):

@liangyuanpeng How did you login with oras? I only get this error message:

$ oras login -u kolaente --password-stdin gitea.my
Error: failed to validate the credentials for gitea.my: GET "https://kolaente.dev/v2/": GET "https://gitea.my/v2/token?scope=%2A&service=container_registry": response status code 401: Unauthorized

EDIT: Looks like this does not work for accounts using 2fa (which makes sense).

You can try to use a personal token as password.

@lunny commented on GitHub (Nov 22, 2023): > @liangyuanpeng How did you login with oras? I only get this error message: > > ``` > $ oras login -u kolaente --password-stdin gitea.my > Error: failed to validate the credentials for gitea.my: GET "https://kolaente.dev/v2/": GET "https://gitea.my/v2/token?scope=%2A&service=container_registry": response status code 401: Unauthorized > ``` > > EDIT: Looks like this does not work for accounts using 2fa (which makes sense). You can try to use a personal token as password.
Author
Owner

@wrenix commented on GitHub (Nov 6, 2024):

Doing this the first time gave me the following error:

$ oras push \
  kolaente.dev/vikunja/vikunja:artifacthub.io \
  --config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml \
  artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml
Uploading 256cbe0962c2 artifacthub-repo.yml
Uploaded  256cbe0962c2 artifacthub-repo.yml

Error: PUT "https://kolaente.dev/v2/vikunja/vikunja/manifests/artifacthub.io": response status code 500: Internal Server Error

Any attempts after this failed with the following:

Error: HEAD "https://kolaente.dev/v2/vikunja/vikunja/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855": unknown response Content-Length

The logs don't have anything to say about the second error but here's the message from the first:

gitea_1  | 2023/11/21 20:52:54 ...ntainer/container.go:89:apiError() [E] EOF
gitea_1  | 2023/11/21 20:52:54 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /v2/vikunja/vikunja/manifests/artifacthub.io for 172.18.0.2:53508, 500 Internal Server Error in 10.8ms @ container/container.go:516(container.UploadManifest)

(not sure if that's helpful)

same here, any work on this problem?

@wrenix commented on GitHub (Nov 6, 2024): > Doing this the first time gave me the following error: > > ``` > $ oras push \ > kolaente.dev/vikunja/vikunja:artifacthub.io \ > --config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml \ > artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml > Uploading 256cbe0962c2 artifacthub-repo.yml > Uploaded 256cbe0962c2 artifacthub-repo.yml > > Error: PUT "https://kolaente.dev/v2/vikunja/vikunja/manifests/artifacthub.io": response status code 500: Internal Server Error > ``` > > Any attempts after this failed with the following: > > ``` > Error: HEAD "https://kolaente.dev/v2/vikunja/vikunja/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855": unknown response Content-Length > ``` > > The logs don't have anything to say about the second error but here's the message from the first: > > ``` > gitea_1 | 2023/11/21 20:52:54 ...ntainer/container.go:89:apiError() [E] EOF > gitea_1 | 2023/11/21 20:52:54 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /v2/vikunja/vikunja/manifests/artifacthub.io for 172.18.0.2:53508, 500 Internal Server Error in 10.8ms @ container/container.go:516(container.UploadManifest) > ``` > > (not sure if that's helpful) same here, any work on this problem?
Author
Owner

@wxiaoguang commented on GitHub (Jun 9, 2025):

Tested with latest oras 1.2.3 , it succeeds.

Maybe they have fixed their bug? (see below)

Image

@wxiaoguang commented on GitHub (Jun 9, 2025): Tested with latest oras 1.2.3 , it succeeds. ~~Maybe they have fixed their bug?~~ (see below) <details> ![Image](https://github.com/user-attachments/assets/7f6d3da4-826f-4c0d-9e10-bceeb11d00a2) </details>
Author
Owner

@wxiaoguang commented on GitHub (Jun 9, 2025):

Hmm, the problem is like this:

$ touch artifacthub-repo.yml # empty file
$ oras push --plain-http this-docker.internal:3000/root/package:artifacthub.io --config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yml
@wxiaoguang commented on GitHub (Jun 9, 2025): Hmm, the problem is like this: ``` $ touch artifacthub-repo.yml # empty file $ oras push --plain-http this-docker.internal:3000/root/package:artifacthub.io --config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml artifacthub-repo.yml:application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yml ```
Author
Owner

@wxiaoguang commented on GitHub (Jun 9, 2025):

The fix for the Content-Length problem: Fix "oras" OCI client compatibility #34666

The "Schema version is not supported" is another problem, it needs new code to support "schemaVersion": other versions. Actually I don't see why other versions should be supported, spec says "schemaVersion MUST be 2" @liangyuanpeng maybe you can check your Image Manifest to make sure it correctly follows the spec?

@wxiaoguang commented on GitHub (Jun 9, 2025): The fix for the Content-Length problem: Fix "oras" OCI client compatibility #34666 The "Schema version is not supported" is another problem, it needs new code to support `"schemaVersion": other versions`. Actually I don't see why other versions should be supported, spec says "schemaVersion MUST be 2" @liangyuanpeng maybe you can check your Image Manifest to make sure it correctly follows the spec?
Author
Owner

@TheFox0x7 commented on GitHub (Jun 9, 2025):

FYI I tested podman artifact and it works. The description probably could be better but it does work.

podman artifact add --file-type text/graphql localhost:3000/root/testartifact:latest github.graphql
podman artifact push localhost:3000/root/testartifact:latest

Image

@TheFox0x7 commented on GitHub (Jun 9, 2025): FYI I tested podman artifact and it works. The description probably could be better but it does work. ``` podman artifact add --file-type text/graphql localhost:3000/root/testartifact:latest github.graphql podman artifact push localhost:3000/root/testartifact:latest ``` ![Image](https://github.com/user-attachments/assets/dba4cacd-841f-4d09-b376-4a6650b3eb99)
Author
Owner

@wxiaoguang commented on GitHub (Jun 9, 2025):

FYI I tested podman artifact and it works. The description probably could be better but it does work.

Yup, the issue's title is not accurate.

Actually there are 3 problems:

  1. "Schema version is not supported": maybe the author's index manifest doesn't follow the spec, we only support the version 2 as defined in the spec.
  2. "response status code 500: Internal Server Error": it is caused by empty image config
  3. "unknown response Content-Length": it is caused by the missing "Content-Length" header when blob size is 0

"Fix "oras" OCI client compatibility #34666" will fix problem 2 and 3, problem 1 isn't really a problem. So after #34666 gets merged, I think this issue can be closed.

@wxiaoguang commented on GitHub (Jun 9, 2025): > FYI I tested podman artifact and it works. The description probably could be better but it does work. Yup, the issue's title is not accurate. Actually there are 3 problems: 1. "Schema version is not supported": maybe the author's index manifest doesn't follow the spec, we only support the version 2 as defined in the spec. 2. "response status code 500: Internal Server Error": it is caused by empty image config 3. "unknown response Content-Length": it is caused by the missing "Content-Length" header when blob size is 0 "Fix "oras" OCI client compatibility #34666" will fix problem 2 and 3, problem 1 isn't really a problem. So after #34666 gets merged, I think this issue can be closed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11209