Skip to content

"View File" link creates 404 in particular scenarios #12816

@jsreynolds

Description

@jsreynolds
  • Gitea version (or commit ref): 1.12.4
  • Git version : 2.25.1
  • Operating system: Ubuntu 20.04
  • 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:

Description

When reviewing code and clicking on “View File”, sometimes the view will fail and produce a 404 error. At first I thought this was an Nginx proxy issue, but in fact what I’m seeing is that for some of the files listed on the screen fail in View File when they are apparently missing part of their name. Please note that the underlying repository seems to have all the files intact and is fine - the code compiles, etc. Further review in the forum by kpfleming indicated that the issue might be that files were moved under folders with the same name. In fact, that seems to be true.

It was a much older project and originally everything in the repository was in the root folder, “attire-allowance”.
A new sub-folder under the root folder was created with the same name, “attire-allowance”.
File # 1 stayed where it was.
File # 2 was moved into the new sub-directory (also named “attire-allowance”).
Both files throw a 404 error when "View File" is clicked. The other files that show the full file name are not problematic.
...

Screenshots

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/duplicateThe issue has already been reported.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions