{"record":{"id":"69b73492b0ac0ed7","repo":"Crosstalk-Solutions/project-nomad","slug":"force-reinstall-failed-69b734","errorCode":null,"errorMessage":"Force reinstall failed","messagePattern":"Force reinstall failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"admin/inertia/pages/settings/system.tsx","lineNumber":54,"sourceCode":"\n  const handleDismissGpuBanner = () => {\n    setGpuBannerDismissed(true)\n    try {\n      localStorage.setItem('nomad:gpu-banner-dismissed', 'true')\n    } catch {}\n  }\n\n  const handleForceReinstallOllama = () => {\n    openModal(\n      <StyledModal\n        title=\"Reinstall AI Assistant?\"\n        onConfirm={async () => {\n          closeAllModals()\n          setReinstalling(true)\n          try {\n            const response = await api.forceReinstallService('nomad_ollama')\n            if (!response || !response.success) {\n              throw new Error(response?.message || 'Force reinstall failed')\n            }\n            addNotification({\n              message: 'AI Assistant is being reinstalled with GPU support. This page will reload shortly.',\n              type: 'success',\n            })\n            try { localStorage.removeItem('nomad:gpu-banner-dismissed') } catch {}\n            setTimeout(() => window.location.reload(), 5000)\n          } catch (error) {\n            addNotification({\n              message: `Failed to reinstall: ${error instanceof Error ? error.message : 'Unknown error'}`,\n              type: 'error',\n            })\n            setReinstalling(false)\n          }\n        }}\n        onCancel={closeAllModals}\n        open={true}\n        confirmText=\"Reinstall\"","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/Crosstalk-Solutions/project-nomad/blob/0bd1c6f4f9888d577fe232de06ac144bb8337131/admin/inertia/pages/settings/system.tsx#L36-L72","documentation":"This error is thrown by the frontend settings page when the call to api.forceReinstallService('nomad_ollama') returns a falsy response or a response with success !== true. It is not a library error; it is a guard for a failed POST to the backend reinstall endpoint, surfacing either the server's message or the generic fallback string.","triggerScenarios":"POST to the force-reinstall endpoint for the nomad_ollama service returning non-2xx, an empty body, or {success:false} — e.g. the Ollama service is not installed, the box is offline, or the reinstall script exits non-zero.","commonSituations":"Ollama binary missing on the appliance, insufficient disk space for the GPU-support reinstall package, backend route/auth middleware rejecting the admin request, or network interruption during the request.","solutions":["Check the backend logs for the reinstall script's exit status and stderr","Verify the Ollama service exists and is registered before offering the button (api call to list services)","Free disk space / verify GPU drivers, then retry the reinstall","If response shape changed, confirm the endpoint returns {success:boolean, message?:string}"],"exampleFix":"// before\nconst response = await api.forceReinstallService('nomad_ollama')\nif (!response || !response.success) {\n  throw new Error(response?.message || 'Force reinstall failed')\n}\n// after\nconst response = await api.forceReinstallService('nomad_ollama')\nif (!response?.success) {\n  throw new Error(response?.message || `Force reinstall failed (HTTP ${response?.status ?? 'no response'})`)\n}","handlingStrategy":"try-catch","validationCode":"const svc = await api.getService('nomad_ollama')\nif (!svc?.installed) return notify('Ollama is not installed; nothing to reinstall')","typeGuard":"const isReinstallResponse = (r: unknown): r is { success: boolean; message?: string } =>\n  typeof r === 'object' && r !== null && typeof (r as any).success === 'boolean'","tryCatchPattern":"try {\n  const r = await api.forceReinstallService('nomad_ollama')\n  if (!r?.success) throw new Error(r?.message || 'Force reinstall failed')\n} catch (e) {\n  addNotification({ message: e instanceof Error ? e.message : 'Force reinstall failed', type: 'danger' })\n} finally {\n  setReinstalling(false)\n}","preventionTips":["Check service installation state before showing the reinstall action","Keep the button disabled while reinstalling is true","Include server message in the notification for actionable diagnostics"],"tags":["ollama","reinstall","frontend","admin-ui"],"backgroundTag":"service-reinstall-failed","analyzedSha":"0bd1c6f4f9888d577fe232de06ac144bb8337131","analyzedAt":"2026-08-27T05:34:15.424Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}