Skip to content

/api/v1/repos/${org}/${repo}/branches fails with HTTP 500 when branch is being deleted #19541

Closed
@jpraet

Description

@jpraet

Description

/api/v1/repos/${org}/${repo}/branches returns HTTP 500 when a branch is being deleted at the same time.

Our gitea instance is setup to automatically delete PR branch after merge by default. We use jenkins for CI, and when jenkins receives the webhook it fetches the list of branches via the API. Sometimes (not always) that API call fails with a HTTP 500 error.

In the logs:

2022/04/28 15:34:58 ...pi/v1/repo/branch.go:270:ListBranches() [E] GetCommit: object does not exist [id: refs/heads/ujpr01-patch-2, rel_path: ]

I tried reproducing it on try.gitea.io but did not succeed.

Gitea Version

1.16.6

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker

Database

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions