Push Fails with "No Repository Found" When Contributor Has Only Read Access #14820

Open
opened 2025-11-02 11:23:43 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @NikunjChamaria on GitHub (Jul 31, 2025).

Description

We have encountered an issue in our Gitea instance involving repository access controls. When a contributor who has only read access to a repository attempts to push changes, the operation fails with a "no repository found" error message.

This behavior is misleading, as it suggests the repository does not exist, whereas the actual problem is insufficient permissions to push.


Logs

((repo) is the name of the repo)

2025/07/31 06:49:17 HTTPRequest [I] router: completed GET /(repo).git/info/refs?service=git-receive-pack for 14.99.176.2:0, 401 Unauthorized in 5.3ms @ repo/githttp.go:511(repo.GetInfoRefs)
2025/07/31 06:49:17 HTTPRequest [I] router: completed GET /(repo).git/info/refs?service=git-receive-pack for 14.99.176.2:0, 404 Not Found in 41.3ms @ repo/githttp.go:511(repo.GetInfoRefs)


Steps to Reproduce

  1. Assign a user read-only access to a repository.
  2. The user attempts to execute a git push command targeting that repository.
  3. The push operation fails, returning a "no repository found" error rather than a permission error.

Gitea Version

1.24.2

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?

Run through Direct binary on a systemd service

Database

MySQL/MariaDB

Originally created by @NikunjChamaria on GitHub (Jul 31, 2025). ### Description We have encountered an issue in our Gitea instance involving repository access controls. When a contributor who has only **read access** to a repository attempts to push changes, the operation fails with a "no repository found" error message. This behavior is misleading, as it suggests the repository does not exist, whereas the actual problem is insufficient permissions to push. --- ### Logs ((repo) is the name of the repo) 2025/07/31 06:49:17 HTTPRequest [I] router: completed GET /(repo).git/info/refs?service=git-receive-pack for 14.99.176.2:0, 401 Unauthorized in 5.3ms @ repo/githttp.go:511(repo.GetInfoRefs) 2025/07/31 06:49:17 HTTPRequest [I] router: completed GET /(repo).git/info/refs?service=git-receive-pack for 14.99.176.2:0, 404 Not Found in 41.3ms @ repo/githttp.go:511(repo.GetInfoRefs) --- ### Steps to Reproduce 1. Assign a user **read-only** access to a repository. 2. The user attempts to execute a `git push` command targeting that repository. 3. The push operation fails, returning a "no repository found" error rather than a permission error. ### Gitea Version 1.24.2 ### 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? Run through Direct binary on a systemd service ### Database MySQL/MariaDB
GiteaMirror added the type/bug label 2025-11-02 11:23:43 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14820