unauthorized: reqPackageAccess when pushing to container registry #13220

Closed
opened 2025-11-02 10:35:18 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @dlmw on GitHub (Jun 30, 2024).

Description

I successfully logged in to my user with docker login. I logged in with my usual username/password. When I push the image, I get the error unauthorized: reqPackageAccess.

What's the issue?

Gitea Version

1.22.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Docker Swarm

Database

PostgreSQL

Originally created by @dlmw on GitHub (Jun 30, 2024). ### Description I successfully logged in to my user with `docker login`. I logged in with my usual username/password. When I push the image, I get the error `unauthorized: reqPackageAccess`. What's the issue? ### Gitea Version 1.22.0 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Docker Swarm ### Database PostgreSQL
GiteaMirror added the topic/packagestype/bugissue/needs-feedback labels 2025-11-02 10:35:18 -06:00
Author
Owner

@kemzeb commented on GitHub (Jul 1, 2024):

Thanks for the bug report! Are there any logs that you would be able to provide from your Gitea instance associated with you pushing to your registry?

@kemzeb commented on GitHub (Jul 1, 2024): Thanks for the bug report! Are there any logs that you would be able to provide from your Gitea instance associated with you pushing to your registry?
Author
Owner

@dlmw commented on GitHub (Jul 7, 2024):

2024/07/07 08:32:03 ...eb/routing/logger.go:102:func1() [I] router: completed POST /v2/dlmw/minecraft/blobs/uploads/ for 10.0.0.2:0, 401 Unauthorized in 1.1ms @ packages/api.go:42(packages.ContainerRoutes.func2.1.reqPackageAccess.4)
2024/07/07 08:32:03 ...eb/routing/logger.go:102:func1() [I] router: completed POST /v2/dlmw/minecraft/blobs/uploads/ for 10.0.0.2:0, 401 Unauthorized in 1.1ms @ packages/api.go:42(packages.ContainerRoutes.func2.1.reqPackageAccess.4)

I think those are the relevant ones.

@dlmw commented on GitHub (Jul 7, 2024): ``` 2024/07/07 08:32:03 ...eb/routing/logger.go:102:func1() [I] router: completed POST /v2/dlmw/minecraft/blobs/uploads/ for 10.0.0.2:0, 401 Unauthorized in 1.1ms @ packages/api.go:42(packages.ContainerRoutes.func2.1.reqPackageAccess.4) 2024/07/07 08:32:03 ...eb/routing/logger.go:102:func1() [I] router: completed POST /v2/dlmw/minecraft/blobs/uploads/ for 10.0.0.2:0, 401 Unauthorized in 1.1ms @ packages/api.go:42(packages.ContainerRoutes.func2.1.reqPackageAccess.4) ``` I think those are the relevant ones.
Author
Owner

@delvh commented on GitHub (Jul 7, 2024):

You need to supply a PAT to authenticate yourself to Gitea (this has nothing to do with Docker). Your token needs either packages.Read or packages.Write permission, in this case probably write, and you must be allowed to push a package to the given user.,

@delvh commented on GitHub (Jul 7, 2024): You need to supply a PAT to authenticate yourself to Gitea (this has nothing to do with Docker). Your token needs either `packages.Read` or `packages.Write` permission, in this case probably write, and you must be allowed to push a package to the given user.,
Author
Owner

@dlmw commented on GitHub (Jul 7, 2024):

How do I do that if it's not related to Docker?

@dlmw commented on GitHub (Jul 7, 2024): How do I do that if it's not related to Docker?
Author
Owner

@delvh commented on GitHub (Jul 7, 2024):

grafik

@delvh commented on GitHub (Jul 7, 2024): ![grafik](https://github.com/go-gitea/gitea/assets/51889757/97133152-cd34-4e98-affa-9688a3d1c735)
Author
Owner

@dlmw commented on GitHub (Jul 7, 2024):

Thank you. A bit off-topic but is there a way to push an image to a repository instead of a user?

@dlmw commented on GitHub (Jul 7, 2024): Thank you. A bit off-topic but is there a way to push an image to a repository instead of a user?
Author
Owner

@delvh commented on GitHub (Jul 7, 2024):

No, but you can link a package to a repo once it has been pushed.

@delvh commented on GitHub (Jul 7, 2024): No, but you can link a package to a repo once it has been pushed.
Author
Owner

@olsonpm commented on GitHub (Aug 19, 2024):

I don't understand why a PAT is required. The docs mention it's only for the case of 2FA

@olsonpm commented on GitHub (Aug 19, 2024): I don't understand why a PAT is required. The [docs mention](https://docs.gitea.com/usage/packages/container) it's only for the case of 2FA
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13220