Error opening Pull requests with changed git submodules #3330

Closed
opened 2025-11-02 05:08:46 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @ukos-git on GitHub (May 14, 2019).

  • Gitea version:
  • Git version: 345bc06
  • Operating system: docker container
  • Database:
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Log gist:

Description

Opening a new pull request for a freshly pushed branch sometimes gives an error with an unformated html file and the following message in a <pre> tag:

template: repo/diff/box:109:21: executing "repo/diff/box" at <call $.IsImageFile $file.Name>: error calling call: runtime error: invalid memory address or nil pointer dereference

url for this is gitea.xyz/user/repo/compare/master...branch

Not sure if this helps but this is the last line of the gitea.log:

_issues`, `05/14 12:03:42 ^[[0m^[[32m...xorm/session_find.go:195:^[[32mnoCacheFind()^[[0m ^[[1;32m[I]^[[0m [SQL] ^[[1mSELECT `id`, `repo_id`, `name`, `content`, `is_closed`, `num_issues`, `05/14 12:03:42 ^[[0m^[[32m...xorm/session_find.go:195:^[[32mnoCacheFind()^[[0m ^[[1;32m[I]^[[0m [SQL] ^[[1mSELECT `id`, `user_id`, `repo_id`, `mode` FROM `access` WHERE (repo_id 05/14 12:03:42 ^[[0m^[[32m...s/context/context.go:138:^[[32mHTML()^[[0m ^[[1;34m[D]^[[0m Template: ^[[1mrepo/pulls/compare^[[0m
Originally created by @ukos-git on GitHub (May 14, 2019). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> - Gitea version: - Git version: 345bc06 - Operating system: docker container - Database: - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Log gist: ## Description Opening a new pull request for a freshly pushed branch sometimes gives an error with an unformated html file and the following message in a `<pre>` tag: ``` template: repo/diff/box:109:21: executing "repo/diff/box" at <call $.IsImageFile $file.Name>: error calling call: runtime error: invalid memory address or nil pointer dereference ``` url for this is `gitea.xyz/user/repo/compare/master...branch` Not sure if this helps but this is the last line of the gitea.log: ```console _issues`, `05/14 12:03:42 ^[[0m^[[32m...xorm/session_find.go:195:^[[32mnoCacheFind()^[[0m ^[[1;32m[I]^[[0m [SQL] ^[[1mSELECT `id`, `repo_id`, `name`, `content`, `is_closed`, `num_issues`, `05/14 12:03:42 ^[[0m^[[32m...xorm/session_find.go:195:^[[32mnoCacheFind()^[[0m ^[[1;32m[I]^[[0m [SQL] ^[[1mSELECT `id`, `user_id`, `repo_id`, `mode` FROM `access` WHERE (repo_id 05/14 12:03:42 ^[[0m^[[32m...s/context/context.go:138:^[[32mHTML()^[[0m ^[[1;34m[D]^[[0m Template: ^[[1mrepo/pulls/compare^[[0m ```
GiteaMirror added the type/bug label 2025-11-02 05:08:46 -06:00
Author
Owner

@lafriks commented on GitHub (May 14, 2019):

Could it be that it is for added or deleted files?

@lafriks commented on GitHub (May 14, 2019): Could it be that it is for added or deleted files?
Author
Owner

@ukos-git commented on GitHub (May 14, 2019):

I did the following to fix the error:

  • reset one file that was staged for deletion
  • rebased the branch on current master
  • took everything to a new branch

Now the pull request works but it feels like a workaround.

@ukos-git commented on GitHub (May 14, 2019): I did the following to fix the error: * reset one file that was staged for deletion * rebased the branch on current master * took everything to a new branch Now the pull request works but it feels like a workaround.
Author
Owner

@saitho commented on GitHub (May 19, 2019):

I just stumbled upon the same issue. In my case it happens when the diff contains a submodule.
Like here: https://try.gitea.io/saitho/test2/compare/noimage...submodule2

@saitho commented on GitHub (May 19, 2019): I just stumbled upon the same issue. In my case it happens when the diff contains a submodule. Like here: https://try.gitea.io/saitho/test2/compare/noimage...submodule2
Author
Owner

@ukos-git commented on GitHub (May 19, 2019):

I also have submodules activated for that branch but I also have git lfs active. Is there a possibility to add a bit more debug output for what is happening here?

@ukos-git commented on GitHub (May 19, 2019): I also have submodules activated for that branch but I also have git lfs active. Is there a possibility to add a bit more debug output for what is happening here?
Author
Owner

@lunny commented on GitHub (May 19, 2019):

So the problem is when your PR has a submodule. @ukos-git Could you change the title?

@lunny commented on GitHub (May 19, 2019): So the problem is when your PR has a submodule. @ukos-git Could you change the title?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3330