500 returned trying to git clone with user that cannot sign in #3640

Closed
opened 2025-11-02 05:20:17 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @robxu9 on GitHub (Jul 22, 2019).

  • Gitea version (or commit ref): 1.8.1
  • Git version: 2.20.1
  • Operating system: Gitea Docker Image
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
2019/07/22 02:04:57 [...s/context/context.go:238 func1()] [E] UserSignIn: user is not allowed login [uid: 5, name: <username>]
2019/07/22 02:04:57 [...routers/repo/http.go:205 HTTP()] [E] UserSignIn error: %v: user is not allowed login [uid: 5, name: <username>]

Description

When trying to git clone with an account that is activated but has disable sign in checked, Gitea returns 500. It should return a more appropriate HTTP status code, i.e. 401 or 403, since 500 may lead people to believe that something is wrong on Gitea's side when it isn't.

(The context for this was that I was trying to get a user account that was allowed read-only git access, but not web ui access - like a service account. I tried to keep the account active but disabled sign-in...)

Screenshots

N/A

Originally created by @robxu9 on GitHub (Jul 22, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.8.1 - Git version: 2.20.1 - Operating system: Gitea Docker Image - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ``` 2019/07/22 02:04:57 [...s/context/context.go:238 func1()] [E] UserSignIn: user is not allowed login [uid: 5, name: <username>] 2019/07/22 02:04:57 [...routers/repo/http.go:205 HTTP()] [E] UserSignIn error: %v: user is not allowed login [uid: 5, name: <username>] ``` ## Description When trying to `git clone` with an account that is activated but has disable sign in checked, Gitea returns 500. It should return a more appropriate HTTP status code, i.e. 401 or 403, since 500 may lead people to believe that something is wrong on Gitea's side when it isn't. (The context for this was that I was trying to get a user account that was allowed read-only git access, but not web ui access - like a service account. I tried to keep the account active but disabled sign-in...) ## Screenshots N/A
GiteaMirror added the type/bug label 2025-11-02 05:20:18 -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#3640