{"record":{"id":"dc254bb7cc83dd5d","repo":"janhq/jan","slug":"backend-installed-but-failed-to-refresh-ui-stri","errorCode":null,"errorMessage":"Backend installed but failed to refresh UI: ${String(e)}","messagePattern":"Backend installed but failed to refresh UI: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"extensions/llamacpp-extension/src/index.ts","lineNumber":2944,"sourceCode":"        }\n      }\n    }\n\n    if (!(await fs.existsSync(expectedBinPath))) {\n      await fs.rm(backendDir)\n      throw new Error(\n        'Not a supported backend archive! Missing llama-server binary.'\n      )\n    }\n\n    try {\n      await this.refreshBackendOptions()\n      logger.info(\n        `Backend ${backendIdentifier}/${version} installed and UI refreshed`\n      )\n    } catch (e) {\n      logger.error('Backend installed but failed to refresh UI', e)\n      throw new Error(\n        `Backend installed but failed to refresh UI: ${String(e)}`\n      )\n    }\n  }\n\n  /**\n   * Install the supplementary CUDA runtime DLLs that upstream ships separately\n   * (`cudart-llama-bin-<backend>.zip`) into every installed backend of that\n   * type, so llama-server can resolve cublas/cudart at launch.\n   */\n  async installCudaRuntime(path: string): Promise<void> {\n    if (\n      !(await fs.existsSync(path)) ||\n      (!path.endsWith('tar.gz') && !path.endsWith('zip'))\n    ) {\n      throw new Error(`Invalid path or file ${path}`)\n    }\n","sourceCodeStart":2926,"sourceCodeEnd":2962,"githubUrl":"https://github.com/janhq/jan/blob/fad3f12a147d138388a66f0d92a02b2675f65294/extensions/llamacpp-extension/src/index.ts#L2926-L2962","documentation":"The backend archive was successfully installed and normalized, but the post-install UI refresh (refreshBackendOptions) threw an error. The install itself is complete, but the UI/settings state may be inconsistent. The error is re-thrown to signal that the user may need to restart the app to see the new backend.","triggerScenarios":"refreshBackendOptions throws: it reads installed backends and updates the settings/UI, which can fail if the settings store is locked, the IPC call times out, or there is a serialization error in the backend options data.","commonSituations":"App is shutting down during the install; settings file is locked by another process; a concurrent settings write causes a read/parse error; the UI was already unmounted.","solutions":["Restart the application — the backend is installed on disk and will be discovered on next launch.","If the error persists, check the settings file for corruption and verify the settings store is writable.","Manually trigger a backend options refresh from the UI after restart."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await extension.installBackend(path)\n} catch (e) {\n  if (e instanceof Error && e.message.includes('failed to refresh UI')) {\n    // Backend IS installed; just needs a restart to appear in UI\n    console.warn('Backend installed; restart the app to see it in the UI')\n  } else {\n    throw e\n  }\n}","preventionTips":["After installing a backend, restart the app if the UI doesn't refresh automatically.","Avoid triggering installs during app shutdown to prevent settings-store conflicts.","Ensure no other process is writing to the settings file during install."],"tags":["backend","ui","refresh","settings","typescript"],"backgroundTag":null,"analyzedSha":"fad3f12a147d138388a66f0d92a02b2675f65294","analyzedAt":"2026-08-12T20:33:47.516Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}