Codeberg/Community
62
386
Fork
You've already forked Community
12

[bug] POST /api/v1/repos/.../pulls returns HTTP 500 with empty message body for specific repo #2739

Open
opened 2026年06月09日 03:00:09 +02:00 by patsys · 0 comments

Summary

A specific repository (regionalevents/websiteregionalevents, repo id 1444572) entered a state where every POST /api/v1/repos/{owner}/{repo}/pulls request returned HTTP 500 with an empty message field, regardless of payload size or content.

Last successful PR on that repo: PR #93 merged 2026年05月30日.
First observed failure: 2026年06月07日 ~22:00 UTC (when first attempting to open the next PR).
Resolution on our side: mirror-pushed full git history to a fresh repo (id 2040917), confirmed PR-create works there, then renamed the old repo to websiteregionalevents-broken-2026年06月08日 (still in the org, unarchived, for your reference) and renamed the new one to websiteregionalevents. Filing this so whatever caused the original repo to enter the broken state can be tracked.

Reproduction (against the broken repo, still present as regionalevents/websiteregionalevents-broken-2026年06月08日)

# Auth'd with a token that has admin+write+read on the repo
curl -sS -X POST \
 -H "Authorization: token $CODEBERG_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"title":"probe","body":"","head":"<any-existing-branch>","base":"main"}' \
 https://codeberg.org/api/v1/repos/regionalevents/websiteregionalevents-broken-2026年06月08日/pulls

Returns: HTTP 500 / 1.6s / body {"message":"","url":"https://codeberg.org/api/swagger"}

Diagnostic data we collected before migrating

Endpoint Result Notes
GET /api/v1/version 200 / 0.12s Instance healthy
GET /api/v1/repos/{owner}/{repo} 200 Repo metadata reachable
GET /api/v1/repos/{owner}/{repo}/hooks 200 — [] No webhooks configured
GET /api/v1/repos/{owner}/{repo}/branch_protections 200 required_approvals: 1, enable_status_check: false, otherwise standard
GET /api/v1/repos/{owner}/{repo}/pulls?state=closed 200 List works
GET /api/v1/repos/{owner}/{repo}/compare/main...<branch> 504 / 30.07s Diff cache timed out — possibly related
POST /api/v1/repos/{owner}/{repo}/pulls (full payload) 500 / 1.6s with {"message":""} Reproducible across many payload shapes
POST /api/v1/repos/{owner}/{repo}/pulls (title-only payload) 500 / 1.6s with {"message":""} Not a validation failure
POST /api/v1/repos/{owner}/{repo}/pulls (draft=true) 500 / 1.6s with {"message":""} Draft mode same

Server header in 500 response: x-server-name: s_forgejo_main (Forgejo).

Control: identical workflow / token / payload pattern on a sister repo in the same org (regionalevents/ticketsystem) succeeded — proving the bug is repo-specific, not org-wide or token-related. The control PR is now closed: https://codeberg.org/regionalevents/ticketsystem/pulls/258.

What might help your team

  • The empty message field in the 500 suggests an internal Forgejo exception path that swallows the underlying error. If you have logs for s_forgejo_main around the timestamps above (UTC), the stack trace would pin down the cause.
  • The simultaneous compare 504 suggests the diff-cache builder is involved — perhaps the repo's git ref index or pack files got into a state the cache can't process.
  • Branch counts at the time of failure: only 4 active branches; no unusual ref hygiene before the breakage.
  • Repo size: ~57MB, 2802 commits — well within ordinary territory.

Versions

  • Codeberg / Forgejo: 15.0.0-156-02d7aaa8+gitea-1.22.0 (as of 2026年06月08日; per GET /api/v1/version)
  • Client: direct curl + Forgejo MCP server (both produced identical errors)

Acknowledgement

Codeberg's free hosting is great — filing this in case it helps prevent the next repo from getting stuck in the same state. Happy to provide additional diagnostic data if it would be useful (the broken repo is still up at regionalevents/websiteregionalevents-broken-2026年06月08日 for your inspection; we'll keep it around ~14 days).

Thanks!

