Skip to content

Intermediate error message is lost in pulls/{index}/merge #37217

@andrii-suse

Description

@andrii-suse

Description

So I tried to mark PR manually-merged and got 409 response with empty body:

curl -i -X POST -H "Authorization: token 633..."      -H "Content-Type: application/json"      -d '{
       "Do": "manually-merged",
       "head_commit_id": "096b..."
     }'      http://127.0.0.1:3000/api/v1/repos/mypool/pkgA/pulls/1/merge
HTTP/1.1 409 Conflict
Cache-Control: max-age=0, private, must-revalidate, no-transform
Content-Type: application/json;charset=utf-8
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Date: Tue, 14 Apr 2026 13:39:21 GMT
Content-Length: 3

{}

During troubleshooting I found out that MergeCommitID was missing and gitea had internal error "Wrong commit ID", which it saved to context and probably should be part of response?

if strings.Contains(err.Error(), "Wrong commit ID") {

So it is either a particular problem with this request that "Wrong commit ID" wasn't displayed to the user or maybe some general problem that context is losing or forgets to include intermediate error messages.

Gitea Version

1.25.4

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?

package installation in test cotntainer

Database

MySQL/MariaDB

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