API errors on some raw files for specific repo #12753

Open
opened 2025-11-02 10:19:52 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @danparisd on GitHub (Mar 27, 2024).

Description

We have a gitea instance serving a repo that is throwing 500 server errors on certain raw file api requests. I've tried to narrow down exactly what's causing the problem to no success.

Repo in question on our instance: https://content.bibletranslationtools.org/WycliffeAssociates/en_gwt

Error URL: https://content.bibletranslationtools.org/api/v1/repos/WycliffeAssociates/en_gwt/raw/g2191-g2200/g2196.md

Things I've tried:

Gitea Version

1.21.5

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

https://gist.github.com/danparisd/b8469d118dbfa7a262d544a3c7a6af06

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker

Database

MySQL/MariaDB

Originally created by @danparisd on GitHub (Mar 27, 2024). ### Description We have a gitea instance serving a repo that is throwing 500 server errors on certain raw file api requests. I've tried to narrow down exactly what's causing the problem to no success. Repo in question on our instance: https://content.bibletranslationtools.org/WycliffeAssociates/en_gwt Error URL: https://content.bibletranslationtools.org/api/v1/repos/WycliffeAssociates/en_gwt/raw/g2191-g2200/g2196.md Things I've tried: - Using gitea 1.21.10 (still errors) - recreated only the problem folder/file from the web (works fine) - recreated serveral problem files/folders from the web (works fine) - https git pushed repo to try.gityea.io (errors) https://try.gitea.io/api/v1/repos/dandre456drfth/apitest/raw/g2191-g2200/g2196.md - used `git gc` and `git fsck` on the repo locally and pushed to a new gitea repo (errors) ### Gitea Version 1.21.5 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist https://gist.github.com/danparisd/b8469d118dbfa7a262d544a3c7a6af06 ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? docker ### Database MySQL/MariaDB
GiteaMirror added the type/bug label 2025-11-02 10:19:52 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Mar 28, 2024):

Could you try to "sync branches"? on the admin panel -> maintenance operations

@wxiaoguang commented on GitHub (Mar 28, 2024): Could you try to "sync branches"? on the admin panel -> maintenance operations
Author
Owner

@danparisd commented on GitHub (Mar 28, 2024):

Could you try to "sync branches"? on the admin panel -> maintenance operations

Done. Still getting error.

@danparisd commented on GitHub (Mar 28, 2024): > Could you try to "sync branches"? on the admin panel -> maintenance operations Done. Still getting error.
Author
Owner

@wxiaoguang commented on GitHub (Mar 29, 2024):

Actually the error is not right. The root cause is that your "path" is not a valid one. Try this, the branch name should be in the path:

https://try.gitea.io/api/v1/repos/dandre456drfth/apitest/raw/master/g2191-g2200/g2196.md

image


More details about why it reports 500 but not 404 for the wrong path:

git ref refs/heads/g2191-g2200 is reported as exiting as a "tree"

 git cat-file --batch-check
refs/heads/g2191-g2200
22007da0c9db54ecb623f9c7fc79102793cc7174 tree 10940
refs/heads/g0001-g0010
refs/heads/g0001-g0010 missing

@wxiaoguang commented on GitHub (Mar 29, 2024): Actually the error is not right. The root cause is that your "path" is not a valid one. Try this, the branch name should be in the path: https://try.gitea.io/api/v1/repos/dandre456drfth/apitest/raw/master/g2191-g2200/g2196.md ![image](https://github.com/go-gitea/gitea/assets/2114189/5fbcf956-6544-4362-a49a-6a1548d2a264) ---- More details about why it reports 500 but not 404 for the wrong path: git ref `refs/heads/g2191-g2200` is reported as exiting as a "tree" ``` git cat-file --batch-check refs/heads/g2191-g2200 22007da0c9db54ecb623f9c7fc79102793cc7174 tree 10940 refs/heads/g0001-g0010 refs/heads/g0001-g0010 missing ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12753