can1357/oh-my-pi · error · GitHubError
proxy returned malformed issue payload
Error message
proxy returned malformed issue payload
What it means
GitHubError(500) raised by _issue_from when the proxy response for a single issue is not a JSON object (dict). The library expects every issue payload from the GitHub proxy to be a mapping with required keys (repo, number); any non-dict (string, list, null) means the proxy protocol was violated. This is a server-side contract failure surfaced defensively to the client.
Source
Thrown at python/robomp/src/proxy_client.py:607
html_url=str(data.get("html_url") or ""),
asset_names=tuple(str(asset) for asset in data.get("asset_names") or []),
)
def _repo_from(data: Any) -> RepoInfo:
if not isinstance(data, dict):
raise GitHubError(500, "proxy returned malformed repo payload")
return RepoInfo(
full_name=str(data["full_name"]),
default_branch=str(data["default_branch"]),
clone_url=str(data["clone_url"]),
private=bool(data.get("private", False)),
)
def _issue_from(data: Any) -> IssueInfo:
if not isinstance(data, dict):
raise GitHubError(500, "proxy returned malformed issue payload")
labels = data.get("labels") or []
return IssueInfo(
repo=str(data["repo"]),
number=int(data["number"]),
title=str(data.get("title") or ""),
body=str(data.get("body") or ""),
state=str(data.get("state") or "open"),
author=str(data.get("author") or ""),
labels=tuple(str(x) for x in labels),
is_pull_request=bool(data.get("is_pull_request", False)),
)
def _issue_summary_from(data: Any) -> IssueSummary:
if not isinstance(data, dict):
raise GitHubError(500, "proxy returned malformed issue summary payload")
return IssueSummary(
repo=str(data["repo"]),View on GitHub (pinned to 9690622007)
Solutions
- Inspect the raw proxy response for the issue endpoint (curl the proxy URL) to see what non-dict body is actually returned.
- Verify the proxy service version matches what this client expects and redeploy/restart it if it is stale or crashed.
- Check proxy logs for the failing request — an upstream GitHub error is probably being passed through in the wrong shape.
- Retry the request; if transient, add retry with backoff around get_issue().
- If the proxy is third-party, report the malformed-payload contract violation with the response body.
Example fix
# before
issue = client.get_issue("org/repo", 42) # crashes with GitHubError 500
# after
try:
issue = client.get_issue("org/repo", 42)
except GitHubError as e:
if e.status == 500:
raw = fetch_raw_issue("org/repo", 42) # inspect/log actual proxy body
raise RuntimeError(f"proxy payload malformed: {raw!r}") from e
raise Defensive patterns
Strategy: try-catch
Validate before calling
import json, requests
resp = requests.get(f"{PROXY_URL}/repos/org/repo/issues/42")
body = resp.json()
if not isinstance(body, dict):
raise RuntimeError(f"proxy issue payload not an object: {body!r}") Type guard
def is_issue_payload(data: object) -> bool:
return isinstance(data, dict) and "repo" in data and "number" in data Try / catch
from robomp.proxy_client import GitHubError
try:
issue = client.get_issue("org/repo", 42)
except GitHubError as e:
if e.status == 500 and "malformed issue payload" in str(e):
issue = None # or refetch raw / alert on proxy health
else:
raise Prevention
- Pin and monitor the proxy version alongside the client; upgrade them together.
- Add a proxy health check that validates a known issue returns a dict-shaped payload.
- Log raw proxy bodies on 5xx so malformed payloads are diagnosable.
- Wrap proxy-backed reads in a small retry for transient gateway corruption.
When it happens
Trigger: Calling get_issue() when the proxy returns a non-object JSON body for the issue endpoint — e.g. a JSON array, a bare string, null, or an HTML/error page that was misparsed as JSON.
Common situations: Proxy deployed at a mismatched version returning an older/newer envelope; proxy error handler returning a JSON string or null instead of an object; misrouted endpoint returning a list; intermediary (gateway/LB) replacing the body with a plain-text or HTML error that got parsed as a scalar.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- proxy returned malformed issue summary payload
- proxy returned malformed issue index payload
- proxy returned malformed comment payload
- proxy returned malformed reaction payload
- proxy returned malformed review_comment payload
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/8d7c3bb7f356e941.
Report an issue: GitHub.