fix(ci): release workflow fails with "object does not exist" (HTTP 500) #326

Closed
opened 2026-02-24 18:39:50 +00:00 by forbes · 0 comments
Owner

Description

The publish-release job in .gitea/workflows/release.yml fails at the "Create release" step with:

::error::Failed to create release (HTTP 500): {"message":"object does not exist [id: , rel_path: ]","url":"https://git.kindred-systems.com/api/swagger"}

The empty id and rel_path fields indicate Gitea cannot resolve the tag to a git object.

Root Cause

The release creation API call is missing the target_commitish field in its JSON payload. While the Gitea API docs mark this as optional, in practice Gitea requires it to resolve the tag to a commit object. Without it, Gitea returns an internal server error because it cannot locate the git object backing the tag.

Current payload (line ~284):

print(json.dumps({
    "tag_name": tag,
    "name": f"Kindred Create {tag}",
    "body": body,
    "prerelease": prerelease,
}))

Missing: "target_commitish" — should be set to the branch or commit SHA the tag points to.

Additionally, the publish-release job does not check out the repository, so it has no local git context. The BUILD_TAG comes from github.ref_name || inputs.tag, but for workflow_dispatch runs the tag may not yet exist on the remote, causing the same resolution failure.

See also: go-gitea/gitea#21681

Proposed Fix

  1. Add target_commitish to the release payload — use ${{ github.sha }} (the commit that triggered the workflow) so Gitea can resolve the tag:

    print(json.dumps({
        "tag_name": tag,
        "name": f"Kindred Create {tag}",
        "body": body,
        "prerelease": prerelease,
        "target_commitish": "'"${GITHUB_SHA}"'"
    }))
    
  2. Pass GITHUB_SHA into the env block of the publish-release job:

    env:
      BUILD_TAG: ${{ github.ref_name || inputs.tag }}
      GITHUB_SHA: ${{ github.sha }}
    
  3. Handle workflow_dispatch edge case — when a user manually specifies a tag that does not yet exist, the API will create the tag on the target commit. Ensure the SHA comes from the correct branch by checking out the repo or explicitly passing the SHA from the build job.

Files to Modify

  • .gitea/workflows/release.yml — add target_commitish to the release creation payload
## Description The `publish-release` job in `.gitea/workflows/release.yml` fails at the "Create release" step with: ``` ::error::Failed to create release (HTTP 500): {"message":"object does not exist [id: , rel_path: ]","url":"https://git.kindred-systems.com/api/swagger"} ``` The empty `id` and `rel_path` fields indicate Gitea cannot resolve the tag to a git object. ## Root Cause The release creation API call is missing the `target_commitish` field in its JSON payload. While the Gitea API docs mark this as optional, in practice Gitea requires it to resolve the tag to a commit object. Without it, Gitea returns an internal server error because it cannot locate the git object backing the tag. Current payload (line ~284): ```python print(json.dumps({ "tag_name": tag, "name": f"Kindred Create {tag}", "body": body, "prerelease": prerelease, })) ``` Missing: `"target_commitish"` — should be set to the branch or commit SHA the tag points to. Additionally, the `publish-release` job does not check out the repository, so it has no local git context. The `BUILD_TAG` comes from `github.ref_name || inputs.tag`, but for `workflow_dispatch` runs the tag may not yet exist on the remote, causing the same resolution failure. See also: [go-gitea/gitea#21681](https://github.com/go-gitea/gitea/issues/21681) ## Proposed Fix 1. **Add `target_commitish` to the release payload** — use `${{ github.sha }}` (the commit that triggered the workflow) so Gitea can resolve the tag: ```python print(json.dumps({ "tag_name": tag, "name": f"Kindred Create {tag}", "body": body, "prerelease": prerelease, "target_commitish": "'"${GITHUB_SHA}"'" })) ``` 2. **Pass `GITHUB_SHA` into the env block** of the `publish-release` job: ```yaml env: BUILD_TAG: ${{ github.ref_name || inputs.tag }} GITHUB_SHA: ${{ github.sha }} ``` 3. **Handle `workflow_dispatch` edge case** — when a user manually specifies a tag that does not yet exist, the API will create the tag on the target commit. Ensure the SHA comes from the correct branch by checking out the repo or explicitly passing the SHA from the build job. ## Files to Modify - `.gitea/workflows/release.yml` — add `target_commitish` to the release creation payload
forbes added the bug label 2026-02-24 18:39:50 +00:00
forbes added the high-priority label 2026-02-24 20:59:14 +00:00
forbes added this to the CI-CD project 2026-02-24 21:02:38 +00:00
forbes self-assigned this 2026-02-24 21:02:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/create#326