Title: Issue-specific tools fail with -32603 Internal server error while repo-level tools work
Summary
All tools that target a single issue by index return MCP error -32603: Internal server error, while repo-level list tools against the same repo succeed. This makes it impossible to read, comment on, or update any individual issue.
Affected tools (all fail)
get_issue
list_issue_comments
create_issue_comment
(Anything keyed on a specific issue index appears affected.)
Working tools (same repo, same session)
list_issues — returns the full issue list correctly
Reproduction
Repo: den-ops/infra (self-hosted Gitea at git.hiddenden.cafe)
list_issues(owner="den-ops", repo="infra", state="open") → succeeds, returns 8 issues including #23.
get_issue(owner="den-ops", repo="infra", index=23) → -32603 Internal server error
list_issue_comments(owner="den-ops", repo="infra", index=23) → -32603 Internal server error
create_issue_comment(owner="den-ops", repo="infra", index=23, body="...") → -32603 Internal server error
Reproduced consistently across ~5 calls; not transient. The repo-level call keeps working in between the failing per-issue calls, so connectivity and auth are fine.
Expected
get_issue / list_issue_comments return the issue/comments; create_issue_comment posts the comment.
Actual
JSON-RPC -32603 (Internal error) with no further detail returned to the client.
Environment
Gitea version: 1.26.2
Issue exists and is reachable via the web UI and via list_issues.
Notes / hypotheses
Since repo-level listing works but every index-keyed endpoint fails, the bug likely sits in the per-issue code path (e.g. how index is passed to the upstream Gitea API call, or response parsing of the single-issue payload) rather than in auth/transport. Server-side logs around the -32603 would pinpoint it.
**Title:** Issue-specific tools fail with `-32603 Internal server error` while repo-level tools work
## Summary
All tools that target a single issue by index return `MCP error -32603: Internal server error`, while repo-level list tools against the same repo succeed. This makes it impossible to read, comment on, or update any individual issue.
## Affected tools (all fail)
- `get_issue`
- `list_issue_comments`
- `create_issue_comment`
(Anything keyed on a specific issue `index` appears affected.)
## Working tools (same repo, same session)
- `list_issues` — returns the full issue list correctly
## Reproduction
Repo: `den-ops/infra` (self-hosted Gitea at git.hiddenden.cafe)
1. `list_issues(owner="den-ops", repo="infra", state="open")` → succeeds, returns 8 issues including #23.
2. `get_issue(owner="den-ops", repo="infra", index=23)` → `-32603 Internal server error`
3. `list_issue_comments(owner="den-ops", repo="infra", index=23)` → `-32603 Internal server error`
4. `create_issue_comment(owner="den-ops", repo="infra", index=23, body="...")` → `-32603 Internal server error`
Reproduced consistently across ~5 calls; not transient. The repo-level call keeps working in between the failing per-issue calls, so connectivity and auth are fine.
## Expected
`get_issue` / `list_issue_comments` return the issue/comments; `create_issue_comment` posts the comment.
## Actual
JSON-RPC `-32603` (Internal error) with no further detail returned to the client.
## Environment
- Gitea version: 1.26.2
- Issue exists and is reachable via the web UI and via `list_issues`.
## Notes / hypotheses
Since repo-level listing works but every index-keyed endpoint fails, the bug likely sits in the per-issue code path (e.g. how `index` is passed to the upstream Gitea API call, or response parsing of the single-issue payload) rather than in auth/transport. Server-side logs around the `-32603` would pinpoint it.
Opgelost in 41749fd en bevestigd tegen de productie-image.
Verificatie
Oorspronkelijke repro (den-ops/infra#23): get_issue en list_issue_comments werken weer — geen -32603 meer.
create_issue_comment getest op een eigen test-issue + 25× in een write-loadtest.
Write-loadtest van ~100 parallelle, index-keyed calls (create/comment/label/close): 100% geslaagd, nul -32603 en geen rate-limiting.
Root-cause get_issue crashte met 'NoneType' object is not iterable op issues waar Gitea labels/assignees als null of met non-dict elementen teruggaf (de #13-klasse), wat als opake JSON-RPC -32603 bij de client landde.
Fix
read_tools: non-dict label/assignee entries worden overgeslagen in get_issue_tool.
server: een ingepakte GiteaNotFoundError wordt nu via de __cause__-keten gedetecteerd en als 404 / -32000 met een duidelijke melding teruggegeven; gemaskeerde interne fouten bevatten nu het exception-type zodat toekomstige fouten diagnosticeerbaar zijn zonder messages/stacktraces te lekken.
Tests toegevoegd voor non-dict collection-elementen en de not-found / typed-error responses.
Sluiten.
Opgelost in `41749fd` en bevestigd tegen de productie-image.
**Verificatie**
- Oorspronkelijke repro (`den-ops/infra` #23): `get_issue` en `list_issue_comments` werken weer — geen `-32603` meer.
- `create_issue_comment` getest op een eigen test-issue + 25× in een write-loadtest.
- Write-loadtest van ~100 parallelle, index-keyed calls (create/comment/label/close): 100% geslaagd, nul `-32603` en geen rate-limiting.
**Root-cause**
`get_issue` crashte met `'NoneType' object is not iterable` op issues waar Gitea `labels`/`assignees` als `null` of met non-dict elementen teruggaf (de #13-klasse), wat als opake JSON-RPC `-32603` bij de client landde.
**Fix**
- `read_tools`: non-dict `label`/`assignee` entries worden overgeslagen in `get_issue_tool`.
- `server`: een ingepakte `GiteaNotFoundError` wordt nu via de `__cause__`-keten gedetecteerd en als 404 / `-32000` met een duidelijke melding teruggegeven; gemaskeerde interne fouten bevatten nu het exception-type zodat toekomstige fouten diagnosticeerbaar zijn zonder messages/stacktraces te lekken.
- Tests toegevoegd voor non-dict collection-elementen en de not-found / typed-error responses.
Sluiten.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Title: Issue-specific tools fail with
-32603 Internal server errorwhile repo-level tools workSummary
All tools that target a single issue by index return
MCP error -32603: Internal server error, while repo-level list tools against the same repo succeed. This makes it impossible to read, comment on, or update any individual issue.Affected tools (all fail)
get_issuelist_issue_commentscreate_issue_comment(Anything keyed on a specific issue
indexappears affected.)Working tools (same repo, same session)
list_issues— returns the full issue list correctlyReproduction
Repo:
den-ops/infra(self-hosted Gitea at git.hiddenden.cafe)list_issues(owner="den-ops", repo="infra", state="open")→ succeeds, returns 8 issues including #23.get_issue(owner="den-ops", repo="infra", index=23)→-32603 Internal server errorlist_issue_comments(owner="den-ops", repo="infra", index=23)→-32603 Internal server errorcreate_issue_comment(owner="den-ops", repo="infra", index=23, body="...")→-32603 Internal server errorReproduced consistently across ~5 calls; not transient. The repo-level call keeps working in between the failing per-issue calls, so connectivity and auth are fine.
Expected
get_issue/list_issue_commentsreturn the issue/comments;create_issue_commentposts the comment.Actual
JSON-RPC
-32603(Internal error) with no further detail returned to the client.Environment
list_issues.Notes / hypotheses
Since repo-level listing works but every index-keyed endpoint fails, the bug likely sits in the per-issue code path (e.g. how
indexis passed to the upstream Gitea API call, or response parsing of the single-issue payload) rather than in auth/transport. Server-side logs around the-32603would pinpoint it.Opgelost in
41749fden bevestigd tegen de productie-image.Verificatie
den-ops/infra#23):get_issueenlist_issue_commentswerken weer — geen-32603meer.create_issue_commentgetest op een eigen test-issue + 25× in een write-loadtest.-32603en geen rate-limiting.Root-cause
get_issuecrashte met'NoneType' object is not iterableop issues waar Gitealabels/assigneesalsnullof met non-dict elementen teruggaf (de #13-klasse), wat als opake JSON-RPC-32603bij de client landde.Fix
read_tools: non-dictlabel/assigneeentries worden overgeslagen inget_issue_tool.server: een ingepakteGiteaNotFoundErrorwordt nu via de__cause__-keten gedetecteerd en als 404 /-32000met een duidelijke melding teruggegeven; gemaskeerde interne fouten bevatten nu het exception-type zodat toekomstige fouten diagnosticeerbaar zijn zonder messages/stacktraces te lekken.Sluiten.