## Summary A specific repository (`regionalevents/websiteregionalevents`, repo id `1444572`) entered a state where every `POST /api/v1/repos/{owner}/{repo}/pulls` request returned `HTTP 500` with an empty `message` field, regardless of payload size or content. **Last successful PR on that repo:** PR #93 merged 2026年05月30日. **First observed failure:** 2026年06月07日 ~22:00 UTC (when first attempting to open the next PR). **Resolution on our side:** mirror-pushed full git history to a fresh repo (id `2040917`), confirmed PR-create works there, then renamed the old repo to `websiteregionalevents-broken-2026年06月08日` (still in the org, unarchived, for your reference) and renamed the new one to `websiteregionalevents`. Filing this so whatever caused the original repo to enter the broken state can be tracked. ## Reproduction (against the broken repo, still present as `regionalevents/websiteregionalevents-broken-2026年06月08日`) ```bash # Auth'd with a token that has admin+write+read on the repo curl -sS -X POST \ -H "Authorization: token $CODEBERG_TOKEN" \ -H "Content-Type: application/json" \ -d '{"title":"probe","body":"","head":"<any-existing-branch>","base":"main"}' \ https://codeberg.org/api/v1/repos/regionalevents/websiteregionalevents-broken-2026年06月08日/pulls ``` Returns: `HTTP 500 / 1.6s / body {"message":"","url":"https://codeberg.org/api/swagger"}` ## Diagnostic data we collected before migrating | Endpoint | Result | Notes | |---|---|---| | `GET /api/v1/version` | 200 / 0.12s | Instance healthy | | `GET /api/v1/repos/{owner}/{repo}` | 200 | Repo metadata reachable | | `GET /api/v1/repos/{owner}/{repo}/hooks` | 200 — `[]` | No webhooks configured | | `GET /api/v1/repos/{owner}/{repo}/branch_protections` | 200 | `required_approvals: 1`, `enable_status_check: false`, otherwise standard | | `GET /api/v1/repos/{owner}/{repo}/pulls?state=closed` | 200 | List works | | `GET /api/v1/repos/{owner}/{repo}/compare/main...<branch>` | **504 / 30.07s** | Diff cache timed out — possibly related | | `POST /api/v1/repos/{owner}/{repo}/pulls` (full payload) | **500 / 1.6s** with `{"message":""}` | Reproducible across many payload shapes | | `POST /api/v1/repos/{owner}/{repo}/pulls` (title-only payload) | **500 / 1.6s** with `{"message":""}` | Not a validation failure | | `POST /api/v1/repos/{owner}/{repo}/pulls` (draft=true) | **500 / 1.6s** with `{"message":""}` | Draft mode same | **Server header in 500 response:** `x-server-name: s_forgejo_main` (Forgejo). **Control:** identical workflow / token / payload pattern on a sister repo in the same org (`regionalevents/ticketsystem`) **succeeded** — proving the bug is repo-specific, not org-wide or token-related. The control PR is now closed: <https://codeberg.org/regionalevents/ticketsystem/pulls/258>. ## What might help your team - The empty `message` field in the 500 suggests an internal Forgejo exception path that swallows the underlying error. If you have logs for `s_forgejo_main` around the timestamps above (UTC), the stack trace would pin down the cause. - The simultaneous `compare` 504 suggests the diff-cache builder is involved — perhaps the repo's git ref index or pack files got into a state the cache can't process. - Branch counts at the time of failure: only 4 active branches; no unusual ref hygiene before the breakage. - Repo size: ~57MB, 2802 commits — well within ordinary territory. ## Versions - Codeberg / Forgejo: `15.0.0-156-02d7aaa8+gitea-1.22.0` (as of 2026年06月08日; per `GET /api/v1/version`) - Client: direct `curl` + Forgejo MCP server (both produced identical errors) ## Acknowledgement Codeberg's free hosting is great — filing this in case it helps prevent the next repo from getting stuck in the same state. Happy to provide additional diagnostic data if it would be useful (the broken repo is still up at `regionalevents/websiteregionalevents-broken-2026年06月08日` for your inspection; we'll keep it around ~14 days). Thanks!
Sign in to join this conversation.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
accessibility
Reduces accessibility and is thus a "bug" for certain user groups on Codeberg.
bug
Something is not working the way it should. Does not concern outages.
bug
infrastructure
Errors evidently caused by infrastructure malfunctions or outages
Codeberg
This issue involves Codeberg's downstream modifications and settings and/or Codeberg's structures.
contributions welcome
Please join the discussion and consider contributing a PR!
docs
No bug, but an improvement to the docs or UI description will help
duplicate
This issue or pull request already exists
enhancement
New feature
infrastructure
Involves changes to the server setups, use `bug/infrastructure` for infrastructure-related user errors.
legal
An issue directly involving legal compliance
licence / ToS
involving questions about the ToS, especially licencing compliance
please chill
we are volunteers
Please consider editing your posts and remember that there is a human on the other side. We get that you are frustrated, but it's harder for us to help you this way.
public relations
Things related to Codeberg's external communication
question
More information is needed
question
user support
This issue contains a clearly stated problem. However, it is not clear whether we have to fix anything on Codeberg's end, but we're helping them fix it and/or find the cause.
s/Forgejo
Related to Forgejo. Please also check Forgejo's issue tracker.
s/Forgejo/migration
Migration related issues in Forgejo
s/Pages
Issues related to the Codeberg Pages feature
s/Weblate
Issue is related to the Weblate instance at https://translate.codeberg.org
s/Woodpecker
Woodpecker CI related issue
security
involves improvements to the sites security
service
Add a new service to the Codeberg ecosystem (instead of implementing into Forgejo)
upstream
An open issue or pull request to an upstream repository to fix this issue (partially or completely) exists (i.e. Forgejo, Weblate, etc.)
wontfix
Codeberg's current set of contributors are not planning to spend time on delegating this issue.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg/Community#2739
Reference in a new issue
Codeberg/Community
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?