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

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

Closed
jpraet opened this issue Apr 28, 2022 · 0 comments · Fixed by #19547
Closed
Labels

Comments

@jpraet
Copy link
Member

jpraet commented Apr 28, 2022

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

Gusted pushed a commit to Gusted/gitea that referenced this issue Apr 29, 2022
- If one of the branches no longer exists, don't throw an error, it's possible that the branch was destroyed during the process. Simply skip it and disregard it.
- Resolves go-gitea#19541
Gusted pushed a commit to Gusted/gitea that referenced this issue Apr 29, 2022
- Backport go-gitea#19547
  - If one of the branches no longer exists, don't throw an error, it's possible that the branch was destroyed during the process. Simply skip it and disregard it.
  - Resolves go-gitea#19541
lunny pushed a commit that referenced this issue Apr 29, 2022
* Don't error when branch's commit doesn't exist

- If one of the branches no longer exists, don't throw an error, it's possible that the branch was destroyed during the process. Simply skip it and disregard it.
- Resolves #19541

* Don't send empty objects

* Use more minimal approach
6543 pushed a commit that referenced this issue Apr 29, 2022
- Backport #19547
  - If one of the branches no longer exists, don't throw an error, it's possible that the branch was destroyed during the process. Simply skip it and disregard it.
  - Resolves #19541
Gusted pushed a commit to Gusted/gitea that referenced this issue Apr 30, 2022
* Don't error when branch's commit doesn't exist

- If one of the branches no longer exists, don't throw an error, it's possible that the branch was destroyed during the process. Simply skip it and disregard it.
- Resolves go-gitea#19541

* Don't send empty objects

* Use more minimal approach
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 24, 2022
* Don't error when branch's commit doesn't exist

- If one of the branches no longer exists, don't throw an error, it's possible that the branch was destroyed during the process. Simply skip it and disregard it.
- Resolves go-gitea#19541

* Don't send empty objects

* Use more minimal approach
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
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.

1 participant