Skip to content

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

@NikunjChamaria

Description

@NikunjChamaria

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions