Skip to content

[Bug][gitextract] crash when repository is empty #8382

@galachad

Description

@galachad

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

The git extraction process crashes the server when the repository is empty.

This behavior was observed on GitLab. I am unsure if this issue occurs on other platforms. The container restarts because the process crashed, but I haven't found any errors in the logs.

time="2025-04-15 08:28:03" level=info msg=" [pipeline service] [pipeline #22] [task #9512] subtask Clone Git Repo finished in 38110 ms"
time="2025-04-15 08:28:03" level=info msg=" [pipeline service] [pipeline #22] [task #9512] finished step: 1 / 4"
time="2025-04-15 08:28:03" level=info msg=" [pipeline service] [pipeline #22] [task #9512] executing subtask Collect Commits"

executing subtask Collect Commits is the task that ends with crash.

Image

What do you expect to happen

The git extraction task should fail, but instead it crashes.

How to reproduce

Try to scrap empty repository.

Anything else

No response

Version

v1.0.1

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/pluginsThis issue or PR relates to pluginstype/bugThis issue is a bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions