{"record":{"id":"0a4a33dc988a7141","repo":"CoplayDev/unity-mcp","slug":"sketchfab-download-returned-no-gltf-url-for-uid","errorCode":null,"errorMessage":"Sketchfab download returned no gltf url for '{uid}': {truncated_response}","messagePattern":"Sketchfab download returned no gltf url for '(.+?)': (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"MCPForUnity/Editor/Services/AssetGen/Providers/SketchfabAdapter.cs","lineNumber":61,"sourceCode":"            spec.Headers[\"Authorization\"] = \"Token \" + apiKey;\n            HttpResult res = await http.SendAsync(spec, ct);\n            return RawOk(res, apiKey, \"preview\");\n        }\n\n        public async Task<string> ResolveDownloadUrlAsync(string uid, string apiKey, IHttpTransport http, CancellationToken ct)\n        {\n            if (string.IsNullOrEmpty(uid)) throw new ArgumentNullException(nameof(uid));\n            if (http == null) throw new ArgumentNullException(nameof(http));\n            var spec = new HttpRequestSpec { Method = \"GET\", Url = ModelsEndpoint + \"/\" + uid + \"/download\" };\n            spec.Headers[\"Authorization\"] = \"Token \" + apiKey;\n\n            HttpResult res = await http.SendAsync(spec, ct);\n            JObject json = ParseOk(res, apiKey, \"download\");\n\n            string url = json[\"gltf\"]?[\"url\"]?.ToString();\n            if (string.IsNullOrEmpty(url))\n            {\n                throw new Exception(SecretRedactor.Scrub(\n                    $\"Sketchfab download returned no gltf url for '{uid}': {ProviderHttp.Truncate(res?.Text)}\", apiKey));\n            }\n            return url;\n        }\n\n        private static string RawOk(HttpResult res, string apiKey, string phase)\n        {\n            string text = ProviderHttp.BodyText(res);\n\n            bool ok = res?.Ok == true;\n            if (!ok)\n                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);","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/CoplayDev/unity-mcp/blob/c21bf496bca87d54e75bad048563c3adb1782081/MCPForUnity/Editor/Services/AssetGen/Providers/SketchfabAdapter.cs#L43-L79","documentation":"Thrown by SketchfabAdapter.ResolveDownloadUrlAsync after a successful HTTP+JSON parse when the body has no gltf.url. The download endpoint is expected to return {gltf:{url:...}}; absence usually means the model is not downloadable under the current token's permissions, or the API shape changed. The uid and truncated response are included, scrubbed of the key.","triggerScenarios":"ResolveDownloadUrlAsync called with a uid that is not downloadable; the Sketchfab account/token lacks download rights for that model's license; uid is stale/removed; API response format changed.","commonSituations":"User picked a uid from a search that wasn't filtered to downloadable=true; a model's license changed to non-downloadable; an unauthenticated/limited token; copy-paste of an old uid.","solutions":["Re-search with downloadable=true (SketchfabAdapter.SearchAsync) and resolve the uid from a fresh result.","Verify the Sketchfab API token has download permissions for the model's license tier.","Inspect the truncated response to confirm whether Sketchfab returned a permission/license error inline.","If the uid is correct but the API changed, update the gltf.url extraction path in ResolveDownloadUrlAsync."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Only resolve downloads for uids known to be downloadable.\nstring results = await sketchfab.SearchAsync(query, categories, downloadable: true, count, cursor, key, http, ct);\n// pick a uid from results before calling ResolveDownloadUrlAsync.","typeGuard":null,"tryCatchPattern":"try { return await sketchfab.ResolveDownloadUrlAsync(uid, key, http, ct); }\ncatch (Exception ex) when (ex.Message.Contains(\"no gltf url\"))\n{ /* re-search downloadable=true for a fresh uid, or verify token download rights */ }","preventionTips":["Always search with downloadable=true and use a uid from those results.","Confirm the Sketchfab token has download permissions for the target license tier.","Re-resolve uids fresh rather than caching them long-term."],"tags":["sketchfab","api-contract","asset-gen","marketplace","permissions"],"backgroundTag":null,"analyzedSha":"c21bf496bca87d54e75bad048563c3adb1782081","analyzedAt":"2026-08-13T17:36:56.095Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}