{"record":{"id":"b8de906456f0f9ba","repo":"HKUDS/DeepTutor","slug":"self-name-invalid-json-listing-skills","errorCode":null,"errorMessage":"{self.name}: invalid JSON listing skills","messagePattern":"(.+?): invalid JSON listing skills","errorType":"http","errorClass":"HubError","httpStatus":null,"severity":"error","filePath":"deeptutor/services/skill/hub.py","lineNumber":510,"sourceCode":"        pre-filling an upgrade's tagging) — see ``buildMySkills`` on the hub.\n        \"\"\"\n        url = f\"{self._base_url}/skills\"\n        try:\n            response = self._client.get(\n                url, params={\"owner\": \"me\"}, headers={\"Authorization\": f\"Bearer {token}\"}\n            )\n        except httpx.HTTPError as exc:\n            raise HubError(f\"{self.name}: request failed: {exc}\") from exc\n        if response.status_code in (401, 403):\n            raise HubError(\n                f\"{self.name}: not authenticated — run `skill login` or pass a valid token.\"\n            )\n        if response.status_code >= 400:\n            raise HubError(f\"{self.name}: HTTP {response.status_code}: {response.text[:200]}\")\n        try:\n            payload = response.json()\n        except ValueError as exc:\n            raise HubError(f\"{self.name}: invalid JSON listing skills\") from exc\n        rows = payload.get(\"skills\") if isinstance(payload, dict) else None\n        return [row for row in (rows or []) if isinstance(row, dict)]\n\n    def set_dist_tag(\n        self,\n        slug: str,\n        *,\n        version: str,\n        token: str,\n        tag: str = \"latest\",\n    ) -> dict[str, Any]:\n        \"\"\"Move a dist-tag (default ``latest``) to an existing version (rollback).\"\"\"\n        url = f\"{self._base_url}/skills/{slug}/dist-tags\"\n        try:\n            response = self._client.post(\n                url,\n                json={\"tag\": tag, \"version\": version},\n                headers={\"Authorization\": f\"Bearer {token}\"},","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/services/skill/hub.py#L492-L528","documentation":"Raised by list_my_skills when the response body for the skills listing cannot be parsed as JSON (response.json() raises ValueError). The hub returned HTML or empty content instead of the expected {\"skills\": [...]} object.","triggerScenarios":"Calling list_my_skills when an error page, empty body, or plaintext is returned with (or despite) a 2xx/4xx-other status.","commonSituations":"Proxy or WAF intercepting authenticated requests and returning HTML; misconfigured base_url; hub crash mid-response.","solutions":["Reproduce with curl and inspect the raw body","Fix base_url / proxy configuration","Retry transient failures","If the hub consistently returns non-JSON, report the bug to the hub operator"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"resp = httpx.get(f\"{BASE}/skills\", params={\"owner\":\"me\"}, headers=auth)\nif \"json\" not in resp.headers.get(\"content-type\", \"\"): raise RuntimeError('non-JSON')","typeGuard":null,"tryCatchPattern":"try:\n    hub.list_my_skills(token)\nexcept HubError as e:\n    if \"invalid JSON\" in str(e): return []\n    raise","preventionTips":["Watch for WAF/proxy HTML interception on authenticated requests"],"tags":["hub","invalid-json","list-skills"],"backgroundTag":"invalid-json-response","analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}