Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Repo indexer chokes with submodules #7709

Closed
2 of 7 tasks
guillep2k opened this issue Aug 1, 2019 · 0 comments · Fixed by #7711
Closed
2 of 7 tasks

Repo indexer chokes with submodules #7709

guillep2k opened this issue Aug 1, 2019 · 0 comments · Fixed by #7711
Labels
Milestone

Comments

@guillep2k
Copy link
Member

  • Gitea version (or commit ref): v1.9.0
  • Git version: 2.22.0
  • Operating system: CentOS 7
  • 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 a repository has submodules, function models/repo_indexer.go:addUpdate() returns exit status 128 - fatal: git cat-file: could not get object info and further processing on the repo is aborted.

I've added additional logs to the function:

image

And I've got:

2019/08/01 15:56:01 .../xorm/session_raw.go:87:queryRow() [I] [SQL] SELECT count(*) FROM "notification" WHERE (user_id = $1) AND (status = $2) []interface {}{9, 0x1}
2019/08/01 15:56:03 ...dels/repo_indexer.go:207:addUpdate() [E] addUpdate: exit status 128 - fatal: git cat-file: could not get object info
        ; update.BlobSha: 9aef6c8b728958f722f160c8c34fc85790ec2ae8; repo.path: /home/git/gitea-repositories/gprandi/avl-comunicaciones.git, filename: avl-libs-bin

In this case, avl-libs-bin is a submodule. The following command fails as expected:

$ cd /home/git/gitea-repositories/gprandi/avl-comunicaciones.git
$ git cat-file -s 9aef6c8b728958f722f160c8c34fc85790ec2ae8:avl-libs-bin
fatal: Not a valid object name 9aef6c8b728958f722f160c8c34fc85790ec2ae8:avl-libs-bin

The hash 9aef6c8b728958f722f160c8c34fc85790ec2ae8 does not belong to this repository, but to the submodule's. The object type for that entry is "commit":

$ git ls-tree master
100644 blob 07f549803e107d232d61e0a89c179f6d3a5c1abf    .gitattributes
100644 blob 892ca8e3c1bd4bcddab831e6ecde2910d1d80bc0    .gitignore
100644 blob 166aa8b77976abf066e12abae4f20570202a28ca    .gitmodules
040000 tree 68f80510880d7078e7937b3944cf395a203333e2    CommLib
040000 tree 4ab4458e94f2d63c16eb30645949c57db7eb3fc6    FullDevLogReplicator
100644 blob d1ba69f092c97d9ed3c5a0fabd1d4004c4863897    README.md
100644 blob 08906d481771dcade1cf7390f24d4ad83ce07965    avl-comunicaciones.sln
160000 commit 9aef6c8b728958f722f160c8c34fc85790ec2ae8  avl-libs-bin
[...]

I'll attempt a PR about this.

@lafriks lafriks added this to the 1.9.1 milestone Aug 2, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants