can1357/oh-my-pi · error · GitHubError

proxy returned malformed issue index payload

Error message

proxy returned malformed issue index payload

What it means

GitHubError(500) raised by _index_entry_from when an entry in the proxy's issue-index response is not a JSON object. Every index entry must be a dict (repo/number/is_pull_request at minimum); a non-dict entry means the proxy violated its index schema.

Source

Thrown at python/robomp/src/proxy_client.py:642

    return IssueSummary(
        repo=str(data["repo"]),
        number=int(data["number"]),
        title=str(data.get("title") or ""),
        state=str(data.get("state") or ""),
        author=str(data.get("author") or ""),
        labels=tuple(str(x) for x in (data.get("labels") or [])),
        comments=int(data.get("comments") or 0),
        updated_at=str(data.get("updated_at") or ""),
        created_at=str(data.get("created_at") or ""),
        html_url=str(data.get("html_url") or ""),
        state_reason=str(data.get("state_reason") or ""),
        is_pull_request=bool(data.get("is_pull_request")),
    )


def _index_entry_from(data: Any) -> IssueIndexEntry:
    if not isinstance(data, dict):
        raise GitHubError(500, "proxy returned malformed issue index payload")
    return IssueIndexEntry(
        repo=str(data["repo"]),
        number=int(data["number"]),
        is_pull_request=bool(data.get("is_pull_request")),
        title=str(data.get("title") or ""),
        body=str(data.get("body") or ""),
        state=str(data.get("state") or ""),
        state_reason=str(data.get("state_reason") or ""),
        merged_at=str(data.get("merged_at") or ""),
        author=str(data.get("author") or ""),
        labels=tuple(str(x) for x in (data.get("labels") or [])),
        comments=int(data.get("comments") or 0),
        created_at=str(data.get("created_at") or ""),
        updated_at=str(data.get("updated_at") or ""),
        html_url=str(data.get("html_url") or ""),
    )

View on GitHub (pinned to 9690622007)

Solutions

  1. Fetch the index endpoint directly from the proxy and confirm each element is a JSON object.
  2. Invalidate/refresh any proxy-side cache of the index that may hold a legacy format.
  3. Align proxy version with the client schema — redeploy the proxy if it predates the index-object format.
  4. Retry the call; if persistent, fall back to list_issues() and build the index client-side.
  5. Report/patch the proxy so deleted entries are omitted rather than emitted as null.

Example fix

# before
entries = client.list_issue_index_entries("org/repo")  # GitHubError 500

# after
try:
    entries = client.list_issue_index_entries("org/repo")
except GitHubError as e:
    if e.status == 500:
        entries = rebuild_index_from_list(client.list_issues("org/repo"))
    else:
        raise
Defensive patterns

Strategy: validation

Validate before calling

raw = resp.json()
if not isinstance(raw, list) or not all(isinstance(e, dict) for e in raw):
    raise RuntimeError("proxy issue index must be a list of objects")

Type guard

def is_index_entry(data: object) -> bool:
    return isinstance(data, dict) and "repo" in data and "number" in data

Try / catch

try:
    entries = client.list_issue_index_entries("org/repo")
except GitHubError as e:
    if e.status == 500 and "malformed issue index" in str(e):
        entries = rebuild_index_from_issues(client.list_issues("org/repo"))
    else:
        raise

Prevention

When it happens

Trigger: Calling list_issue_index_entries() when the proxy returns the index as raw scalars, a flat list of strings/numbers, or an array containing null entries instead of objects.

Common situations: Proxy serving an outdated index format (pre-objects flat list); cache layer returning a stale/legacy serialized index; proxy bug when an issue is deleted from the index leaving null placeholders; version skew between proxy and client.

Understand the failure class

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/b70d95d4fce06d2e. Report an issue: GitHub.