Error 500 when trying to webview a specific repository #1078

Closed
opened 2025-11-02 03:47:29 -06:00 by GiteaMirror · 15 comments
Owner

Originally created by @netzwerkgoettin on GitHub (Sep 18, 2017).

  • Gitea version (or commit ref):
  • Git version: 1.1.4
  • Operating system: Debian 8
  • Database:
    • MySQL
  • Can you reproduce the bug at https://try.gitea.io:
    • No
  • Log gist: in log/gitea.log:
[...routers/repo/view.go:52 renderDirectory()] [E] GetCommitsInfo: GetCommitByPath (/Iconr): Length must be 40:

Description

I manage several repositories via Gitea, and they a working like a charm. But one specific throws an 500 server error when I try to open it in the browser. In the logs I can stat this message:

[...routers/repo/view.go:52 renderDirectory()] [E] GetCommitsInfo: GetCommitByPath (/Iconr): Length must be 40:

But I can clone and push without any problem.

Where to start debugging?

Cheers,
Marianne

Screenshots

screen shot 2017-09-18 at 10 09 50

Originally created by @netzwerkgoettin on GitHub (Sep 18, 2017). - Gitea version (or commit ref): - Git version: 1.1.4 - Operating system: Debian 8 - Database: - [x] MySQL - Can you reproduce the bug at https://try.gitea.io: - [x] No - Log gist: in log/gitea.log: ``` [...routers/repo/view.go:52 renderDirectory()] [E] GetCommitsInfo: GetCommitByPath (/Iconr): Length must be 40: ``` ## Description I manage several repositories via Gitea, and they a working like a charm. But one specific throws an 500 server error when I try to open it in the browser. In the logs I can stat this message: ``` [...routers/repo/view.go:52 renderDirectory()] [E] GetCommitsInfo: GetCommitByPath (/Iconr): Length must be 40: ``` But I can clone and push without any problem. Where to start debugging? Cheers, Marianne ## Screenshots ![screen shot 2017-09-18 at 10 09 50](https://user-images.githubusercontent.com/11242139/30533413-8ecb36b8-9c59-11e7-96c3-4e1df844ad38.jpg)
GiteaMirror added the issue/confirmedtype/bug labels 2025-11-02 03:47:29 -06:00
Author
Owner

@lunny commented on GitHub (Sep 19, 2017):

It seems there was already an issue to describe that.

@lunny commented on GitHub (Sep 19, 2017): It seems there was already an issue to describe that.
Author
Owner

@lafriks commented on GitHub (Sep 19, 2017):

I think this was already fixed in 1.2

@lafriks commented on GitHub (Sep 19, 2017): I think this was already fixed in 1.2
Author
Owner

@lunny commented on GitHub (Sep 20, 2017):

@sysadmama could you confirm that?

@lunny commented on GitHub (Sep 20, 2017): @sysadmama could you confirm that?
Author
Owner

@netzwerkgoettin commented on GitHub (Sep 20, 2017):

@lunny + @lafriks Nope; started 1.2.0+rc2 yesterday and still error 500 on this specific repository. gitea.log.

[...routers/repo/view.go:53 renderDirectory()] [E] GetCommitsInfo: GetCommitByPath (/Iconr): Length must be 40:

Cheers,
Marianne

@netzwerkgoettin commented on GitHub (Sep 20, 2017): @lunny + @lafriks Nope; started 1.2.0+rc2 yesterday and still error 500 on this specific repository. gitea.log. ``` [...routers/repo/view.go:53 renderDirectory()] [E] GetCommitsInfo: GetCommitByPath (/Iconr): Length must be 40: ``` Cheers, Marianne
Author
Owner

@lafriks commented on GitHub (Sep 20, 2017):

@sysadmama is that repository public so we could reproduce that issue?

@lafriks commented on GitHub (Sep 20, 2017): @sysadmama is that repository public so we could reproduce that issue?
Author
Owner

@netzwerkgoettin commented on GitHub (Sep 20, 2017):

@lafriks No it's reachable via VPN only :( Are there any further logfiles I could consult? Even strace doesn't enlighten me.

