forge reports an error but keeps going: empty token file still hits the network; name resolution reports 'not found' after a transport failure #144

Closed
opened 2026-08-19 03:52:25 +01:00 by allod-agent · 0 comments
Member

forge sometimes prints an error that reads as fatal and then continues executing, producing a second, misleading outcome: an empty token file still leads to an API request, and a label or milestone name lookup that fails at the transport level is reported as the name not existing.

Evidence

Empty token file — the "is empty" error does not stop the run; the API call is still attempted (and with a real server would be sent without a usable token):

$ T=$(mktemp); : > "$T"
$ env -u FORGEJO_TOKEN FORGE_TOKEN_FILE="$T" FORGE_URL=http://127.0.0.1:9 forge label list -R own/repo
forge: /tmp/tmp.T1P2WQhm4K is empty
forge: GET /repos/own/repo/labels?limit=30 failed: curl exit 7
exit: 7

Name-based label resolution — the lookup GET fails at the transport level, but the run continues and misreports the failure as the label not existing (exit 1, not the transport code):

$ env FORGEJO_TOKEN=dummytok FORGE_URL=http://127.0.0.1:9 forge label edit somename -d x -R own/repo
forge: GET /repos/own/repo/labels?limit=100 failed: curl exit 7
forge: label not found: somename
exit: 1

Milestone name resolution shows the same symptom:

$ env FORGEJO_TOKEN=dummytok FORGE_URL=http://127.0.0.1:9 forge milestone view sometitle -R own/repo
forge: GET /repos/own/repo/milestones?state=all&name=sometitle&limit=100 failed: curl exit 7
forge: milestone not found: sometitle
exit: 1

Numeric-ID targets are unaffected (no name lookup happens). Observed on the current master forge (commit d6a0612) on a dev VM.

`forge` sometimes prints an error that reads as fatal and then continues executing, producing a second, misleading outcome: an empty token file still leads to an API request, and a label or milestone name lookup that fails at the transport level is reported as the name not existing. ### Evidence Empty token file — the "is empty" error does not stop the run; the API call is still attempted (and with a real server would be sent without a usable token): ``` $ T=$(mktemp); : > "$T" $ env -u FORGEJO_TOKEN FORGE_TOKEN_FILE="$T" FORGE_URL=http://127.0.0.1:9 forge label list -R own/repo forge: /tmp/tmp.T1P2WQhm4K is empty forge: GET /repos/own/repo/labels?limit=30 failed: curl exit 7 exit: 7 ``` Name-based label resolution — the lookup GET fails at the transport level, but the run continues and misreports the failure as the label not existing (exit 1, not the transport code): ``` $ env FORGEJO_TOKEN=dummytok FORGE_URL=http://127.0.0.1:9 forge label edit somename -d x -R own/repo forge: GET /repos/own/repo/labels?limit=100 failed: curl exit 7 forge: label not found: somename exit: 1 ``` Milestone name resolution shows the same symptom: ``` $ env FORGEJO_TOKEN=dummytok FORGE_URL=http://127.0.0.1:9 forge milestone view sometitle -R own/repo forge: GET /repos/own/repo/milestones?state=all&name=sometitle&limit=100 failed: curl exit 7 forge: milestone not found: sometitle exit: 1 ``` Numeric-ID targets are unaffected (no name lookup happens). Observed on the current master `forge` (commit d6a0612) on a dev VM.
vnprc closed this issue 2026-08-25 00:13:05 +01:00
Sign in to join this conversation.
No description provided.