{"record":{"id":"e37dab83452185b2","repo":"odysseus-dev/odysseus","slug":"data-error","errorCode":null,"errorMessage":"data.error","messagePattern":"data\\.error","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"static/js/cookbookServe.js","lineNumber":4216,"sourceCode":"      const tagContainer = document.getElementById('serve-tags');\n      if (tagContainer) tagContainer.innerHTML = '';\n      return;\n    }\n    const res = await fetch(`/api/model/cached${params}`);\n    if (!res.ok) {\n      const body = await res.text().catch(() => '');\n      let msg = '';\n      try {\n        const payload = JSON.parse(body);\n        msg = payload && (payload.detail || payload.error || payload.message);\n      } catch {\n        msg = body;\n      }\n      msg = typeof msg === 'string' ? msg.trim() : '';\n      throw new Error(`HTTP ${res.status} ${res.statusText}${msg ? `: ${msg}` : ''}`);\n    }\n    const data = await res.json();\n    if (data && data.error) throw new Error(data.error);\n    _writeCachedModelScan(scanSig, data);\n    _dlWp.destroy();\n    _renderCachedModelsData(list, data, host);\n  } catch (e) {\n    _dlWp.destroy();\n    list.innerHTML = `<div class=\"hwfit-loading\" style=\"flex-direction:column;gap:8px;text-align:center;\"><div style=\"color:var(--red);font-weight:600;\">Cached model scan failed</div><div style=\"font-size:11px;opacity:0.65;max-width:420px;line-height:1.4;\">${esc(e.message)}</div><button type=\"button\" class=\"hwfit-gpu-btn serve-empty-scan-btn\" style=\"height:26px;padding:3px 10px;\">Retry</button></div>`;\n    list.querySelector('.serve-empty-scan-btn')?.addEventListener('click', () => {\n      _fetchCachedModels(true);\n    });\n  }\n}\n\n/** Filter presets matching a model repo */\nfunction _presetsForModel(presets, repo) {\n  const short = repo.split('/').pop();\n  return presets.filter(p => {\n    const pm = p.model || ''; const pn = p.name || '';\n    return pm === repo || pn === repo || pm.split('/').pop() === short || pn === short;","sourceCodeStart":4198,"sourceCodeEnd":4234,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/static/js/cookbookServe.js#L4198-L4234","documentation":"Application-level error after a successful HTTP 200 from GET /api/model/cached: the JSON body contains a truthy error field, meaning the backend completed the request but the cache scan itself failed (e.g. directory unreadable, remote probe error). The raw data.error string becomes the message and the UI shows the failure panel with Retry.","triggerScenarios":"200 response shaped {error:'...'} — models directory missing or unreadable, remote host probe returned an error string, cache path misconfigured in backend settings.","commonSituations":"Cache directory moved or deleted; running in a container without the models volume mounted; remote cache host reachable but the path in config is wrong; partial JSON from a truncated upstream scan.","solutions":["Read data.error — it names the exact backend failure; fix path/permissions accordingly","Confirm the models cache path configured on the backend exists and is listable by the server user","If remote, verify SSH access and the remote path","Retry the scan after the fix (Retry button)"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"function isCachedModelScan(d) {\n  return !!d && typeof d === 'object' && !d.error && Array.isArray(d.models || d.items || d.cached);\n}","tryCatchPattern":"const data = await res.json();\nif (data && data.error) {\n  renderScanFailureWithRetry(list, data.error, () => _fetchCachedModels(true));\n  return; // application-level failure: don't throw into the transport catch\n}\n_writeCachedModelScan(scanSig, data);","preventionTips":["Check data.error before caching (_writeCachedModelScan) so failures aren't persisted as good scans","Narrow the payload shape before rendering so partial/odd bodies fail loudly at the boundary"],"tags":["fetch","application-error","model-cache","scan","serve"],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}