@netzwerkgoettin commented on GitHub (Sep 20, 2017): @lafriks No it's reachable via VPN only :( Are there any further logfiles I could consult? Even `strace` doesn't enlighten me.
Author
Owner

@lunny commented on GitHub (Sep 20, 2017):

@lafriks @sysadmama I remember I have tried to resolve this issue but I failed.

@lunny commented on GitHub (Sep 20, 2017): @lafriks @sysadmama I remember I have tried to resolve this issue but I failed.
Author
Owner

@Andlix commented on GitHub (Sep 24, 2017):

Here is an example for an 500 with Version 1.2.0+rc3-6-g03ff7687:
https://try.gitea.io/AndyTest/TestDev.git
But with try.gitea.io it hangs.

The strings (of the filenames) are not escaped. I could imagine, that this would be a security issue, too.

@Andlix commented on GitHub (Sep 24, 2017): Here is an example for an 500 with Version 1.2.0+rc3-6-g03ff7687: https://try.gitea.io/AndyTest/TestDev.git But with try.gitea.io it hangs. The strings (of the filenames) are not escaped. I could imagine, that this would be a security issue, too.
Author
Owner

@netzwerkgoettin commented on GitHub (Sep 25, 2017):

Tried it with my repository: I accidentally had an empty File called Icon?. I removed it completely, and after a push I can access my repo via web interface. So I also would assume it's the (wrong or non existent) escaping.

@netzwerkgoettin commented on GitHub (Sep 25, 2017): Tried it with my repository: I accidentally had an empty File called `Icon?`. I removed it completely, and after a `push` I can access my repo via web interface. So I also would assume it's the (wrong or non existent) escaping.
Author
Owner

@lunny commented on GitHub (Sep 26, 2017):

@sysadmama The filename contains a special character gitea didn't parse correctly.

@lunny commented on GitHub (Sep 26, 2017): @sysadmama The filename contains a special character gitea didn't parse correctly.
Author
Owner

@ethantkoenig commented on GitHub (Sep 30, 2017):

@Andlix It seems that we fail with filenames containing newlines (i.e. \n). I believe that none of the other filenames in your test repo cause problems.

@ethantkoenig commented on GitHub (Sep 30, 2017): @Andlix It seems that we fail with filenames containing newlines (i.e. `\n`). I believe that none of the other filenames in your test repo cause problems.
Author
Owner

@jxsl13 commented on GitHub (Dec 14, 2017):

same issue: linkt to try.gitea.io
after merging my repo from github, the branches seem to be missing, causing the 500 error.

gitea.log:

2017/12/14 06:42:16 [...s/context/context.go:118 NotFoundOrServerError()] [E] GetRepositoryByOwnerAndName: repository does not exist [id: 0, uid: 0, owner_name: 2016, name: 09]
2017/12/14 12:53:23 [...routers/repo/view.go:54 renderDirectory()] [E] GetCommitsInfo: Length must be 40:
@jxsl13 commented on GitHub (Dec 14, 2017): same issue: [linkt to try.gitea.io](https://try.gitea.io/jxsl13/Software-Engineering/src/branch/john) after merging my repo from github, the branches seem to be missing, causing the 500 error. gitea.log: ``` 2017/12/14 06:42:16 [...s/context/context.go:118 NotFoundOrServerError()] [E] GetRepositoryByOwnerAndName: repository does not exist [id: 0, uid: 0, owner_name: 2016, name: 09] 2017/12/14 12:53:23 [...routers/repo/view.go:54 renderDirectory()] [E] GetCommitsInfo: Length must be 40: ```
Author
Owner

@dmarov commented on GitHub (Feb 1, 2019):

same issue with file named ":w"

@dmarov commented on GitHub (Feb 1, 2019): same issue with file named ":w"
Author
Owner

@stale[bot] commented on GitHub (Apr 2, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Apr 2, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@zeripath commented on GitHub (May 26, 2019):

This is both a duplicate and fixed likely by one of @mrsdizzie escaping patches.

@zeripath commented on GitHub (May 26, 2019): This is both a duplicate and fixed likely by one of @mrsdizzie escaping patches.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1078