{"record":{"id":"62100d1276c1b524","repo":"CoplayDev/unity-mcp","slug":"sketchfab-phase-failed-status-res-status-62100d","errorCode":null,"errorMessage":"Sketchfab {phase} failed (status={res?.Status}): {detail}","messagePattern":"Sketchfab (.+?) failed \\(status=(.+?)\\): (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"MCPForUnity/Editor/Services/AssetGen/Providers/SketchfabAdapter.cs","lineNumber":91,"sourceCode":"                throw new Exception(SecretRedactor.Scrub($\"Sketchfab {phase} failed (status={res?.Status}): {ProviderHttp.Truncate(text)}\", apiKey));\n            return text ?? string.Empty;\n        }\n\n        private static JObject ParseOk(HttpResult res, string apiKey, string phase)\n        {\n            string text = ProviderHttp.BodyText(res);\n\n            JObject json = null;\n            if (!string.IsNullOrEmpty(text))\n            {\n                try { json = JObject.Parse(text); } catch { /* non-JSON */ }\n            }\n\n            bool ok = res?.Ok == true;\n            if (!ok)\n            {\n                string detail = json?[\"detail\"]?.ToString() ?? json?[\"error\"]?.ToString() ?? ProviderHttp.Truncate(text);\n                throw new Exception(SecretRedactor.Scrub($\"Sketchfab {phase} failed (status={res?.Status}): {detail}\", apiKey));\n            }\n            return json ?? new JObject();\n        }\n    }\n}\n","sourceCodeStart":73,"sourceCodeEnd":97,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/MCPForUnity/Editor/Services/AssetGen/Providers/SketchfabAdapter.cs#L73-L97","documentation":"Thrown by SketchfabAdapter.ParseOk (used by ResolveDownloadUrlAsync) when res.Ok is false. Detail is extracted from the JSON 'detail' then 'error' field, falling back to truncated raw text, scrubbed of the key. This covers HTTP failures on the Sketchfab download endpoint specifically.","triggerScenarios":"401 token invalid; 402/403 download denied by license/permission; 404 uid not found; 429 rate limit; 5xx outage.","commonSituations":"Token lacks download entitlements; model license forbids download; uid stale; rate-limited after many downloads.","solutions":["Read the detail field — 'detail' often carries Sketchfab's license/permission reason.","401/403 -> verify token and download permissions.","404 -> re-resolve the uid from a fresh downloadable search.","429/5xx -> back off and retry."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { return await sketchfab.ResolveDownloadUrlAsync(uid, key, http, ct); }\ncatch (Exception ex)\n{\n    bool transient = ex.Message.Contains(\"status=429\") || ex.Message.Contains(\"status=5\");\n    if (transient) await BackoffRetryAsync(() => sketchfab.ResolveDownloadUrlAsync(uid, key, http, ct), ct);\n    else { /* check token download rights / uid validity */ }\n}","preventionTips":["Read the 'detail' field for Sketchfab's license/permission reason on 402/403.","Verify the token's download entitlements before bulk downloads.","Re-resolve stale uids from a fresh search."],"tags":["sketchfab","http-error","asset-gen","marketplace","permissions","network"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}