Draft update fails with HTTP 500 duplicate tag (UQE_release_n) when escalating the tag, e.g. v0.0.9 -> v0.1.0 #47
Loading…
Reference in a new issue
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?
Summary
The action fails with an HTTP 500 (unique constraint violation on
UQE_release_n) when it tries to update the existing draft release to a newly computed tag (v0.0.9->v0.1.0). No release or tagv0.1.0is visible through the API, so the action cannot know why the name is taken, and every subsequent run fails the same way until someone intervenes by hand.Error log
Context
Aevana/aevana(repo id 35), action pinned at00c3d887380e93b451e27a08fa63c0d3f158b5f0(v1), triggered by merged pull requests (Release Drafterworkflow,pull_request: closed). The same failure shows on every merge tomain.v0.0.9, targetmainv0.0.1...v0.0.8, tagsv0.0.1...v0.0.8GET /repos/Aevana/aevana/releases/tags/v0.1.0returns 404, there is nov0.1.0tag and nov0.1.0release in the listv0.1.0(afeaturePR merged sincev0.0.8), sogenerate_next_tag()escalated from patch to minor. The draft was created asv0.0.9earlier.Why this is probably related to #44
Since the fix for #44 (
tag = new_tag),create_or_update_release()now sends aPATCHto the existing draft that changestag_name(herev0.0.9->v0.1.0). Before that fix, thePATCHnever changedtag_name, so this path was never exercised. Forgejo answers with a 500 from the database unique key(repo_id, lower_tag_name): either an invisible row withv0.1.0already exists (for example a leftover from an earlier attempt or a half-applied update), or Forgejo's tag update for drafts conflicts with its own row. I could not tell which from the outside. Please treat this as a hypothesis.Expected behaviour
tag_namechange on an existing draft should succeed, or fail with an error that tells the user what to do.Suggestions
PATCH, look up/releases/tags/<new_tag>and list all releases including drafts (?draft=true) to detect a conflicting row, and log what was found.PATCHwith a changedtag_namereturns 500/409/422, fall back to: create the new draft first (POST), then delete the old draft by id, and log the fallback. (Issue #44 discussed delete+create as a worse default, but as a fallback for this error it keeps the action working.)Workaround
Delete the existing draft release by hand in the Forgejo UI and re-run the workflow (
workflow_dispatch) so the action takes thePOSTpath.