Description
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:
> cat Dockerfile
FROM debian:12
CMD bash
> docker build -t GITEA_HOST/test/test:test .
[+] Building 1.1s (5/5) FINISHED
=> [internal] load build definition from Dockerfile
[...]
=> => naming to GITEA_HOST/test/test:test
=> => unpacking to GITEA_HOST/test/test:test
> docker push GITEA_HOST/test/test:test
The push refers to repository [GITEA_HOST/test/test]
7a351543ef85: Pushed
7b24851aa36d: Pushed
failed commit on ref "index-sha256:[...]": unexpected status from PUT request to https://GITEA_HOST/v2/test/test/manifests/test: 404 Not Found
The same thing happens with an Actions workflow and BuildKit.
On the Gitea server side, here are the startup logs:
Server listening on :: port 22.
Server listening on 0.0.0.0 port 22.
2024/08/18 11:33:09 cmd/web.go:242:runWeb() [I] Starting Gitea on PID: 19
2024/08/18 11:33:09 cmd/web.go:111:showWebStartupMessage() [I] Gitea version: 1.22.1 built with GNU Make 4.4.1, go1.22.5 : bindata, timetzdata, sqlite, sqlite_unlock_notify
[...]
2024/08/18 11:33:09 cmd/web.go:304:listen() [I] Listen: http://0.0.0.0:3000
2024/08/18 11:33:09 cmd/web.go:308:listen() [I] AppURL(ROOT_URL): https://GITEA_HOST/
2024/08/18 11:33:09 cmd/web.go:311:listen() [I] LFS server enabled
2024/08/18 11:33:09 ...s/graceful/server.go:50:NewServer() [I] Starting new Web server: tcp:0.0.0.0:3000 on PID: 19
2024/08/18 11:33:09 ...s/graceful/server.go:63:func1() [D] Starting server on tcp:0.0.0.0:3000 (PID: 19)
And this is the output when pushing aforementioned image:
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed HEAD /v2/test/test/blobs/sha256:[...] for REDACTED:0, 401 Unauthorized in 0.1ms @ container/container.go:126(container.ReqContainerAccess)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed HEAD /v2/test/test/blobs/sha256:[...] for REDACTED:0, 401 Unauthorized in 0.1ms @ container/container.go:126(container.ReqContainerAccess)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed HEAD /v2/test/test/blobs/sha256:[...] for REDACTED:0, 401 Unauthorized in 0.1ms @ container/container.go:126(container.ReqContainerAccess)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed HEAD /v2/test/test/blobs/sha256:[...] for REDACTED:0, 401 Unauthorized in 0.0ms @ container/container.go:126(container.ReqContainerAccess)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed POST /v2/token for REDACTED:0, 404 Not Found in 0.0ms @ container/container.go:172(container.AuthenticateNotImplemented)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed GET /v2/token?scope=%2A&scope=repository%3Atest%2Ftest%3Apull%2Cpush&service=container_registry for REDACTED:0, 200 OK in 35.2ms @ container/container.go:149(container.Authenticate)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed HEAD /v2/test/test/blobs/sha256:[...] for REDACTED:0, 404 Not Found in 1.6ms @ container/container.go:486(container.HeadBlob)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed HEAD /v2/test/test/blobs/sha256:[...] for REDACTED:0, 404 Not Found in 1.7ms @ container/container.go:486(container.HeadBlob)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed HEAD /v2/test/test/blobs/sha256:[...] for REDACTED:0, 404 Not Found in 2.1ms @ container/container.go:486(container.HeadBlob)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed HEAD /v2/test/test/blobs/sha256:[...] for REDACTED:0, 404 Not Found in 2.1ms @ container/container.go:486(container.HeadBlob)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed POST /v2/test/test/blobs/uploads/ for REDACTED:0, 202 Accepted in 0.6ms @ container/container.go:218(container.InitiateUploadBlob)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed POST /v2/test/test/blobs/uploads/ for REDACTED:0, 202 Accepted in 0.7ms @ container/container.go:218(container.InitiateUploadBlob)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed POST /v2/test/test/blobs/uploads/ for REDACTED:0, 202 Accepted in 0.9ms @ container/container.go:218(container.InitiateUploadBlob)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed POST /v2/test/test/blobs/uploads/ for REDACTED:0, 202 Accepted in 0.9ms @ container/container.go:218(container.InitiateUploadBlob)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /v2/test/test/blobs/uploads/jtzjr5ghfg6qfr6heaqmg0mlh?digest=sha256%3A[...] for REDACTED:0, 201 Created in 2.1ms @ container/container.go:373(container.EndUploadBlob)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /v2/test/test/blobs/uploads/49vudymsvznarmnzzeaumpg7g?digest=sha256%3A[...] for REDACTED:0, 201 Created in 3.4ms @ container/container.go:373(container.EndUploadBlob)
2024/08/18 11:41:32 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /v2/test/test/blobs/uploads/ada4izfsmp6vozywuvtpwuq3t?digest=sha256%3A[...] for REDACTED:0, 201 Created in 4.1ms @ container/container.go:373(container.EndUploadBlob)
2024/08/18 11:41:33 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /v2/test/test/blobs/uploads/dnvgyyksiuqixcv3ajfxygxfz?digest=sha256%3A[...] for REDACTED:0, 201 Created in 496.1ms @ container/container.go:373(container.EndUploadBlob)
2024/08/18 11:41:33 ...eb/routing/logger.go:102:func1() [I] router: completed HEAD /v2/test/test/manifests/test for REDACTED:0, 404 Not Found in 0.9ms @ container/container.go:624(container.HeadManifest)
2024/08/18 11:41:33 ...eb/routing/logger.go:102:func1() [I] router: completed HEAD /v2/test/test/manifests/test for REDACTED:0, 404 Not Found in 0.9ms @ container/container.go:624(container.HeadManifest)
2024/08/18 11:41:33 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /v2/test/test/manifests/test for REDACTED:0, 201 Created in 3.3ms @ container/container.go:539(container.UploadManifest)
2024/08/18 11:41:33 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /v2/test/test/manifests/test for REDACTED:0, 201 Created in 4.9ms @ container/container.go:539(container.UploadManifest)
2024/08/18 11:41:33 ...eb/routing/logger.go:102:func1() [I] router: completed HEAD /v2/test/test/manifests/test for REDACTED:0, 200 OK in 0.5ms @ container/container.go:624(container.HeadManifest)
2024/08/18 11:41:33 ...eb/routing/logger.go:102:func1() [I] router: completed PUT /v2/test/test/manifests/test for REDACTED:0, 404 Not Found in 0.6ms @ container/container.go:539(container.UploadManifest)
Strangely, I'm seeing 401 Unauthorized
errors there; which I'm not seeing in the Docker client.
I am logged into the registry via docker login
with my administrator user. I also tried creating a new user, which I added to the aforementioned test
group, 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.ini
APP_NAME = REDACTED
RUN_MODE = prod
RUN_USER = git
WORK_PATH = /data/gitea
[repository]
ROOT = /data/git/repositories
[repository.local]
LOCAL_COPY_PATH = /data/gitea/tmp/local-repo
[repository.upload]
TEMP_PATH = /data/gitea/uploads
[server]
APP_DATA_PATH = /data/gitea
DOMAIN = GITEA_HOST
SSH_DOMAIN = GITEA_HOST
HTTP_PORT = 3000
ROOT_URL = https://GITEA_HOST/
DISABLE_SSH = false
SSH_PORT = 222
SSH_LISTEN_PORT = 22
LFS_START_SERVER = true
LFS_JWT_SECRET = REDACTED
OFFLINE_MODE = true
[database]
PATH = /data/gitea/gitea.db
DB_TYPE = sqlite3
HOST = localhost:3306
NAME = gitea
USER = root
PASSWD =
LOG_SQL = false
SCHEMA =
SSL_MODE = disable
SQLITE_JOURNAL_MODE = WAL
[indexer]
REPO_INDEXER_ENABLED = true
REPO_INDEXER_PATH = /data/gitea/indexers/repos.bleve
ISSUE_INDEXER_ENABLED = true
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve
[session]
PROVIDER_CONFIG = /data/gitea/sessions
PROVIDER = file
[picture]
AVATAR_UPLOAD_PATH = /data/gitea/avatars
REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars
[attachment]
PATH = /data/gitea/attachments
[log]
MODE = console
LEVEL = debug
ROOT_PATH = /data/gitea/log
[security]
INSTALL_LOCK = true
SECRET_KEY =
REVERSE_PROXY_LIMIT = 1
REVERSE_PROXY_TRUSTED_PROXIES = *
INTERNAL_TOKEN = REDACTED
PASSWORD_HASH_ALGO = argon2
[service]
DISABLE_REGISTRATION = true
REQUIRE_SIGNIN_VIEW = true
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL = false
ALLOW_ONLY_EXTERNAL_REGISTRATION = false
ENABLE_CAPTCHA = false
DEFAULT_KEEP_EMAIL_PRIVATE = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING = true
NO_REPLY_ADDRESS = noreply.localhost
[lfs]
PATH = /data/git/lfs
[mailer]
ENABLED = false
[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false
[cron.update_checker]
ENABLED = false
[repository.pull-request]
DEFAULT_MERGE_STYLE = merge
[repository.signing]
DEFAULT_TRUST_MODEL = committer
[oauth2]
JWT_SECRET = REDACTED
[actions]
ENABLED = true
[packages]
ENABLED = true
The reverse proxy configuration:
GITEA_HOST {
reverse_proxy http://gitea:3000
}
And the docker compose
config for Gitea:
name: gitea
services:
gitea:
container_name: gitea
image: gitea/gitea:1
pull_policy: always
restart: always
init: true
hostname: "GITEA_HOST"
networks:
- gitea
deploy:
resources:
limits:
cpus: "4"
memory: "4G"
environment:
USER_UID: "3000"
USER_GID: "3000"
ports:
- "222:22"
volumes:
- "REDACTED:/data:rw"
networks:
gitea:
name: gitea
external: true
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-amd64
How are you running Gitea?
Hosting myself, on Docker 27.0.3
behind Caddy v2.8.4
.
Database
SQLite