Bug: get_issue endpoint returns 'NoneType' object is not iterable for valid issues #13

Open
opened 2026-03-06 16:09:58 +00:00 by Bartender · 0 comments
Owner

Summary

When using the MCP connector to fetch a specific issue via get_issue, the request fails with the error:

'NoneType' object is not iterable

This occurs even when the issue clearly exists and is visible via list_issues.

Steps to Reproduce

  1. Call list_issues for a repository (e.g. Hiddenden/Cozy-Den).
  2. Observe that issue numbers are returned correctly.
  3. Call get_issue with one of the returned issue numbers (example: issue_number=29).

Example request:

get_issue({
  "owner": "Hiddenden",
  "repo": "Cozy-Den",
  "issue_number": 29
})

Expected Behavior

The API should return the issue metadata and body content.

Actual Behavior

The MCP layer returns:

json_rpc_error: 'NoneType' object is not iterable

Notes

  • list_issues works correctly and returns the issue metadata.
  • The issue clearly exists and can be opened in the web UI.
  • The failure appears to occur when the MCP server attempts to iterate over a field in the issue response that is None.

Possible Cause

The MCP adapter may be assuming a field (likely labels, reactions, or comments) is always iterable while the Gitea API can return null.

Impact

This prevents tools using the MCP server from retrieving issue bodies or doing deeper analysis on issues.

Suggested Fix

Add null-safety handling when parsing the Gitea issue response, ensuring optional fields default to empty lists rather than None.


Environment: AegisGitea-MCP via ChatGPT MCP integration

## Summary When using the MCP connector to fetch a specific issue via `get_issue`, the request fails with the error: ``` 'NoneType' object is not iterable ``` This occurs even when the issue clearly exists and is visible via `list_issues`. ## Steps to Reproduce 1. Call `list_issues` for a repository (e.g. `Hiddenden/Cozy-Den`). 2. Observe that issue numbers are returned correctly. 3. Call `get_issue` with one of the returned issue numbers (example: `issue_number=29`). Example request: ``` get_issue({ "owner": "Hiddenden", "repo": "Cozy-Den", "issue_number": 29 }) ``` ## Expected Behavior The API should return the issue metadata and body content. ## Actual Behavior The MCP layer returns: ``` json_rpc_error: 'NoneType' object is not iterable ``` ## Notes - `list_issues` works correctly and returns the issue metadata. - The issue clearly exists and can be opened in the web UI. - The failure appears to occur when the MCP server attempts to iterate over a field in the issue response that is `None`. ## Possible Cause The MCP adapter may be assuming a field (likely labels, reactions, or comments) is always iterable while the Gitea API can return `null`. ## Impact This prevents tools using the MCP server from retrieving issue bodies or doing deeper analysis on issues. ## Suggested Fix Add null-safety handling when parsing the Gitea issue response, ensuring optional fields default to empty lists rather than `None`. --- Environment: AegisGitea-MCP via ChatGPT MCP integration
Sign in to join this conversation.