Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

OpenGrok returns "File Not Found" on deleted files even with a revision #4647

Open
cesar-d2l opened this issue Aug 23, 2024 · 1 comment
Open
Labels
enhancement webapp web application

Comments

@cesar-d2l
Copy link

Describe the bug
In our docs, we often link to opengrok files with the revision number, for example:
/xref/test/somefile.sql?r=2766bdc195f0ae5daa0756aa64b2cd0c63d9ce32

In the main branch, somefile.sql has been deleted (or more often, moved/renamed). So we always get a "Error: File not found!". However, at that revision, that file does exist. git show 2766bdc195f0ae5daa0756aa64b2cd0c63d9ce32 -- somefile.sql does return a result.

I apologize in advance, I'm 90% sure this bug has been reported somewhere but I just can't find it :(

Environment:

  • OpenGrok 1.13.17
  • Tomcat 10.1.26
  • OpenJdk 11.0.24 (Amazon Corretto)
  • Amazon Linux 2

To Reproduce

  1. Create a test repo and add a file
  2. Index the repo, and in the UI navigate to that file
  3. Delete the file in step 1 and re-index
  4. Refresh the page

Expected behavior
The web browser shows the file at that revision

@vladak vladak added webapp web application enhancement labels Aug 28, 2024
@vladak
Copy link
Member

vladak commented Aug 28, 2024

I don't think this has ever been supported. The webapp allows only files that are currently present to be handed back. The check in

will propagate to
response.sendError(HttpServletResponse.SC_NOT_FOUND);

I'd have to think about the implications of relaxing this check.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement webapp web application
Projects
None yet
Development

No branches or pull requests

2 participants