mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-19 14:42:41 -05:00
Builtin Container Registry: Manifests 404 Not Found #13397
Closed
opened 2025-11-02 10:41:06 -06:00 by GiteaMirror
·
19 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
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1.4.0-rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#13397
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @fekle on GitHub (Aug 18, 2024).
Description
Hi there!
I'm in the process of migrating from GitLab to Gitea, and so far I'm very happy with Gitea - migration was smooth, and things like Actions work great!
Now I wanted to also use Gitea as my Docker Registry to host my container images, but I'm stuck there. Pushing image layers works fine, but the final manifest push fails with 404. I think this issue is related to existing issues such as #31802 and #31644, but I didn't want to spam those issues.
First of all - to make sure that this is not related to my migrated groups and repositories - I created a new Organization called "test" and a project called "test" in my Gitea instance. I also enabled debug logging.
Then, when I'm trying to push a minimal image from my computer, I get this:
The same thing happens with an Actions workflow and BuildKit.
On the Gitea server side, here are the startup logs:
And this is the output when pushing aforementioned image:
Strangely, I'm seeing
401 Unauthorizederrors there; which I'm not seeing in the Docker client.I am logged into the registry via
docker loginwith my administrator user. I also tried creating a new user, which I added to the aforementionedtestgroup, but the same issue persisted.I also made sure that things like filesystem permissions as well as the reverse proxy configuration are correct.
For some context, here Is my
app.iniThe reverse proxy configuration:
And the
docker composeconfig for Gitea:I'm kind of at a loss here and would be very grateful if anyone could point me in the right direction :-)
Gitea Version
1.22.1
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
2.45.2
Operating System
Docker image:
gitea/gitea:1; Host:Debian 12.6 6.1.0-23-cloud-amd64How are you running Gitea?
Hosting myself, on
Docker 27.0.3behindCaddy v2.8.4.Database
SQLite
@ChristopherHX commented on GitHub (Aug 18, 2024):
Please try
docker build -t GITEA_HOST/test/test:test . --provenance=false, then push.Based on my research this could have to do with build provenance aka https://docs.docker.com/build/attestations/slsa-provenance/.
My docker setup is old and has no containerd image store, therefore is my system probably unaffected as I can push. For me this seems to be turned off by default due to that reason and trying to enable it tells me that my setup cannot attest.
I would try to debug this next week with provenance enabled for a dind container or similar.
maybe I'm on a wrong path here.
@fekle commented on GitHub (Aug 18, 2024):
Thanks for your swift reply!
I just tried building and pushing without provenance, that seems to work, with plain docker at least - thanks!
Pushing with Buildkit via earthly unfortunately still fails, see below.
Gitea log:
Note that the first
HEADrequests still results in 401, do you know what's up with that?That's also what is now breaking my BuildKit/Earthly build:
Also, there is still a 404 error for that manifest endpoint, but the docker client is not complaining anymore - strange.
Please let me know if i can be of any help with debugging this issue further :)
@fekle commented on GitHub (Aug 18, 2024):
I had a look at where the 401 is coming from,
container/container.go:126; thats:As a quick test, i set
REQUIRE_SIGNIN_VIEWtofalsein myapp.ini, restarted Gitea and retried, but i'm still getting the same error with Buildkit - so that's not it. Given that this issue seems to come fromctx.Doer == niland occurs at theHEADrequest, maybe Buildkit is not sending any credentials with that particular request?@ChristopherHX commented on GitHub (Aug 18, 2024):
Are those still have provenance on? I mean it's not unlikely that provenance is not supported yet by the Gitea Container Registry.
See
https://docs.docker.com/build/building/variables/#buildx_no_default_attestations for an env variable.
Pure logical, isn't the 404 here just telling docker that the tag doesn't exist yet
Then docker creates the tag with PUT that returns created. Now I would expect doing this a second time wouldn't result in a 404 before the put
BTW yes I used buildkit to push my image yesterday, no error (what I tested is in discord, between your post and your reply to me)
My Log
@ChristopherHX commented on GitHub (Aug 18, 2024):
Ok I'm out, as I cannot reproduce the issue on my system, provenance push didn't fail for me.
I have created an dind container with containerd image cache and it doesn't fail.
The flag REQUIRE_SIGNIN_VIEW isn't enabled for me, because my ports are not exposed to the www and my reverse proxy configuration is probably totally different.
Maybe someone else can have a look
@fekle commented on GitHub (Aug 18, 2024):
Yes, i used
BUILDX_NO_DEFAULT_ATTESTATIONS=1but could well be that buildkit itself is not picking up that argument, as i'm using a buildkit in my CI; I will have to debug this further. Kinda annoying that BuildKit does not handle this gracefully and just assumes that the registry supports this feature.But the 401 in my log output above is from a
normaldocker push with the--provenance=falsecommand, which seems to ignore the 401 when BuildKit doesn't. Given that there provenance is disabled for sure, that seems to be a different issue.While that would indeed make sense, I don't think that's the case as that still occurs when the image and all layers already exist, and the error in the logs is
container.AuthenticateNotImplemented. Not sure what that is about, but it could be related to the 401s before.@fekle commented on GitHub (Aug 18, 2024):
That's interesting that it doesnt fail for you, so maybe it's something with my configuration. But thank you for your help!
@fekle commented on GitHub (Aug 19, 2024):
Allright, I got pushing in Actions to work.
I was using
to log in to the container registry.
While the login succeeds, pushes fail. When I create a personal access token with access to packages and then use my username as
usernameas well as that token aspassword, I can push.Now, if I want to keep that more secure, I can put that token into a secret - however, given that I can only define secrets per repository and not globally, I'll have to copy that secret definition to every repository that I'm using CI with.
Is there a better way to do this? Researching on Google and so on leads to scattered forum posts from various versions, so I can't seem to find a definitive answer. Coming from GitLab CI, there were 3 auto-generated variables in CI:
CI_REGISTRY,CI_REGISTRY_USER, andCI_REGISTRY_PASSWORD. That made pushing to the built-in registry a breeze; it would be nice if Gitea had something similar - I would think that pushing to the built-in registry is a common action in CI.I'd be happy to write some documentation on that and open a PR once I know the "idiomatic" way to do all of this :)
@shaikzoheb-oi commented on GitHub (Sep 6, 2024):
@fekle In my case, the organisation is "oi" and project is "test". It's a similar use-case like you, where I am trying to use gitea as container registry along with git repo. In my scenario, I've deployed gitea locally and somehow it's failing.
% docker build -t 127.0.0.1:3000/oi/test .
[+] Building 2.1s (5/5) FINISHED docker:desktop-linux
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 61B 0.0s
=> [internal] load metadata for docker.io/library/debian:12 2.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> CACHED [1/1] FROM docker.io/library/debian:12@sha256:b8084b1a576c5504a031936e1132574f4ce1d6cc7130bbcc25a28f074539ae6b 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:0c21f32bd1037ae97c3535bb9c7f15f7ca0f829e5809161f607531c20764b61e 0.0s
=> => naming to 127.0.0.1:3000/oi/test 0.0s
% docker push 127.0.0.1:3000/oi/test:test
The push refers to repository [127.0.0.1:3000/oi/test]
Get "http://127.0.0.1:3000/v2/": dial tcp 127.0.0.1:3000: connect: connection refused
telnet and netcat is working:
nc -zv 127.0.0.1 3000
Connection to 127.0.0.1 port 3000 [tcp/hbci] succeeded!
telnet 127.0.0.1 3000
Trying 127.0.0.1...
Connected to localhost.
@jcjveraa commented on GitHub (Oct 23, 2024):
Exact same issue here. Running the latest official Gitea image via docker. The main git functionality has been working fine for months. The comments above seem to suggest creating a PAT can work, but that didn't do it for me. I created a new PAT, and tried a
docker push. The PAT was used according to the Gitea UI, but still the same output as others see.Then tried a
docker build --provenance=falseimage build, which pushed fine.I had expected this to work somewhat more 'out of the box' as a basic push doesn't seem special.
For reference, output of the failed push below. Again: with
--provenance=falseworked fine. Replaced strings with descriptions for privacy.@lunny commented on GitHub (Oct 23, 2024):
What's your PAT scope?
@jcjveraa commented on GitHub (Oct 24, 2024):
Good point - (non public) packages read & write, I failed to consider a
wider scope but on the flip side thinking about it now I would expect that
to be enough.
Op do 24 okt 2024 om 00:18 schreef Lunny Xiao @.***>
@sbrown61 commented on GitHub (Nov 13, 2024):
I'm having a similar issue with podman push. As far as I know, there is no equivalent for
--provenance=false. Podman version is 5.2.5 and gitea is 1.22.3 (via docker hub):@jymusic0663 commented on GitHub (Nov 23, 2024):
My version is Gitea v1.22.3, previously I used
Docker build - t text: latest .Directly building an AMD64 image can successfully push it up.But after enabling multi platform build,
Docker buildx build -- platform Linux/amd64, Linux/arm64- t test: latest ., the image layer can be uploaded, but the final step is alsofailed commit on ref "index-sha256:8a4a910b69...": unexpected status from PUT request to http://192.168.1.6:8080/v2/my/test/manifests/latest: 404 Not Found@dresber commented on GitHub (Mar 7, 2025):
I have the same issue in v1.23.5. The solution with adding the
--provenance=falsedid help me so far.@mbretter commented on GitHub (Mar 26, 2025):
Same issue here, provenance flag does not help.
While the push works from linux, it fails from macos, same project, same docker versions (28.0.1).
@mbretter commented on GitHub (Mar 26, 2025):
For some reason under macos it did not remember the login, after doing another login before the push, it succeeds, weird.
@R-HNF commented on GitHub (Apr 27, 2025):
I'm experiencing the same issue with image push failures on Docker Desktop for Mac. However, after looking at the following lines, it occurred to me to try specifying only one platform.
533b8b2d3d/routers/api/packages/container/manifest.go (L243-L245)0376c09fc2/routers/api/packages/container/manifest.go (L34-L40)Specifying only one platform allowed me to push successfully.
@wxiaoguang commented on GitHub (Jul 1, 2025):
I think the problem should have been fixed on main branch, feel free to try the nightly build.
If there is still any problem, feel free to reopen and/or provide some reproducible steps.
Thank you all.